Probability of encountering 5 heads

probability

find probability that during a process of tossing coins repeatedly one will encounter a run of $5$ consecutive heads before encountering $2$ tails.

I started by assuming,

$H$= probability that this event occurs when first toss was Heads

$T$= probability that this event occurs when first toss was Tails

What to do next?

Best Answer

At any point in time as you keep tossing the coin, you can be in 5 different states. Either your last throw was a T, or your last throws were a streak of 1, 2, 3 or 4 H. (You're in a sixth state just as you start the game, but we'll skip that one for now.)

In each state, you have some probability of winning, losing, or transitioning into one of the other 4 states. For each state, there is also a probability of eventually winning from that point on. I'll call those evental winning probabilities $P(T)$ and $P(1H), P(2H), P(3H), P(4H)$.

From here we can set up equations (using the law of total probability). For instance, if you're in the 4H state, then there is a 50% chance you'll win on the next throw, and a 50% chance you'll enter state T. Thus $$ P(4H) = \frac12 + \frac12P(T) $$ Similarily, if you're in state T, you have a 50% chance of losing, and a 50% chance of entering state 1H. Thus $$ P(T) = \frac12P(1H) $$ You can similarily set up equations for $P(1H), P(2H)$ and $P(3H)$. You now have five equations and five unknowns, so this may be solved.

Once you've done that, you can look at the state you're in as you start the game, and see that the probability of winning from there is $$ \frac12P(T) + \frac12P(1H) $$