A chaos game is a method for generating a set of points randomly. Pick a point inside a regular n-gon (the centre will do) and then move a constant fraction r of the distance towards one of the vertices, chosen at random. Then choose another vertex randomly and move the fraction r of the distance towards that. Repeat this process. If the values are picked correctly, the points form fractals:

It seems almost as though these fractals put in a surprise appearance here, but thinking about the chaos game a little more helps to make it feel a little less strange.
Probability is a strange beast. Yesterday, on Twitter, I was asked by IT investor @GarethBrown what the probability is of him sharing a credit card PIN with someone else in a room of 500 people.
Assuming that the PINs are assigned randomly, which I think is reasonable with such a large sample, the answer is quite simple. Considering each person in turn, the probability of having a different pin to you is 0.9999 (there’s only a 1 in 10000 chance of sharing) so the probability of not matching with anyone is (0.9999)500, therefore the probability of matching with someone is 1-(0.9999)500 = 4.9%. Fairly unlikely: it should only happen about a twentieth of the time.
The interesting thing about this question is that if the precise meaning is changed so that instead of being interested in the probability of Gareth sharing a PIN with someone else, we are now interested in the probability of any two of the 500 people sharing, the results are vastly different. Here is a plot of the probability of Gareth sharing (in blue), and the probability of anybody sharing (in purple), against group size.

A Platonic solid is a convex polyhedron where all of the faces are identical regular shapes. There are only five Platonic solids:

From left to right they are the cube, the dodecahedron, the icosahedron, the octahedron and the tetrahedron. Because all of the faces and edges are the same, Platonic solids make good dice. They have six, twelve, twenty, eight and four sides, respectively. The convex part means that you can connect any two points on the surface with a straight line that doesn’t leave the solid (ie there are no ‘overhangs’).
Let’s think about why there are only five.
Leonhard Euler, the famous Swiss mathematician known for discoveries in just about every area of mathematics, pointed out that, if V is the number of vertices, E is the number of edges, and F is the number of faces of any convex polyhedron, then the following is always true:
Below is a Mathematica plot of a ‘squircle’ of radius 1.

A squircle is intended to be half way between a circle and a square, and has the equation
In 1904, Swedish mathematician Helge von Koch described a curve that can be easily constructed from triangles but doesn’t have tangents, which roughly means that it isn’t possible to pick a point on the curve and say what direction the curve is going in as it passes through. The Koch curve is more widely known as the Koch snowflake, which is comprised of three of the curves arranged in a triangle:

Constructing the Koch snowflake is easy. Simply start with an equilateral triangle and add triangles with a third of the side length to every side to make a new shape. Then repeat the process again and again, an infinite number of times. The first few steps in the process are shown below.

A few weeks ago I purchased a student license for Mathematica. I heard about Mathematica originally when looking into the technology behind the fantastic Wolfram Alpha website, which I continue to use regularly as a kind of calculus-aware desktop calculator.
It would be fair to say that Mathematica has, as it promised, revolutionised my ability to quickly visualise mathematical comcepts. Where previously I might have explored an idea through a few dozen or maybe a few hundred lines of Python (or rather, I might not have done so), I can now explore the same idea through just a few lines of Mathematica code. Mathematica has built in features that allow mathematical structures (and anything else you can depict in a diagram) to be manipulated in a way that gives the user a real feel for what is going on, and can lead to a much deeper understanding of a concept that can typically be gained from reading a textbook or web page.
Finding the nth roots of a number is the problem of finding all the numbers that give you back your original number when you raise them to the nth power. For example, you might say that the second roots (that is, the square roots) of 4 are 2 and -2, because when you square either of those you get back to 4.
When 2 and -2 are raised to every single power between 1 and 2, they trace lines back to 4, on an ‘Argand diagram’:

What’s going on in this diagram? Powers between 1 and 2 of -2 give ‘complex numbers’, which are numbers that have two parts, added together. One is a multiple of 1 (ie a normal number) and the other is a multiple of i (the square root of -1). Any complex number can be plotted on a pair of axes by converting the number x+iy into the point (x,y), and this is the purpose of an Argand diagram.
The diagram shows that the powers of 2 give numbers that are all real, because the line that they form in the complex plane goes straight along the ‘real axis’ that represents the standard number line. The powers of -2, however, veer straight off the real axis and into complex territory. Eventually they arc round to hit 4 when we reach the power 2. This makes sense, since the square of -2 is 4.

Imagine that you are flying a plane that leaves blue contrails behind, the colour of which becomes increasingly dark over the duration of the flight. To make navigation easier, you assign (x,y,z) coordinates to an area of sky, and fly up to the point (1,1,1). From then on, under strict instructions from the owner of the aircraft, you make sure that your velocity along each of the three coordinate axes that you set up earlier is exactly as specified by these three equations:
Here are 500 points in a unit square, and (possibly) the shortest tour of all of the points.

The tour is just under 17 unit lengths. It is widely known that it is hard to find the shortest tour, and the tour above may or may not be the shortest. According to the documentation for the relevant Mathematica function, it should be close to the shortest. The problem of finding the shortest tour is known as the ‘Travelling Salesman Problem’.
One thing to note is that this tour never crosses itself; it simply winds around touching each point and returning to a point close to the one it started at. It is natural to ask, then, whether there any sets of points giving shortest tours that do cross themselves, or whether they all give winding paths like the one above.
Just after Pi Day I posted about computing pi quickly. I used a method called the Van Wijngaarden transformation, which is actually a special case of the ‘Euler transformation’, to accelerate the convergence of this infinite series for pi:
![]()
I described how to apply the transformation, but did not explain why it worked. At the time I didn’t really understand it myself; it was was just apparent that it did work. It turns out to be quite intuitive to understand, but I don’t think that it is immediately obvious. Plotting the partial sums of the above sequence, we see the series closing in on pi slowly, alternating between being too small and being too big.

One of Leonhard Euler’s many, many contributions to the world of mathematics is a technique for transforming this sequence into a new one that converges more quickly. The rows of averages from my previous post are exactly equivalent to joining up the midpoints of the lines formed by the original sequence plot. Showing this graphically, it is clear that the new sequence must converge to the same limit, but does so much more rapidly.