I stared at this for a second because it looks like a simple probability problem but it really isn't.
Model the process as a Markov chain with states representing the progress toward the pattern (no progress, just saw H). Set up equations for the expected number of flips from each state and solve them. Alternatively, use the general formula for expected waiting time for a pattern in i.i.d. sequences.
Pro tip: Mention that the expected waiting time for HT is 4 flips, while for HH it is 6 flips, to show you understand that overlapping patterns have longer waiting times. This demonstrates deeper insight into pattern matching in random sequences.
Identify the relevant states based on the last flip(s): state 0 = no progress (last flip was T or start), state 1 = last flip was H (so we are one T away from completing HT).
Let E0 be the expected additional flips from state 0, and E1 from state 1. Write equations: E0 = 1 + 0.5 E0 + 0.5 E1, and E1 = 1 + 0.5 E1 + 0.5 * 0 (since T completes the pattern).
From E1 = 1 + 0.5 E1, we get E1 = 2. Substitute into E0: E0 = 1 + 0.5 E0 + 1, so 0.5 E0 = 2, giving E0 = 4.
The expected number of flips starting from scratch (state 0) is 4. This is the answer.
Use the formula for expected waiting time for a pattern: for HT, it's 1/(0.5*0.5) = 4, since there is no overlap. This confirms the result.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.