Mathematics in action: Risky Random Walks

A game of Risk (photo: A.R.N. Rødner)









Mathematics in action: Probability


Today we begin a series of three posts on probability. We begin with some experiments on rolling dice. To save my wrists, I’ve used random numbers from instead.

We begin with individual dice rolls. Rolling 1200 times, we expect each number to come up about 200 times, and the histogram below shows that that’s pretty much what happens. We expect the average (mean) of the numbers rolled to be 3.5, and for my 1200 rolls it was actually very close to that (3.495833). We expect the standard deviation of the numbers rolled to be sqrt(s − 3.52) = sqrt(35/12) = 1.707825, where s is the mean of the squares of the numbers (1, 4, 9, 16, 25, 36). The actual sample standard deviation was 1.704133. It is generally more convenient to work with the variance, however, which is the square of the standard deviation (2.904069, which is very close to 35/12 = 2.916667).

Histogram of 1200 individual dice rolls. The dark blue dots and line show the expected results.

Rolling pairs of dice, we expect a sum of 2 to come up, on average once in 36 rolls. We expect 3 to come up twice (as 1+2 and as 2+1), 4 to come up three times (as 1+3, 2+2, and 3+1), etc. The histogram below shows what actually happens.

We expect the average (mean) of the numbers rolled to be 7, and it was actually very close to that (7.019167). The great thing about adding random numbers is that the variance of the sum is the sum of the individual variances, so we expect the variance to be 70/12 = 5.833333. The actual sample variance for my 1200 rolls was 5.831993.

Histogram of 1200 dice pair rolls. The dark blue dots and line show the expected results.

There is an amusing take on dice pair rolls in Asterix and the Soothsayer, where the soothsayer is trying not to predict the result of a dice pair roll. Given the choice of numbers from I to XII, he guesses VII, which is of course the most likely outcome, and the one which actually comes up (which is the least likely outcome?).

Rolling a larger number of dice, the expected outcome follows a bell curve. The expected mean for twenty dice is 20 × 3.5 = 70 (for my 800 rolls of twenty dice it was actually 70.12). The expected variance is 20 × 35 / 12 = 58.33333 (for my 800 rolls of twenty dice the sample variance was actually 60.42113). The standard deviation (the square root of the variance) determines the “width” of the bell curve. Similar bell curves occur whenever a result is composed of a large number of independent factors (of roughly equal weight) added together.

Histogram of 800 rolls of twenty dice. The dark blue bell curve shows the expected results.

Mathematics in action: Alea jacta est and Random graphs

Having posted about the mathematics of dice, here is a way to use dice to teach a seemingly unrelated concept, that of random graphs (also known as Erdős–Rényi networks).

Random graphs are networks where the links are introduced at random, among a pre-existing set of nodes. Here, the nodes will be the numbers from 1 to N = 20. The theory of random graphs, described in the classic textbook by Béla Bollobás, is quite beautiful.

The theory of random graphs is sometimes introduced as a game involving buttons and string. However, I cannot recommend that – it leads to the most horrible tangled mess. Instead, I suggest using a pair of icosahedral (d20) dice, like this one (such dice can be obtained from games shops, although I must confess to using to do my dice rolls):

The first dice roll gives 2 and 4 (we re-roll any pairs which are doubles, or which have come up before). Each pair of numbers like this represents a random link in the network. We write the numbers 1 to 20 on a piece of paper, and draw a line between 2 and 4:

The second dice roll gives 1 and 12, so we add a link between those two numbers. A common measure of the density of links is the average degree, which is the average number of links per node. In this case, the average degree is the number of links divided by 10 (not by 20, because each link connects two nodes):

We keep repeating this process, and at an average degree of 1, something interesting starts to happen. A giant component begins to emerge – one big cluster containing many nodes (accompanied by smaller clusters and isolated nodes). The giant component is more impressive with a larger number of nodes, of course.

At an average degree of around log(N), taking (natural) logarithms to the base e = 2.7182818284…, enough random links have been introduced that the network becomes connected. We have log(20) = 3.00, but for this particular set of dice rolls, the network becomes connected at an average degree of 2.5. For larger networks, this connectivity threshold becomes quite sharp.

Additional random links reduce the average distance (mean path length) between pairs of nodes. This is the average number of “hops” needed to get from one node to another. Here the average degree is 6, and the average distance is 1.758:

For connected networks with an average degree of d, the average distance will be approximately log(N) / log(d). This function is shown by the red line below (with black dots showing measured values for our set of dice rolls). For large networks, this formula gives quite a small number, and the property of having small average distances is often called the “small world” property.

There is much more to the study of random graphs, of course, but we can see that a simple pair of icosahedral (d20) dice is enough to introduce the basics.

Mathematics in action: dice

We are all familiar with dice of various kinds. With fair dice, each number will come up with equal probability, regardless of how the die is rolled. This requires a degree of symmetry – we want a die to be a polyhedron where all the faces are equivalent. The obvious candidates are therefore the five Platonic solids, in which not only the faces, but also the edges and vertices are equivalent. The Platonic solids give us the common d4, d6, d8, d12, and d20 dice:

Five Platonic dice (d4, d6, d8, d12, d20) and two pentagonal trapezohedra (d10) – photo by “Copat”

However, the Platonic solids are more symmetrical than necessary for the job. A tetragonal disphenoid, for example, makes a very good d4:

A tetragonal disphenoid makes an alternative d4 – photo by “Traitor”

What is required is that a die be isohedral (also called “face-transitive”). Each face should be equivalent. Specifically, for any numbers A and B, given the die with A on top, there should be a series of rotations and reflections that make the die look like the starting position, but with B on top. This rules out shapes like the gyroelongated square bipyramid, where all the faces are equilateral triangles, but the triangles are not equivalent (the “end” triangles differ from the “middle” triangles):

A gyroelongated square bipyramid does not make a fair die – photo by Andrew Kepert

We also want a die to be convex, so that it can land on its faces. Stellated polyhedra are excluded:

Stellated polyhedra cannot be dice – mosaic in St Mark’s Basilica, Venice

Trapezohedra satisfy this “convex and isohedral” rule, and the pentagonal trapezohedron is commonly used as a d10 (see the picture above). Trapezohedra work best with 10, 14, 18, … sides, since then pairs of faces can be parallel, and there can be an unambiguous “top” number. The cube can be seen as a special case of a trapezohedron.

For 12, 16, 20, …. sides, bipyramids make good dice (the octahedron is a special case of a bipyramid):

A bipyramid makes a good d16 – photo by “Traitor”

These are not the only shapes satisfying the definition, however. The 13 Catalan solids also satisfy it, and some of them make good candidates for dice. For example, the deltoidal icositetrahedron and the tetrakis hexahedron are both good candidates for d24:

The deltoidal icositetrahedron and tetrakis hexahedron are alternatives for d24 – photos by Jacqueline de Swart (left) and “Traitor” (right)

Some Catalan solids, like the pentagonal icositetrahedron, are unsuitable as dice because there is no unambiguous “top” number. On the other hand, there are some additional variations that are isohedral, like the hexakis tetrahedron.

For more on this subject, see Alea Kybos’ impressive dice page.