**From New Scientist #2663, 5th July 2008**

A men’s singles match at Wimbledon is won by the first player to win three sets. A set is won by the first player to win six games unless the score reaches 5-5; in that case, in the first four sets the set will be won 7-5 or 7-6 (but no set in our match was won 7-6), and in the fifth set play goes on until one player is two games ahead. The longest fifth set in Wimbledon history was won 28-26. Players serve in alternate games.

Our Wimbledon match went to five sets. The number of games in each set was different; the number of games won by the server in each set was different; the percentage of games won by the server in each set was different but was always an integer. Over the whole match exactly half of the games were won by the server.

What was the score in the final set, and how many games in that set were won by the server?

**Note:** In Wimbledon 2010 the Isner-Mahout match went to 70-68 in the final set (and broke the scoreboard).

[enigma1501]

### Like this:

Like Loading...

The following Python program runs in 127ms, and generates all 288 possible matches that satisfy the conditions of the problem. I found this quite a challenging program to get right and make sure it constructs exactly the right set of matches. (Although to get the solution to the problem it is not necessary to enumerate all possible matches, but I like to do constructive solutions where possible).

Solution:The score in the final set is 11-9. 13 games in the final set were won by the server.The prohibition of 7-6 sets is not needed to solve the puzzle. The code as presented does not consider winning sets with this score, but you can add a clause to the

`won()`

function to allow them, if you wish. (This assumes that serving rules are the same for tiebreak games as for other games, which I think may not be the case in real life, and so could explain why the setter chose to exclude them from the problem).