Expected Value · Interview Question
Flipping a fair coin repeatedly, what is the expected number of flips to first see HH? And to first see HT? Why do they differ?
How to answer
E[HH] = 6, E[HT] = 4. Using first-step equations: for HT, let h = expected flips once you've seen an H; from H a T finishes (½) and an H stays in state H (½), so h = 1 + ½h ⇒ h = 2, and from scratch the answer is 4. For HH, a T after your H sends you all the way back to the start, so progress can fully reset; solving gives 6. HT is faster because once you have an H, a T always completes it and an H just 'holds' your progress — no full reset. HH resets to zero whenever a T follows your H.
Key idea: HH can reset to zero on a tail; HT never loses earned progress. Set up first-step expectation equations.
More: Quant interview prep · Quant salary