Let T be the number of coin flips required until the pattern HH (two consecutive heads) appears for the first time. Assume independent flips.
(a) For a fair coin, derive E[T] using a state-based recursion (or an equivalent Markov-chain argument) and give the exact numeric value.
(b) Generalize E[T] for a biased coin where P(H) = p with 0 < p < 1.
(c) For the fair coin, derive Var(T). Show your recurrence setup and solution steps clearly.
Login required