One window is not a waiting time
Heads (H) · Tails (T)
Assume independent tosses of a fair coin. HH and HT each have probability 1/4 in two tosses. But a search keeps going until a pattern first appears. Its windows overlap, so counting them as independent opportunities gives the wrong answer.
Keep useful partial progress
While waiting for HT, another H after H keeps you ready for the next T. While waiting for HH, a T after H erases that progress. Tracking these states gives mean waits of 4 tosses for HT and 6 for HH.
Compare the overlaps
For a fair coin, each beginning that is also an ending contributes 2 raised to its length to the mean wait. HHH overlaps at lengths 1, 2 and 3: 2 + 4 + 8 = 14. HHT overlaps only at its full length: 8.
Try it
Which fair-coin pattern has the shorter mean waiting time?
- HHH
- HHT
Show the answer
HHT
Correct. HHT needs 8 tosses on average, compared with 14 for HHH.
Enable JavaScript to answer interactively and save your place.
Practice Pattern races