Find the probability that in the process of repeatedly flipping an unbiased coin, one will encounter a run of 5 heads before one encounters a run of 2 tails.
We call a successful string a sequence of $H$ 's and $T$ 's in which $H H H H H$ appears before $T T$ does. Each successful string must belong to one of the following three types:(i) those that begin with $T$, followed by a successful string that begins with $H$;(ii) those that begin with $H, H H, H H H$, or $H H H H$, followed by a successful string that begins with $T$;(iii) the string $H H H H H$.Let $P_{H}$ denote the probability of obtaining a successful string that begins with $H$, and let $P_{T}$ denote the probability of obtaining a successful string that begins with $T$. Then$$ \begin{aligned} P_{T} &=\frac{1}{2} P_{H}, \\ P_{H} &=\left(\frac{1}{2}+\frac{1}{4}+\frac{1}{8}+\frac{1}{16}\right) P_{T}+\frac{1}{32} . \end{aligned} $$Solving these equations simultaneously, we find that$$ P_{H}=\frac{1}{17} \quad \text { and } \quad P_{T}=\frac{1}{34} . $$Hence the probability of obtaining five heads before obtaining two tails is $\frac{3}{34}$.