We want the expected number of tosses needed to get HH for two cases: a fair coin with P(H)=0.5 and a biased coin with P(H)=0.25.
Track only what matters:
Explanation:
Current P(H): 0.50
It is not enough to get a single head. You need a second head immediately after it. If a tail appears after one head, the streak is broken and you are effectively reset.
That reset effect makes the waiting time much larger than many people first expect. For a fair coin, the answer is 6, not 4. For P(H)=0.25, it grows to 20.