# Markov tennis game mean duration

Consider a tennis game in which the server wins each point with probability $p$, independent of the score.

Now I need to find the expected duration of the game. I know i have to condition on the #points but I'm not sure exactly how. To find the expected duration, given the game never goes to deuce i found:

En = E(#points|Game never goes to deuce)

= P(lose game)*E(#points|Game never goes to deuce,lose game) + P(win game)*E(#points|Game never goes to deuce,win game)

But to find the expected number of points all together is giving me some trouble.I started the conditioning like this:

En = E(#points)

=E(#points | Server wins the game)*P(server wins the game) + E(#points | server loses the game)*P(server loses the game) (1)

But now I'm not sure how to continue. I think the answer is going to be some binomial that goes to infinity since technically the server can win or lose after infinitely many points.

Am I on the right track with equation (1)?

The usual and simplest approach is to compute simultaneously the mean remaining duration of the game starting at every partial score of the server and the receiver. That is, encoding $(0,15,30,40)$ as $(0,1,2,3)$, one considers $t_{ij}$ the mean duration of the game starting at score $i$ for the server and $j$ for the receiver, for every $i$ and $j$ in $\{0,1,2,3\}$, and one computes $t_{00}$ as an entry of the vector $(t_{ij})$ which solves a linear system deduced from the structure of the underlying Markov chain.
In the present case, one can use this method and reduce somewhat the number of unknowns, considering the score after the first four points played. Denoting $q=1-p$, the Markov property then yields $$t_{00}=4+4p^3qt_{31}+6p^2q^2t_{22}+4pq^3t_{13}$$ Now, using again the Markov property, one-step and two-steps recursions yield $$t_{31}=1+qt_{22}\qquad t_{22}=2+2pqt_{33}\qquad t_{13}=1+pt_{22}$$ Common sense (or a direct computation) then indicates that $t_{22}=t_{33}$ hence the last system above yields $t_{33}=t_{22}=r$ with $$r=\frac2{1-2pq}$$ Plugging these into the RHS of our identity involving $t_{00}$, one gets $$t_{00}=4+4p^3q(1+qr)+6p^2q^2r+4pq^3(1+pr)$$ that is, after some algebraic simplifications (and unless I made a mistake while computing this),
$$t_{00}=4+\frac{4pq}{1-2pq}(1+pq+4p^2q^2)$$
The fact that $t_{00}=4$ when $p=0$ and when $p=1$ is reassuring, likewise the fact that $t_{00}$ depends only on $pq$, but you should nevertheless check the result...