# Blog

## Archive

Show me a random blog post**2018**

### Jul 2018

World Cup stickers 2018, pt. 3Mathsteroids

### Jun 2018

World Cup stickers 2018, pt. 2### May 2018

A bad Puzzle for Today### Apr 2018

Building MENACEs for other games### Mar 2018

A 20,000-to-1 baby?World Cup stickers 2018

### Jan 2018

*Origins of World War I*

Christmas (2017) is over

**2017**

**2016**

**2015**

**2014**

**2013**

**2012**

## Tags

folding paper folding tube maps london underground platonic solids london rhombicuboctahedron raspberry pi weather station programming python php inline code news royal baby probability game show probability christmas flexagons frobel coins reuleaux polygons countdown football world cup sport stickers tennis braiding craft wool emf camp people maths trigonometry logic propositional calculus twitter mathslogicbot oeis matt parker pac-man graph theory video games games chalkdust magazine menace machine learning javascript martin gardner noughts and crosses reddit national lottery rugby puzzles game of life dragon curves fractals pythagoras geometry triangles european cup dates palindromes chalkdust christmas card ternary bubble bobble asteroids final fantasy curvature binary arithmetic bodmas statistics error bars estimation accuracy misleading statistics pizza cutting captain scarlet gerry anderson light sound speed manchester science festival manchester dataset a gamut of games hexapawn nine men's morris draughts chess go radio 4 data map projections aperiodical big internet math-off sorting**2014-09-04**

## Electromagnetic Field talk

### Flexagons, folding tube maps, braiding & sine curves

Last weekend, I attended Electromagnetic Field, a camp for hackers, geeks, makers and the interested. On the Sunday, I gave a talk on four mathematical ideas/tasks which I have encountered over the past few years: Flexagons, Folding Tube Maps, Braiding and Sine Curves. I'd love to see photos, hear stories, etc from anyone who tries these activities: either comment on here or tweet @mscroggs.

### Flexagons

It's probably best to start by showing you what a flexagon is...

What you saw there is called a

*trihexaflexagon*.*Tri-*because it has three faces;*-hexa-*because it is a hexagon; and*-flexagon*because it can be flexed to reveal the other faces.The story goes that, in 1939, Arthur H. Stone, who was an Englishman studying mathematics at Princeton, was trimming the edges off his American paper to fit in his English folder. He was fiddling with the offcuts and found that if he folded the paper under itself in a loop, he could make a hexagon; and when this hexagon was folded up as we saw, it would open out to reveal a different face.

The way it flexes can be shown on a diagram: In the circles, the colour on either side of the flexagon is shown and the lines show flexes which can be made.

When Stone showed his flexagon to other students at Harvard, they were equally amazed by it, and they formed what they called 'The Flexagon Committee'. Members of the committee included Richard Feynman, who was then still a graduate student. The committee could meet regularly and soon discovered other flexagons, the first of which was the hexahexaflexagon: Again shaped like a hexagon, but this time with six faces.

A hexahexaflexagon is created by taking a longer strip of paper and rolling it around itself like this. The shorter strip at the end is then folded and glued in the same way the trihexaflexagon was. Once made, the hexahexaflexagon can be flexed. From some positions, the flexagon can be flexed in different ways to reveal different faces. Due to this, finding some of the faces can be quite difficult.

The committee went on to find other flexagons which could be made, again made by first folding into a shorter strip, then folding up like the trihexaflexagon.

The committee later found that hexaflexagons with any number of faces could be made by starting with a certain shaped strip, rolling it up then folding it like a trihexaflexagon.

#### Resources & further reading

An excellent article by Martin Gardner on flexagons can be found in this book.

Trihexaflexagon templates (click to enlarge then print):

Our second story starts with me sitting on the tube reading

*Alex's Adventures in Numberland*by Alex Bellos on the tube. In his book, Alex describes how to fold a tetrahedron, or triangle-based pyramid, from two business cards. With no business cards to hand, I picked up two tube maps and followed the steps: first, I folded it corner to corner; then I folded the overlaps over.I made another one of these, but the second a mirror image of the first, slotted them together and I had my tetrahedron.Then I made a tube map cube by making six squares like so and slotting them together.

While making these shapes, I discovered an advantage of tube maps over business cards: Due to the pages, folded tube maps have slots to tuck the tabs into, so the solids are pretty sturdy.

Making these shapes got me wondering: what other Platonic solids could I make?

