Skip to content
All apps

Penney’s game

About this app

Coin sequences are non-transitive: for every three-flip sequence there is one that beats it on average. Pick sequences, watch the coin stream live, simulate 1000 games — win rates and mean waiting times (8 vs. 10 flips).

A non-transitive coin game

In Penney’s Game each player picks a sequence of three coin flips, such as H-T-T or H-T-H. A fair coin is tossed until one of the two sequences appears as a consecutive block; that sequence wins. Although every three-flip sequence is equally likely at any position (1/8), the odds in a head-to-head game are often unequal. The game is non-transitive: for every sequence there is another that beats it on average, much like rock-paper-scissors. Whoever chooses second therefore has the advantage.

What you see

You set the sequences for player A and player B. “Flip 1 game” tosses the coin one flip at a time until a sequence appears. “Simulate 1000 games” gives both players’ win rates and the average waiting time in flips. An overview shows how often each of the eight possible sequences beats B’s choice. The “Beat-the-Opponent” box names the best reply to B and can apply it to player A.

Things to try

Give B a sequence that feels strong, for example H-H-H, and look up the best reply. Then simulate 1,000 games and compare the win rate with the overview. Next, compare H-T-T with H-T-H: on its own, H-T-T takes 8 flips on average to appear, H-T-H takes 10. Watch how the wins split when the two meet head to head.

Frequently asked questions

What is Penney’s Game?
Penney’s Game is a two-player coin game named after Walter Penney. Each player picks a sequence of heads and tails, and the coin is tossed until one of them appears. With three-flip sequences, the second player can always find a sequence that wins with probability at least 2/3.
What does non-transitive mean?
A relation is non-transitive when “A beats B” and “B beats C” do not imply that A beats C. In Penney’s Game some sequences beat each other in a cycle. So there is no single best sequence that wins against all others.
How do you find the best reply in Penney’s Game?
For three-flip sequences there is a simple rule: take the opposite of the opponent’s second flip and append the opponent’s first two flips. Against H-H-H the reply is therefore T-H-H. It wins that matchup with probability 7/8.
What can I do in this app?
You choose two three-flip sequences, flip single games or simulate 1,000 games with win rates and average waiting times. An overview of all eight sequences against B shows which reply works best.

Subject: Data & decisions

More from Data & decisions

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps