Two Heads in a Row

  • Hard
  • Probability puzzles
  • Tests: Tracking what a partial success is worth

The puzzle

You flip a fair coin repeatedly until two heads appear one after the other, then stop.

On average, how many flips does that take?

Stuck?

One at a time, smallest first. Open only as many as you need — the whole point of the puzzle is the part you work out yourself.

Hint 1

There are two states worth naming: no progress, and one head already showing.

Hint 2

From "one head showing", a tail does not just waste a flip - it sends you all the way back.

Show the answer Hide the answer

Six flips on average.

How to get there

Let A be the expected number of further flips from a standing start, and B the expected number when the last flip was a head.

From the start: A = 1 + (1/2)B + (1/2)A, because a head moves you to B and a tail leaves you where you were.

From one head: B = 1 + (1/2)(0) + (1/2)A, because a head finishes and a tail restarts. Substituting gives A = 6 and B = 4.

The technique worth keeping

Name one unknown per state, not per outcome. The reason HH takes six flips while HT takes four is that a failed HH destroys the progress you had, and only a state-by-state equation makes that visible.