# waiting for patterns?

A fair coin is tossed until one of the patterns show up: TTH or THT. Let A be the event that TTH shows up before THT.

What is P(A)?

Here is my solution but I am not sure if it is correct or there is a better solution.

Let $$p=P(A)$$. Define

$$A_1=$$ the event that the first toss is H

$$A_2=$$ the event that the first two tosses are TT

$$A_3=$$ the event that the first three tosses are THT

$$A_4=$$ the event that the first three tosses are THH

Then this is a partition for the sample space.

$$p=P(A|A_1)P(A_1)+P(A|A_2)P(A_2)+P(A|A_3)P(A_3)+P(A|A_4)P(A_4)$$.

Then

$$p=p\frac{1}{2}+1\frac{1}{4}+0\frac{1}{8}+p\frac{1}{8}$$ which implies that $$p=\frac{2}{3}.$$

• Can anyone give a reference to a math paper which deals with more probability calculations related to patterns such as this example? Thanks. – Probability student Feb 6 at 19:12

We can start at the point when the first $$T$$ appears

The probability that $$T$$ occurs again is $$\frac{1}{2}$$ , and then $$TTH$$ comes first surely.

The probability that $$HT$$ comes next is $$\frac{1}{4}$$ , then the game is finished as well.

If $$HH$$ appears, we have to wait for the next $$T$$ and are again at the starting position.

The occurence of $$T$$ has a probability twice the probability of the occurence of $$HT$$ , hence the chance that $$TTH$$ wins must be twice the chance that $$THT$$ wins, giving the result $$p=\frac{2}{3}$$.

I think you've got the right idea, but I don't think all your numerical assignments are correct. You appear to have taken $$\ P\left(\,A\,\vert\, A_2\,\right)\$$ and $$\ P\left(\,A\,\vert\, A_3\,\right)\$$ to be $$\ \frac{1}{2}\$$ and $$\ 1\$$, respectively. I believe they should be $$\ 1\$$ and $$\ 0\$$, respectively.

Take $$\ P\left(\,A\,\vert\, A_2\,\right)\$$, which is the probability that the tosses terminate with TTH, given that the first two tosses are TT. If the first two tosses are TT, then it's impossible for the tosses to terminate in the sequence THT, because the very first subsequent head to appear after the initial TT must be preceded by two successive tails.

Likewise, if the first three tosses are THT (i.e. the event $$\ A_3\$$ occurs), then the tosses cease with $$\ A\$$ not having occured. Thus, I believe your equation for $$\ p\$$ should be $$p=p\frac{1}{2}+1\cdot\frac{1}{4}+0\cdot\frac{1}{8}+p\frac{1}{8}\ ,$$ which nevertheless still gives you $$\ p = \frac{2}{3}\$$.

• Thank you, you are right! I made a mistake, I will correct it. – Probability student Feb 5 at 10:45