4

I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.

A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?

Solution.

$\begin{aligned} P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+\ldots \\ &=\frac{1}{2^3}+\frac{1}{2^4} + \frac{1}{2^5} + \ldots \\ &=\frac{1/8}{1-1/2}\\ &=\frac{1}{4} \end{aligned}$

For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!

Quasar
  • 5,410

2 Answers2

6

Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.

Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.

Conversely, if the first two tosses are $HH$ then $THH$ can not come first.

Thus the answer is clearly $\frac 14$.

lulu
  • 70,402
1

A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?

Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.

orlp
  • 10,508