New Scientist Enigma 886 – Set Square
by Susan Denham
From Issue #2041, 3rd August 1996 (link)
Last week I watched a thrilling five-set tennis match between the two top players, Pampas and Grassy. Pampas won the first set easily and the second in a tie-break. He then lost the next two sets and towards the end of the final set the scoreboard showing the games won looked like this:
\[\begin{array}{|l|c|c|c|c|c|}\hline \mathbf{Pampas} & \mathbf{6} & \mathbf{7} & \mathbf{5} & \mathbf{0}& \mathbf{7} \\
\hline \mathbf{Grassy} & \mathbf{7} & \mathbf{2} & \mathbf{3} & \mathbf{6}& \mathbf{1} \\
\hline \end{array}\]
Pampas then went on to win the next two games (and hence the match).
I remember on a previous occasion when they met the match also went to five sets. Towards the end of the match I looked at the scoreboard and each of the two rows of games won formed a five-figure perfect square. On that occasion Grassy then went on to win in two more games.
What did the score-board look like at the very end of that match?
@Brian, Could you explain the value 315?
I see you have gone for a general solution (without combining requirements to reduce some possibilities like fifth set scores (7,9) and (8, 10)).
Hi Frits,
It was meant to be 317 but it is still way higher than it needs to be 🙂 I
will update it to put a better limit in (279).
Yes, I don’t do much, if any, analysis at a detailed level unless this is
necessary to achieve a reasonable speed. I prefer simplicity over the
extra coding (or explanation) involved in adding such constraints.
I don’t think 7-6 is a valid winning score in the final set, so it shouldn’t be in pss5.
@Jim, Thanks, corrected now.