In 2D, we have regular shapes: shapes with all the sides of the same length and all angles equal. Platonic solids are sort of the 3D equivalent of this: they are 3D shapes where every face is the same regular shape and at each vertex the same number of faces meet.

For example, our tetrahedron is a Platonic solid because every side is a regular triangle, and three triangles meet at every vertex. Our cube is a Platonic solid because every side is a square (which is a regular shape) and three squares meet at every vertex.

In order to fold all the Platonic solids, we must first find out how many there are.

To do this, we're going to start with a triangle, as it is the 2D shape with the smallest number of sides, and make Platonic solids.

If we try to put two triangles at each vertex, then they'll squash flat; so that's no good. We've seen that three triangles at each vertex makes a tetrahedron. If we put four triangles at each vertex then we get an octahedron.

Five triangles at each vertex gives us an icosahedron.

Each angles in an equilateral triangle is 60°. So if we put six triangles at each vertex the angles add up to 360°, a full turn. This means that the triangles will lie flat, giving us a nice pattern for a kitchen floor, but not a solid. Any more than 6 triangles will add up to more than 360 and also not give a solid. So we have found all the Platonic solids whose faces are triangles.

Next, four sided faces. Three squares at each vertex gives us a cube. Four squares at each vertex will add up to 4 times 90°... 360° again, so another kitchen floor and as before we have all the Platonic solids whose faces are squares.

Now moving up again to five sided faces. Three pentagons at each vertex will gives us a dodecahedron, which looks like this.

This is the best I could do.

(After the talk, I was shown a few better ways to fold pentagons. Watch this space for my attempts...) Now if we try four pentagons around a vertex: the internal angle in a pentagon is 108°. 4 times 108° is 432°. This is more than a full turn, so we don't get a solid.

Moving up again, if we take three hexagons we get another tessellation. Shapes with more than six sides will all have larger angles than this so three make more than a full turn.
Therefore, we have found and folded all the Platonic solids.

In 2012, I posted this on my blog and got the following comment:

I'm pretty sure this was a joke, but one hour, 48 tube maps and a lot of glue later:

#### Resources & further reading

*Alex's Adventures in Numberland*by Alex Bellos introduced business card folding and takes it further, finishing with a business card Menger sponge.

### Braiding

A few months ago, my mother showed my a way to make braids using a cardboard octagon with a slot cut on each side and a hole in the middle.

To make a braid, seven strands of wool are tied together, fed through the hole, then one tucked into each slot.

Now, we jump over two strands, pick the third strand and move it to the vacant slot. So first, we jump over the orange and green and move the red strand.

Then we jump the light blue and yellow and move the dark blue.

And so on..

After a while, the braid looks like this:

Once I'd made a few braids, I began to wonder which other numbers of threads could be used to make braids like this. To investigate this I found it useful to represent braids by drawing connections to show where a thread is moved. This shows the first move:

Then the second move:

And so on until you get:

After the octagon, I tried braiding on a hexagon, moving the second thread each time. Here's what happened:

I only moved the yellow and green threads and nothing interesting happened. When I drew this out as before, it demonstrated what had gone wrong: three slots are missed so three threads are never moved.

So we need to find out when slots are missed and when all the slots are hit. To do this, let's call the number of slots \(a\), and let \(b\) be the number thread we pick each time. For example, in the first braid that worked \(a\) was 8 and \(b\) was 3.

First we'll label the slots. Label the slot which starts empty 0, then number anti-clockwise. This numbering puts all the multiples of \(a\) at the bottom slot.

Now let's look at which slots we visit. We start at0, then visit \(b\), then \(2b\), then \(3b\) and so on. We visit all the multiples of \(b\).

Therefore we will reach the bottom slot again and finish our loop when we reach a common multiple of \(a\) and \(b\). The first time this happens will be at the lowest common multiple, or:

$$\mbox{lcm}(a,b)$$
On our way to this slot, we visited one slot for every \(a\) we passed, so the number of slots we have visited is

$$\frac{\mbox{lcm}(a,b)}{a}$$
and we will visit every slot if

$$\frac{\mbox{lcm}(a,b)}{a}=b$$
or, equivalently if

$$\mbox{lcm}(a,b)=ab.$$
This is true when, \(a\) and \(b\) have no common factors, or in other words are coprime; which can be written

