Expected Flips Until Heads
Expected flips until heads explained for quant interviews, including fair coins, biased coins, recursion, geometric intuition, and variants.
Candidates learning recursive expectation from simple coin prompts.
Fair coin result
For a fair coin, the expected number of flips until the first heads is 2. The recursive setup is E = 1 + 0.5E: every flip costs one, and after a tail you restart.
Biased coin result
If heads has probability p, the expected flips until first heads is 1/p. Lower success probability means longer expected wait. Check the fair case p = 0.5 to get 2.
Why recursion works
After a tail, the process is back in the same state as the start. That self-similarity is what makes a one-line recurrence possible.
Concrete variant
If heads has probability 0.25, the expected flips until heads is 4. The result should feel larger than the fair-coin case because success is less likely on each flip.
When the formula fails
The 1/p formula applies to independent repeated trials until first success. If the coin changes, information is hidden, or the target is a pattern like HH, build states instead.
Common mistakes
Candidates often memorize 2 and apply it to biased coins or patterns. State the success probability and stopping condition before using the geometric shortcut.
Practice the pattern
Use the LeetQuidity curriculum and calibration to turn this topic into a focused practice plan.