I want to revisit a probability puzzle from a previous post: see Alternating coin toss game.
You play a game where you alternate tossing a coin with a friend, and the first person to toss heads wins. But let’s make it a little more interesting by making the coin weighted, or biased, so that it lands heads only 25% of the time. If you were to start, what would be your chances of winning?
Let’s call the probability of tossing heads p and the probability of tossing tails q.
On the starter’s first toss, his chances of tossing heads are p. The chances he’ll toss heads on his second toss are q^2\times p. On his 4th toss it’s q^4\times p and so on.
So his chances of winning the game is the sum s of the geometric progression p\times q^0\;+\;p\times q^2\;+\;p\times q^4\;+…
Let’s use the shifting approach to solve this. The idea is to subtract out the first element, and then shift the rest of the elements to the left. So first subtract:
s-p\times q^0=p\times q^2\;+\;p\times q^4\;+…
Now to shift the terms to the left, we need to divide by q^2
\frac{s-p\times q^0}{q^2}=p\times q^0\;+\;p\times q^2\;+…
So…
\frac{s-p\times q^0}{q^2}=s
s=\frac{p}{1-q^2}
This gives us a general solution to the alternating coin toss problem. If we plug in the unweighted coin probabilities, we get s=\frac{2}{3} which is what we’d worked out before. For the case where the probability of tossing a head is 1/4, then we get s=\frac{4}{7}, which is the probability of winning for the starter.