Expected number of changes of serves in a game of raquetball Suppose a game of racquetball is being played, with players A and B. Assume further that A starts the play first, that the winner of a point serves the next point, and that the match lasts until the total number of points scored is 10,000. Moreover, A wins points that he serves with probability 0.8, and A wins points that he receives with probability 0.5. 
What is the approximate number of changes of serves over the 10,000 points that are contested?
My thoughts so far: one idea that occurred to me is interpret this problem in a string like format:
AAAABBBBABABABBBABAB
So we seem to have changed this into a 4-state Markov chain problem with states AA, AB, BA, BB, and transition probabilities as above, and the question is to count an approximate number of times the states AB and BA occur over a sequence of length 10,000. But I actually don't know how to set this up. 
Pointers or alternative approaches would be appreciated!
 A: I think you are on the right track. You set up a Markov Chain with the 4 states $1=AA$ $2=AB$ $3=BA$ and $4=BB$. You ignore the first serve because you are looking only only for an approximation.
then the transition matrix looks like 
$p_{11}= 0.8$ $p_{12} =0.2$ $p_{13}=0$ $p_{14}=0$
$p_{21}= 0$ $p_{22} =0$ $p_{23}=0.5$ $p_{24}=0.5$
$p_{31}= 0.8$ $p_{32} =0.2$ $p_{33}=0$ $p_{34}=0$
$p_{41}= 0$ $p_{42} =0$ $p_{43}=0.5$ $p_{44}=0.5$
The transition matrix is written
$\left( \begin{array}{cccc}
0.8 & 0.2 & 0 & 0 \\
0 & 0 & 0.5 &0.5 \\
0.8 & 0.2 & 0 & 0\\
0 & 0 &0.5 &0.5
 \end{array} \right)$
The reason is the following, to work out $p_{11}$, you need the probability that the 2nd and 3rd server is $A$ given that the 1st server and 2nd server are both $A$, this means whilst $A$ serves the second ball, A wins the point and so A gets to serve the 3rd ball.
To approximate the expected number of change of serves, you need to work out the stationary distribution of this Markov Chain and and look at the stationary distribution in state 2 and 3 (proportion of time spent in these two states)
i.e. you need to solve $\pi = \pi P$, where $P$ is a transition matrix, and $\pi$ is a vector. (i.e. you need to find the eigenvector of $P$ with eigenvalue 1 and the entries sum to 1)
Matlab tells me the stationary distribution is $(0.5715, 0.1428, 0.1428, 0.1428)$. This means it roughly spend 14.28% of all time in state $AB$ and $BA$.
This means that it is expected roughly the server changes 2850 times after 10000 points are played.
