Learn / Library / Probability
Race of coin patterns
A fair coin is tossed repeatedly and independently. Pattern and pattern are both watched in the sequence of results ( is heads, is tails), and overlaps with earlier tosses count. What is the probability that appears before ? Give a fraction in lowest terms.
Checking an answer needs JavaScript. The hint and the solution open without it.
Hint
Use states describing the useful suffix of the sequence so far: nothing, , . Note that after the pattern is certain to come first.
Solution
- Let be the probability that comes first from the start state, from state , and from state .
- From the pattern must win, because more heads keep us in until a tails arrives; so from , a heads gives and a tails leads to : .
- From , a heads completes and a tails returns to the start: .
- From the start, a tails keeps us at the start and a heads leads to : .
- Substituting, , so , which gives .
- Therefore the probability is .
Answer: