Expected Number of Coin Flips to See Two Heads in a Row

The expected number of fair coin flips to see two heads in a row is six, derived by conditioning on the first flip and solving two linked equations.

The expected number of fair coin flips needed to see two heads in a row is 6. This is one of the most common warm-up questions in a quantitative trading interview because it looks like simple counting and is actually a lesson in conditioning on the first step of a process. Get the setup wrong and you will land on 4, which is the answer almost every candidate gives on a first attempt, and it is wrong by a factor of 1.5.

You flip a fair coin repeatedly and stop the moment you observe two heads in a row, for example heads-heads, or tails-heads-heads. The question asks for the expected number of flips before you stop. The coin is fair, so heads and tails each land with probability one half on every flip, and each flip is independent of the ones before it.

The trap is treating this like the simpler question of how many flips it takes to see one head, which has expected value 2 by direct application of the geometric distribution. Two heads in a row is not two independent draws of that same experiment stitched together, because a tails flip after one head destroys the progress you had made and forces you back to the start.

Define two quantities. Let E0 be the expected number of additional flips needed starting from a position where you have made no progress, meaning the last flip, if there was one, was a tails. Let E1 be the expected number of additional flips needed starting from a position where the immediately preceding flip was a head, so one more head in a row ends the process.

From state zero, you flip once. With probability one half you get a head, which moves you to state one, and with probability one half you get a tails, which leaves you in state zero. Either way you have used one flip. This gives the first equation: E0 equals 1 plus 0.5 times E1 plus 0.5 times E0.