The Ballot Problem's Cousin: Runs of Heads
You flip a fair coin times. A run of heads is a maximal consecutive sequence of heads. For example, in the sequence HHTHHH, there are two runs of heads (of lengths 2 and 3).
Question: What is the expected number of runs of heads in fair coin flips?
(Give a clean closed-form answer and explain the key idea.)
Answer: Expected Runs of Heads
Key Idea / Intuition
Rather than trying to count runs directly — which requires tracking complex consecutive structure — we use indicator random variables. A run of heads starts at position if and only if position is heads AND either or position is tails. This decouples the problem beautifully: we just count the expected number of "run starts."
Formal Proof / Solution
Setup: Let be i.i.d. fair coin flips ( or , each with probability ).
Define indicator variables: Let be the indicator that a run of heads begins at position . Then:
When does a run of heads begin at position ?
-
Case : A run starts at position 1 iff . So:
-
Case : A run starts at position iff and (tails followed by heads, meaning a new run begins). Since flips are independent:
Expected number of runs of heads:
Sanity check: For : the formula gives , which is correct (one run of heads with probability ). For : formula gives . Direct check: sequences have runs of heads respectively, giving expected value . ✓
Why this is beautiful: The linearity of expectation transforms a problem about complex consecutive structure into a simple sum over independent pairs of coin flips. No need to track run lengths or use generating functions — just ask "where does a new run begin?"
Note: By symmetry, the expected number of runs of tails is also , and the expected total number of runs (heads or tails) is , a clean result.
Source: Mathematical folklore / Mosteller-style probability puzzle