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?

 A: I think conditioning is a reasonable approach. The working becomes tedious but I don't know of an easier solution method. I'll answer the first question - the second can be done similarly.
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}
