Penney's Game
Home · Interesting Math Problems · Problem 9 · Probability traps

1. The problem

A fair coin is tossed again and again. You choose a pattern of three tosses, say HHH. Then I choose a different pattern, say THH. Whoever's pattern turns up first in the run of tosses wins.

All eight patterns are equally likely in any three given tosses, so it should be a fair game. Is it?

2. The answer

Second player wins
Whatever you choose, there is a reply that beats it at least 2 times in 3, and against HHH or TTT, 7 times in 8.
No best pattern
THH beats HHT, HHT beats HTT, HTT beats TTH, TTH beats THH — a loop like rock–paper–scissors.

The winning reply: take the middle toss of your opponent's pattern, flip it, put it in front, and drop their last toss. Against HHT (middle H → T): play THH.

3. Why the patterns are not equal

Against HHH, THH wins unless the very first three tosses are HHH (chance 1/8). Any HHH that appears later must be preceded by a T — and that T-H-H already completed THH one toss earlier.

Patterns also differ in how long they take to appear on their own. A pattern that overlaps itself (HHH, HTH) wastes progress when it fails, so it takes longer:

PatternHHHHTHHHTHTT
Average tosses to appear141088

Conway's formula

For patterns A and B, write L(X, Y) = sum of 2k−1 over every k for which the last k tosses of X equal the first k tosses of Y. Then

Odds that B appears before A = [ L(A, A) − L(A, B) ] : [ L(B, B) − L(B, A) ]

and the average wait for A alone is 2 · L(A, A).

4. Play against the computer

Your pattern (H/T, length 2–8): · Opponent:
Your chance to win
–
Opponent's chance
–
Average tosses (alone)
–

All three-toss match-ups: chance that the column pattern beats the row pattern

5. Simulation

Games: 0 · you won: 0 · opponent won: 0 → opponent –

Press S to play one game.

6. Fine print

  • Walter Penney published the game in 1969; John Conway found the neat odds formula. Martin Gardner popularised both.
  • It is a good bar bet: always let the other person choose first.
  • Non-transitive relations appear in engineering too — in voting systems, tournament rankings and some dice (Efron's dice).