# General solution to: Two players alternately flip a coin which may be biased: What is the probability of winning by getting a head?

Players A and B are playing a game where they take turns flipping a biased coin, with p probability of landing on heads (and winning). Player A starts the game, and then the players pass the coin back and forth until one person flips heads and wins. What is the probability that A wins?

My solution is to do the following:

• Treat the problem as an infinite sum
• We can get the odd numbers by doubling and adding one to any integer
• We can then reduce the problem to an infinite geometric series with $$a = 1$$ and $$r = (1-p)^2$$

$$\sum_{i \text { odd}} \Bigl(1-p\Bigr)^ip= p\sum_{i =0}^{\infty} \Bigl({1 - p}\Bigr)^{2i+1}= p(1-p)\sum_{i =0}^{\infty} \Bigl({1\over (1-p)^{2}}\Bigr)^{ i }={1\over 1 - (1-p)^{2}}\cdot{p(1-p)}.$$

Does this seem correct?

This is based on the work in this thread, which asks for a solution for the specific instance of an unbiased coin. However, I am trying to solve for the general solution when the coin may be biased.

• $\frac{1}{p}$ looks very odd here. You should never find yourself taking the reciprocal of a probability. Aug 30, 2021 at 14:20
• @TonyK yeah I got mixed up there. I will update the question a bit to be cleaner. Aug 30, 2021 at 14:50

Player A can win in his $$k^{th}$$ turn

$$\{1,2,3,4,\dots\}$$

with the following probabilities

$$\{p,(1-p)^2p,(1-p)^4p,(1-p)^6p,\dots\}$$

Thus the probability for A to win is

$$\sum_{k=0}^\infty p(1-p)^{2k}=p\sum_{k=0}^\infty[(1-p)^2]^k=\frac{p}{1-(1-p)^2}=\frac{1}{2-p}$$

• Does anyone know how we get from $p\Sigma[(1-p)^2]^k$ to $\frac{p}{1-(1-p)^2}$ to $\frac{1}{2-p}$? I don't understand how we mathematically rearrange this into its end product. Apr 16 at 1:20

Let $$q$$ be the probability that $$A$$ wins.

With probability $$p$$, $$A$$ wins on the first turn.

And with probability $$1-p$$, the turn passes to $$B$$, who now has the same chance $$q$$ of winning. So we get

$$q=p + (1-p)(1-q)$$

Solving for $$q$$ gives $$q=\frac{1}{2-p}$$

• The way you've done this is so clean. Is there a book or area I can study to improve my skills to arrive at solutions like this? I find myself loving these kinds of problems but not sure where to find more. Aug 30, 2021 at 14:51
• @Learningstatsbyexample: this question just came up. You should try to solve it before you look at the solution (in one of the comments). Sep 1, 2021 at 8:56
• OK. This is my morning treat :) ty Sep 1, 2021 at 12:46

Lets condition on the first toss and define $$A$$ as the event that player $$A$$ wins. Then: $$P(A) = P(A | H) P(H) + P(A | T) P(T) = p + (1-p) (1-P(A)) = 1 - (1-p)P(A)\\ \implies P(A) = \frac{1}{2-p}.$$

Since you mentioned that you mixed up probability and odds,
let me solve it using odds

Odds in favor of $$A = p:(1-p)p$$

Converting to probability, P(A wins) = $$\dfrac{p}{p+(1-p)p} = \dfrac {1}{2-p}$$

As the game stops only when one of them wins, before every flip that $$A$$ makes the game is back to where it was before $$A$$ made the first flip. In other words, probability of $$A$$ eventually winning is same, just before any flip by $$A$$. So if the probability of $$A$$ winning is $$x$$ then,

$$x = p + (1-p)^2 x \implies x = \frac{1}{2-p}$$