Expected Flips Until First Head

Explore both versions: a fair coin and a biased coin with probability p of heads. The waiting time follows a geometric distribution.

Choose the coin
Fair coin: p = 0.50
Expected flips
2.00
E[N] = 1 / p
Chance first flip is H
50%
Exactly p
Where can the first head occur?
Bar height = P(N = k)
Build the expectation one path at a time
To finish on flip k, we need k−1 tails followed by one head.
Method 1 · Geometric distribution
P(N = k) = (1 − p)k−1p
E[N] = Σ k(1 − p)k−1p
E[N] = 1 / p

For p = 0.50: E[N] = 1 / 0.50 = 2.

Method 2 · Interview recurrence
E = 1 + (1 − p)E
pE = 1
E = 1 / p

You always spend one flip. If that flip is a tail, which happens with probability 1 − p, you are back in exactly the same situation.

Try one random run
Generate flips until the first head.
Press “Flip until H” to see one sample path.