# Probability of winning a game between players A and B?

The following problem is from A First Course in Probability by Sheldon Ross, and it was assigned as homework by my professor. I was wondering if you guys could help me find a answer to the problem.

$A$ and $B$ flip coins. $A$ starts and continues flipping until a tails occurs, at which point $B$ starts flipping and continues until there is a tail. Then $A$ takes over, and so on. Let $P_1$ be the probability of the coin's landing on heads when $A$ flips and $P_2$ when $B$ flips. The winner of the game is the first one to get a total of two heads. What is the probability that $A$ wins? What is the probability that $A$ wins if the winner of the game is the first one to get a total of three heads?

• What work have you done so far on this? What issues are you running into? – DylanSp Feb 8 '16 at 17:55
• I tried using what Ross calls "conditioning" to solve it. Pretty much what you do is you use the identity $P(E) = P(E|F)P(F) + P(E|G)P(G) + \ldots + P(E|H)P(H)$ where $S = F \cup G \cup \ldots \cup H$. I used this identity with $F$ being on round 1, $G$ being on round 2, etc and $E$ being winning. It's just that I realized there is probably a much easier solution to the problem. – Birdman2246 Feb 8 '16 at 18:02

For $i,j=0,1,\;$ define:
$$a_{ij} = P(\text{A wins where A starts with i heads and B starts with j heads}).$$
So we seek $a_{00}$ and by conditioning we have the following relations:
\begin{align} a_{11} &= P_1 + (1-P_1)(1-P_2)a_{11} \\ & \qquad\text{since if $A$ gets $H$ he wins and if he gets $T$ and then so does $B$} \\ & \qquad\text{we are back where we started} \\ & \\ \therefore\quad a_{11} &= \dfrac{P_1}{P_1+P_2-P_1P_2}. \\ & \\ a_{10} &= P_1 + (1-P_1)\left[P_2(1-P_2)a_{11} + (1-P_2)a_{10}\right] \\ & \qquad\text{since if $A$ gets $H$ he wins and if he gets $T$ and then so does $B$} \\ & \qquad\text{we are back where we started and if he gets T and $B$ gets $TH$ then we have $a_{11}$} \\ & \\ & \text{Substituting for $a_{11}$ and re-arranging, we get:} \\ a_{10} &= \dfrac{P_1^2P_2^2-2P1^2P_2+P_1^2-P_1P_2^2+2P_1P_2}{(P_1+P_2-P_1P_2)^2}. \\ & \\ a_{01} &= P_1 a_{11} + (1-P_1)(1-P_2)a_{01} \\ & \\ \therefore\quad a_{01} &= \dfrac{P_1^2}{(P_1+P_2-P_1P_2)^2}. \\ & \\ a_{00} &= P_1 a_{10} + (1-P_1)\left[P_2(1-P_2)a_{01} + (1-P_2)a_{00}\right] \\ & \\ & \text{Substituting for $a_{10}$ and $a_{01}$ and re-arranging, we get:} \\ a_{00} &= \dfrac{P_1^2(2P_1P_2^2-3P_1P_2+P_1-2P_2^2+3P_2)}{(P_1+P_2-P_1P_2)^3}. \\ \end{align}