Solution
Three Alike
Show the problem again
A fair coin is flipped repeatedly until three consecutive flips are identical (either three heads in a row or three tails in a row). What is the expected number of flips, counting the final one? Give an exact number.
Worked solution
The answer is 7. Because both patterns are allowed, only the length of the current run of identical flips matters, not its face. After the first flip the run has length 1. Let E1 and E2 be the expected remaining flips when the current run has length 1 or 2. Each new flip extends the run with probability 1/2 and otherwise resets it to length 1: E1 = 1 + (1/2)E2 + (1/2)E1, E2 = 1 + (1/2)·0 + (1/2)E1. These give E1 = 6 and E2 = 4, so the total is 1 + E1 = 7. Compare this with waiting for HHH alone, which takes 14 flips: allowing either face exactly halves the expected wait, because the first flip chooses for free which run you are building, and every later flip extends that run with the same probability 1/2 as before.
Source: Standard run-waiting-time exercise in wide circulation; no traceable original source. Statement written for AxiomIQ.