$$\mbox{hcf}(a,b)=1.$$
So we've found that if \(a\) is the number of slots and \(b\) is the jump then the braid will not work unless \(a\) and \(b\) are coprime.

For example, if \(a\) is 6 and \(b\) is 2 then 2 is a common factor so the braid fails. And, if \(a\) is 8 and \(b\) is 3 then there are no common factors and the braid works. And, if \(a\) is 12 and \(b\) is 5 then there are no common factors and the braid works.

But, if \(a\) is 5 and \(b\) is 2 then there are no common factors but the braid fails.

The rule I've explained is still correct, and explains why some braids fail. But if \(a\) and \(b\) are coprime, we need more rules to decide whether or not the braid works.

And that's as far as I've got, so I'm going to finish braiding with two open questions: Why does the 5 and 2 braid fail? And for which numbers \(a\) and \(b\) does the braid work?

### Sine curves

For the last part of the talk, I did a practical demonstration of how to draw a sine curve using five people.

I told the first person to stand on the spot and the second person to stand one step away, hold a length of string and walk.

The third person was instructed to stay in line with the second person, while staying on a vertical line.

The fourth person was told to walk in a straight line at a constant speed.

And the fifth person had to stay in line with both the third and fourth people. This led them to trace a sine curve.

To explain why this is a sine curve, consider the following triangle:

As our first two people are one step apart, the hypotenuse of this triangle is 1. And so the opposite (vertical) side is equal to the sine of the angle.

I like to finish with a challenge, and this task leads nicely into two challenge questions:

1. How could you draw a cosine curve with five people?

2. How could you draw a tan(gent) curve with five people?

#### Resources & further reading

*People Maths: Hidden Depths*is full of this kind of dynamic task involving moving people.

### Similar posts

Tube map Platonic solids, pt. 2 | Tube map stellated rhombicuboctahedron | Tube map Platonic solids, pt. 3 | Tube map Platonic solids |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**2014-06-21**

## Tennis maths

### The smallest share of points & serving stats

With World Cup fever taking over, you may have forgotten that Wimbledon is just a few days away.

### Tennis scoring

Tennis matches are split into sets (three sets for ladies' matches, five sets for men's), which are in turn split into games. The players take it in turns to serve for a game. The scoring in a game is probably best explained with a flowchart (click to enlarge):

To win a set, a player must win at least six games and two more games than their opponent. If the score reaches six games all, then a tie break is played. In this tie break, the first player to win at least seven points and two points more than their opponent wins. In the final set there is no tie break, so matches can last a long time.

### Winning with the smallest share of points

Due to the way tennis is split into sets and games, the player who wins the most points will not necessarily win the match. This got me thinking: what is the smallest proportion of points which can be won while still winning the tennis match?

First, let's consider a men's match. In order to win with the lowest proportion of points, our player should let his opponent win two sets without winning a point and win the other three sets. In the two lost sets, the opponent should win 0-6 taking every point: in total the opponent will win 48 points in these sets.

Leaving the final set for now, the other two sets are won by our player. To win these with the smallest proportion of the points, they should be won 7-6 on a tie break. In the 6 lost games, the opponent should take all the points. In the won games and the tie break, our player should win by two points with the lowest total score. (Winning with more than the lowest total score will mean both players win an equal number of extra points, moving the proportion of points our player wins closer to 50%, higher than it needs to be.)

Therefore, our player will win 4 points out of 6 in the games he wins, win 0 out of 4 points in the games he loses and wins the tie break 7 points to 5. This means that in total our player will 62 points out of 144 in the two won sets.

For the same reason as above, the final set should be won with the lowest total score: 6-4. Using the same scores for each game, our player wins 24 points out of 52.

Overall, our player has won 86 points out of 244, a mere

**35%**of the points.If the match is a ladies' match then the same analysis will work, but with each player winning one less set. This gives our player 55 points out of 148,

**37%**of the points.This result demonstrates why tennis remains exciting through the whole match. The way tennis is split into sets and games means that our opponent can win 65% of the points but if the pressure gets to them at the most important points, our player can still win the match. This makes for a far more interesting competition than a simple race to one hundred points which could quickly become a foregone conclusion.

### Comparing players with serving stats

During tennis matches, players are often compared using statistics such as the percentages of serves which are successful. Imagine a match between Player A and Player B.

In the first set, Player A and Player B are successful with 100% and 92% of their serves respectively. In the second set, these figures are 56% and 48%. Player A clearly looks to be the better server, as they have a higher percentage in each set. However if we look at the two sets in more detail:

