Penney’s game: the coin bet you can always win
Each of you picks three coin flips in a row — say heads-heads-tails. You flip a coin until one of the two patterns turns up, and whoever’s appears first wins. It sounds like a fair bet, because every pattern of three is equally likely. It isn’t. Let the other person choose first, and you can always pick a pattern that beats theirs, at odds of at least 2 to 1 and as good as 7 to 1.
Against HHH, pick
THH
It turns up before HHH 87.5% of the time — odds of 7 to 1 in your favour.
The trick, in one line
Take the middle flip of their pattern, turn it over, and put it in front of their first two. Against HHH: the middle flip is heads, turned over it is tails, and in front of HH that gives THH. The rule finds the best reply to every one of the eight patterns.
Play it
They chose HHH, so you take the reply, THH. Flip until one of them turns up.
—
You have the edge, but only on average: you win seven in eight races in the long run, and will still lose some along the way.
Why it works
The cleanest case is the one on screen. THH loses only if the very first three flips are HHH, which happens 1 time in 8. Any other way HHH could appear, it has to come straight after a tail — and that tail plus the first two flips of HHH is THH, which has already won. So THH wins the other 7 times in 8.
Every pattern also takes a different length of time to turn up on its own, but that is not what decides the race. THH and HHT both take 8 flips on average to appear, yet THH beats HHT 75% of the time. What decides it is how the two patterns overlap.
The exact working: your THH against their HHH
The mathematician John Conway found a way to get the odds from overlaps alone. For two patterns X and Y, check whether the last one, two or three flips of X match the first one, two or three of Y, and score 1, 2 or 4 for each that does. Call the total X·Y.
- HHH·HHH = 7
- HHH·THH = 0
- THH·THH = 4
- THH·HHH = 3
The odds that THH comes first are (HHH·HHH − HHH·THH) to (THH·THH − THH·HHH): 7 to 1.
Every reply to HHH
| If you pick | It comes first |
|---|---|
| THH | 87.5% |
| TTH | 70.0% |
| HTH | 60.0% |
| HTT | 60.0% |
| THT | 58.3% |
| HHT | 50.0% |
| TTT | 50.0% |
There is no best pattern
Like rock-paper-scissors, the patterns beat each other in a circle: THH beats HHT, which beats HTT, which beats TTH, which beats THH — back where it started. Whatever is chosen first can be beaten, which is the whole reason to go second.
Questions people ask
- What is Penney’s game?
- Two players each pick a pattern of three coin flips, such as heads-heads-tails. A coin is flipped until one of the two patterns appears, and that player wins. Whoever picks second can always choose a pattern that is more likely to win.
- How do you always win Penney’s game?
- Let the other player choose first. Take the middle flip of their pattern, switch it to the opposite face, and put it in front of their first two flips. Against heads-heads-heads that gives tails-heads-heads, which wins 7 times in 8. Whatever they pick, the reply gets odds of at least 2 to 1.
Check it yourself
Every probability on this page is computed exactly two separate ways — Conway’s overlaps and a direct step-by-step solve — and the two must agree before it ships.
Penney’s game — Wikipedia — the readable one
The same table of best replies and odds as below, row for row, and the same rule for finding the reply. It traces the game to Walter Penney’s 1969 problem.
Making the Unfair Fair — Robert W. Vallin, Recreational Mathematics Magazine, 2020 — the maths (a free journal paper)
The best reply to each of the eight patterns with its odds (7 to 1, 3 to 1, 2 to 1), and the one-line rule for finding it. Every row is reproduced here. Vallin dates the game to Walter Penney’s 1969 problem in the Journal of Recreational Mathematics.
This page’s dataset — Odds The Law
Every pairing of the eight patterns, with its exact odds and each pattern’s average wait.
Try next
How the site works out its numbers is on the methodology page.