杏吧原创

The 19th-century maths that can help you deal with horrible coffee

Do you need to fairly allocate players to teams, or sort out a pot of badly brewed coffee? Katie Steckles has a mathematical solution
Can maths improve these cups of coffee?
Alexander Spatari/Getty Images

Imagine you have a pot of coffee that amounts to two cups鈥 worth. It has been brewed badly, so it is much stronger at the bottom than at the top. If coffee is poured out of the pot into two cups, the first one you pour will be significantly weaker than the second one.

While this is a slightly contrived situation, there are other occasions when this kind of 鈥渇irst is worse鈥 (or 鈥渇irst is better鈥) setup creates unfairness.

Say we are picking teams for a football game and everyone knows roughly which players are better than others. If you allowed one team captain to pick all of their players first, leaving the other captain with whoever remains, there would be a serious imbalance in how good the teams are.

Even just taking turns at picking doesn鈥檛 make this fair: if there were players whose skills could be roughly ranked from 1 to 10, then captain A, picking first, would choose 10, then captain B would pick 9, then captain A would choose 8, and so on. Overall, the team picking first would have 10 + 8 + 6 + 4 + 2, giving a total of 30, while the other would have 9 + 7 + 5 + 3 + 1, which totals 25.

So, how can we fairly allocate players? A 19th-century maths sequence has the answer. Originally studied by Eug猫ne Prouhet in the 1850s, but then written about more extensively by Axel Thue and Marston Morse in the early 20th century, the Thue-Morse sequence requires that you don鈥檛 just take turns: you take turns at taking turns.

Let鈥檚 say the two team-pickers are called A and B. The sequence would then be: ABBA. The first pair are in one order, but then the second pair are in reverse order. If we want to continue the sequence, we can repeat the same set again, but flipping As and Bs: ABBA BAAB. This can be continued (taking turns at taking turns at taking turns), giving ABBA BAAB BAAB ABBA, and so on.

This ordering makes things fairer. In our team-picking example, instead of 30 vs 25, the teams are now 10 + 7 + 5 + 4 + 1 and 9 + 8 + 6 + 3 + 2, totalling 27 and 28.

Versions of this sequence are often used in real sporting competitions. Tie-breaks in tennis involve one player serving the first point, then the players take turns to serve two consecutive points 鈥 giving the pattern ABBA ABBA ABBA. This simplified version of Thue-Morse is widely considered fairer than just taking turns. A similar ordering has been trialled by FIFA and UEFA for penalty shoot-outs in football, where the second shot of each pair is higher pressure for the shooter.

For our coffee pot, the solution is perfect: pouring half a cup of coffee into cup A, then two half-cups into B, then the final half-cup back into A, will give two cups of exactly equal strength. If you prefer, you can just use a spoon to stir the coffee. But won鈥檛 it taste more satisfying if you have used maths to solve the problem?

These articles are posted each week at

Katie Steckles is a mathematician, lecturer, YouTuber and author based in Manchester, UK. She is also adviser for New 杏吧原创鈥榮 puzzle column, BrainTwister. Follow her @stecks

Topics: Mathematics