Player A | Player B | |

First Set | 20/20 | 67/73 |

Second Set | 45/80 | 13/27 |

Total | 65/100 | 80/100 |

Overall, Player B has an 80% serve success rate, while Player A only manages 65%.

This is an example of Simpson's paradox: a trend which appears in the set-by-set data disappears when the data is combined. This occurs because when we look at the set-by-set percentages, the total number of serves is not taken into account: Player A served more in the second set so their overall percentage will be closer to 56%; Player B served more in the first set so their overall percentage will be closer to 92%.

### Similar posts

World Cup stickers 2018, pt. 3 | World Cup stickers 2018, pt. 2 | World Cup stickers 2018 | Euro 2016 stickers |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**Add a Comment**

**2014-05-26**

## World Cup stickers

With the FIFA World Cup approaching, sticker fans across the world are filling up their official Panini sticker books. This got me wondering: how many stickers should I expect to need to buy to complete my album? And how much will this cost?

### How many stickers?

There are 640 stickers required to fill the album. The last 100 stickers required can be ordered from the Panini website.

After \(n\) stickers have been stuck into the album, the probability of the next sticker being the next new sticker is:

$$\frac{640-n}{640}$$
The probability that the sticker after next is the next new sticker is:

$$\frac{n}{640}\frac{640-n}{640}$$
The probability that the sticker after that is the next new sticker is:

$$\left(\frac{n}{640}\right)^2\frac{640-n}{640}$$
Following this pattern, we find that the expected number of stickers bought to find a new sticker is:

$$\sum_{i=1}^{\infty}i \left(\frac{640-n}{640}\right) \left(\frac{n}{640}\right)^i = \frac{640}{640-n}$$
Therefore, to get all 640 stickers, I should expect to buy:

$$\sum_{n=0}^{639}\frac{640}{640-n} = 4505 \mbox{ stickers.}$$
Or, if the last 100 stickers needed are ordered:

$$\sum_{n=0}^{539}\frac{640}{640-n} + 100 = 1285 \mbox{ stickers.}$$
### How much?

The first 21 stickers come with the album for £1.99. Additional stickers can be bought in packs of 5 for 50p or multipacks of 30 for £2.75. To complete the album, 100 stickers can be bought for 25p each.

If I decided to complete my album without ordering the final stickers, I should expect to buy 4505 stickers. After the 21 which come with the album, I will need to buy 4484 stickers: just under 897 packs. These packs would cost £411.25 (149 multipacks and 3 single packs), giving a total cost of

**£413.24**for the completed album.I'm not sure if I have a spare £413.24 lying around, so hopefully I can reduce the cost of the album by buying the last 100 stickers for £25. This would mean that once I've received the first 21 stickers with the album, I will need to buy 1164 stickers, or 233 packs. These packs would cost £107 (38 multipacks and 5 single packs), giving a total cost of

**£133.99**for the completed album, significantly less than if I decided not to buy the last stickers.### How many should I order?

The further reduce the number of stickers bought, I could get a friend to also order 100 stickers for me and so buy the last 200 stickers for 25p each. With enough friends the whole album could be filled this way, although as the stickers are more expensive than when bought in packs, this would not be the cheapest way.

If the last 219 or 250 stickers are bought for 25p each, then I should expect to spend

**£117.74**in total on the album. If I buy any other number of stickers at the end, the expected spend will be higher.Fortunately, as you will be able to swap your duplicate stickers with your friends, the cost of a full album should turn out to be significantly lower than this. Although if saving money is your aim, then perhaps the Panini World Cup 2014 Sticker Book game would be a better alternative to a real sticker book.

### Similar posts

World Cup stickers 2018, pt. 3 | World Cup stickers 2018, pt. 2 | World Cup stickers 2018 | Euro 2016 stickers |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**Add a Comment**

**2014-04-11**

## Countdown probability, pt. 2

As well as letters games, the contestants on Countdown also take part in numbers games. Six numbers are chosen from the large numbers (25,50,75,100) and small numbers (1-10, two cards for each number) and a total between 101 and 999 (inclusive) is chosen by CECIL. The contestants then use the six numbers, with multiplication, addition, subtraction and division, to get as close to the target number as possible.

