The following is an exercise from Pinsky and Karlin's An Introduction to Stochastic Modeling (4th edition):
I'm trying to do (b) by analyzing the possible sequence of playing. Given that $A$ wins, denote $N$ as the number of plays. Denote $A0$ as $A$ losses and $A1$ as $A$ wins. When $N$ is odd, the possible situations are $$ A1;\\ A0B0A1;\\ A0B0A0B0A1;\\ \cdots $$ and when $N$ is even, $$ B0A1;\\ B0A0B0A1;\\ B0A0B0A0B0A1;\\ \cdots $$
I think that the distribution of $N$ is given by $$ P(N=2k+1)=x^kp,\quad P(N=2k)=(1-q)x^{k-1}p $$ where $x=(1-p)(1-q)$.
However, when I add these number up, I don't get the desired number $1$ unless $p=q=1/2$: $$ \sum_{k=0}^\infty x^kp+\sum_{k=1}^\infty(1-q)x^{k-1}p\neq 1. $$
Here are my questions:
- What is wrong with the reasoning? How would you write down the correct one?
- For the event in (a) be $(N\textrm{ is odd})$?

Your inaccuracy is $P(N=2k-1)=x^{k-1}p$ and $P(N=2k)=x^{k-1}(1-p)q$
So in order for $B$ to win in the $2k$th play, nobody should win in the first $2k-2$ plays, then $A$ should lose and $B$ should win.
Now it sums to $1$:
$$\sum_{k=1}^\infty x^{k-1}p+\sum_{k=1}^\infty x^{k-1}(1-p)q=\frac{p}{1-x}+\frac{(1-p)q}{1-x}=\frac{1-x}{1-x}=1$$
Your last sentence is correct:
$$P(A\text{ wins})=P(N\text{ odd})=\sum_{k=1}^\infty x^{k-1}p=\frac{p}{1-x}$$
Finally for part b):
$$E[N|A\text{ wins}]=\sum_{k=1}^\infty(2k-1)P(A\text{ wins in }2k-1\text{ plays}|A\text{ wins})\\ =\frac{1}{P(A\text{ wins})}\sum_{k=1}^\infty(2k-1)P(A\text{ wins in }2k-1\text{ plays})\\ =\frac{1-x}{p}p\sum_{k=1}^\infty(2k-1)x^{k-1}=(1-x)\frac{1+x}{(1-x)^2}=\frac{1+x}{1-x}$$