Expected Number of Tosses Until Two Heads in a Row

We want the expected number of tosses needed to get HH for two cases: a fair coin with P(H)=0.5 and a biased coin with P(H)=0.25.

Goal: first occurrence of two consecutive heads
Fair coin: P(H)=0.5
Biased coin: P(H)=0.25

1. State-based setup

Track only what matters:

State 0
No trailing H
Either no toss yet, or last toss was T
State 1
One trailing H
The last toss was H
Done
HH
Two heads in a row achieved
Let E₀ = expected number of additional tosses starting from State 0.
Let E₁ = expected number of additional tosses starting from State 1.
E₀ = 1 + pE₁ + (1 − p)E₀
E₁ = 1 + (1 − p)E₀

Explanation:

  • From State 0, one toss is used immediately.
  • With probability p, we get H and move to State 1.
  • With probability 1 − p, we get T and remain in State 0.
  • From State 1, another H finishes the process, while T sends us back to State 0.

2. Final formula

From E₀ = 1 + pE₁ + (1 − p)E₀, we get:
pE₀ = 1 + pE₁ ⟹ E₀ = 1/p + E₁
Substitute E₁ = 1 + (1 − p)E₀:
E₀ = 1/p + 1 + (1 − p)E₀
Rearranging gives:
pE₀ = 1/p + 1
E₀ = (1 + p) / p²
Expected tosses = E = (1 + p) / p²
For p = 0.50, E = 6.00

Current P(H): 0.50

3. Apply the formula to the two cases

Fair coin

P(H) = 0.5
E = (1 + 0.5) / (0.5)² = 1.5 / 0.25 = 6
6
expected tosses

Biased coin

P(H) = 0.25
E = (1 + 0.25) / (0.25)² = 1.25 / 0.0625 = 20
20
expected tosses
Fair coin
6
Biased coin
20

4. Intuition

It is not enough to get a single head. You need a second head immediately after it. If a tail appears after one head, the streak is broken and you are effectively reset.

That reset effect makes the waiting time much larger than many people first expect. For a fair coin, the answer is 6, not 4. For P(H)=0.25, it grows to 20.

5. Answer

Fair coin (P(H)=0.5): Expected tosses = 6
Biased coin (P(H)=0.25): Expected tosses = 20