The best way to win the numbers game is to get the target exactly. This got me wondering: is there a combination of numbers which allows you to get every total between 101 and 999? And which combination of large and small numbers should be picked to give the highest chance of being able to get the target?

To work this out, I got my computer to go through every possible combination of numbers, trying every combination of operations. (I had to leave this running overnight as there are a lot of combinations!)

### Getting every total

There are 61 combinations of numbers which allow every total to be obtained. These include the following (click to see how each total can be made):

- 5 6 8 9 10 100
- 5 6 7 8 10 100
- 4 6 7 8 9 100
- 3 6 7 8 10 100
- 3 5 7 8 9 100
- 2 5 6 8 9 100
- 2 6 7 8 9 100
- 5 6 8 9 75 100
- 3 6 8 10 75 100
- 2 6 9 10 75 100

By contrast, the following combination allows no totals between 101 and 999 to be reached:

- 1 1 2 2 3 3

The number of attainable targets for each set of numbers can be found here.

### Probability of being able to reach the target

Some combinations of numbers are more likely than others. For example, 1 2 25 50 75 100 is four times as likely as 1 1 25 50 75 100, as (ignoring re-orderings) in the first combination, there are two choices for the 1 tile and 2 tile, but in the second combination there is only one choice for each 1 tile. Different ordering of tiles can be ignored as each combination with the same number of large tiles will have the same number of orderings.

By taking into account the relative probability of each combination, the following probabilities can be found:

Number of large numbers | Probability of being able to reach target |

0 | 0.964463439 |

1 | 0.983830962 |

2 | 0.993277819 |

3 | 0.985770510 |

4 | 0.859709475 |

So, in order to maximise the probability of being able to reach the target, two large numbers should be chosen.

However, as this will mean that your opponent will also be able to reach the target, a better strategy might be to pick no large numbers or four large numbers and get closer to the target than your opponent, especially if you have practised pulling off answers like this.

Edit: Numbers corrected.

Edit: The code used to calculate the numbers in this post can now be found here.

### Similar posts

Countdown probability | Pointless probability | World Cup stickers 2018, pt. 3 | World Cup stickers 2018, pt. 2 |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**2016-07-20**

Matthew

**2016-07-20**

Matthew

**2016-07-20**

I'm a fan of the game myself (but then I'm French, so to me it's the original, "Des chiffres et des lettres"), but for the numbers game, this is pretty much irrelevant to the language and country :)

Francis Galiegue

**Add a Comment**

**2014-04-06**

## Countdown probability

On Countdown, contestants have to make words from nine letters. The contestants take turns to choose how many vowels and consonants they would like. This got me wondering which was the best combination to pick in order to get a nine letter word.

Assuming the letters in countdown are still distributed like this, the probability of getting combinations of letters can be calculated. As the probability throughout the game is dependent on which letters have been picked, I have worked out the probability of getting a nine letter word on the first letters game.

### The probability of YODELLING

YODELLING has three vowels and six consonants. There are 6 (3!) ways in which the vowels could be ordered and 720 (6!) ways in which the consonants can be ordered, although each is repeated at there are two Ls, so there are 360 distinct ways to order the consonants. The probability of each of these is:

$$\frac{21\times 13\times 13\times 6\times 3\times 5\times 4\times 8\times 1}{67\times 66\times 65\times 74\times 73\times 72\times 71\times 70\times 69}$$
So the probability of getting YODELLING is:

$$\frac{6\times 360\times 21\times 13\times 13\times 6\times 3\times 5\times 4\times 8\times 1}{67\times 66\times 65\times 74\times 73\times 72\times 71\times 70\times 69} = 0.000000575874154$$
### The probability of any nine letter word

I got my computer to find the probability of every nine letter word and found the following probabilities:

Consonants | Vowels | Probability of nine letter word |

0 | 9 | 0 |

1 | 8 | 0 |

2 | 7 | 0 |

3 | 6 | 0.000546 |

4 | 5 | 0.019724 |

5 | 4 | 0.076895 |

6 | 3 | 0.051417 |

7 | 2 | 0.005662 |

8 | 1 | 0.000033 |

9 | 0 | 0 |

So the best way to get a nine letter word in the first letters game is to pick five consonants and four vowels.

### Similar posts

Countdown probability, pt. 2 | Pointless probability | World Cup stickers 2018, pt. 3 | World Cup stickers 2018, pt. 2 |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**Add a Comment**

**© Matthew Scroggs 2018**

Add a Comment