Expected number of sets in tennis game This question has a few posts on other forum sites and is an example interview question. I don't think it is answered correctly anywhere so I thought I'd present it here fully.
For a 3 sets tennis game, would you bet on it finishing in 2 sets or 3 sets? Assume that the probability of each player winning a set is constant through the game.
 A: In fact it’s even clearer if you simplify that expected value:
$$\begin{align*}
2(p^2+q^2)+3(2qp^2+2pq^2)&=2(p^2+q^2)+3(p+q)(2pq)\\
&=2(p^2+q^2)+3(2pq)\\
&=2(p+q)^2+2pq\\
&=2+2pq\\
&\le 2+2\left(\frac12\right)^2\\
&=2.5\,,
\end{align*}$$
so one should bet on a $2$-set match.
A: We can calculate the probabilities of each outcome by considering the possible sequences of match outcomes.
Denote the first player winning by Q, and their probability of winning q. Similarly label the probability of the other player winning p, and their win by P.
We have the following possible sequences:
$$QQ, PP, QPQ, QPP, PQP, PQQ$$
$QQ$ means player $q$ won both sets, and this outcome thus has probability $q^{2}$. Similarly, the outcome $PQQ$ has $p$ winning the first set followed by $p$ winning the next two sets, so this sequence has probability $pq^{2}$, and so on.
The expected number of sets is thus:
$$ E(sets) = 2 * (p^{2} + q^{2}) + 3 * (2qp^{2} + 2pq^{2}) $$
If we set p = q then this gives a value of $2.5$ for the expected number of sets - i.e. 2 or 3 sets is equally likely. As we assign player q and p increasingly skewed probability values, the expected number of sets converges to $2$.
Lots of answers to this question seem to have copied and pasted the logic that:
'$p^2 + q^2$ is always $>= 2*p*q$'
I don't see how this has any relevance to the question. The required constrain is that $p + q = 1$, which means that $ p^{2} + q^{2} = 1 - 2*p*q$, but perhaps I have missed something on this.
A: If the winning probabilities of the two players are $p$ and $q$ (with $p+q=1$), then the probability of the game ending in two sets is $p^2+q^2$, and the probability of it lasting three sets is $2pq$.  Since
$$(p^2+q^2)-2pq=p^2-2pq+q^2=(p-q)^2\ge0$$
you can't go wrong by betting it'll be over after two sets.  Since the inequality is strict if $p\not=q$ (i.e., if one player is stronger than the other), you should bet it'll be over after two sets, on the off chance that the players are of unequal strength.
Note, though, that this analysis depends crucially on a tacit assumption of independence, namely that the outcome of one game has no effect on the outcome of any other game. It might be fun to look at a database of three-set tennis games to see how many are decided by a third set.
