Teaser 3139: Checkmate
From The Sunday Times, 20th November 2022 [link] [link]
Our chess club is divided into sections, with each section having the same number of players. The two oldest members will soon be retiring from playing and we will change the number of sections. The number of sections will change by one and so will the number of players in each section, but all the sections will still have the same number of players. This will result in there being a grand total of 63 fewer matches per year if each member plays all the other members of their section once per year.
How many players are in each section at the moment?
[teaser3139]












Jim Randell 4:56 pm on 18 November 2022 Permalink |
If the players are split into k sections, each consisting of n players, then the number of matches in each section is C(n, 2), and the total number of matches is m = k.C(n, 2).
We can use some analysis to simplify the puzzle to two cases, one of which has no solution for positive integers, and the other that gives us the required solution.
However, here is a constructive Python program that considers the total numbers of players t (up to 2000), and generates the possible (n, k, m) values for each candidate t value. It then looks for two t values that differ by 2, and give n and k values that differ by 1, and m values that differ by 63.
This Python program runs in 85ms.
Run: [ @replit ]
from enigma import (irange, divisors_pairs, tri, cproduct, tuples, printf) # generate (k, n, m) values for t players def generate(t): # divide them into k sections of n players each for (k, n) in divisors_pairs(t, every=1): if n < 2: continue # calculate the total number of matches m = k * tri(n - 1) yield (t, k, n, m) # solve for numbers of players that differ by 2 def solve(N): for (zs, ys, xs) in tuples((list(generate(t)) for t in irange(1, N)), 3): for ((t, k, n, m), (t_, k_, n_, m_)) in cproduct([xs, zs]): # check the differences in the corresponding k, n, m values if abs(k - k_) == 1 and abs(n - n_) == 1 and m - m_ == 63: # output solution printf("{k} sections of {n} players (= {m} matches) -> {k_} sections of {n_} players (= {m_} matches)") # solve the puzzle (up to 2000 players) solve(2000)Solution: There are 10 players in each section.
The club starts with 110 players, formed into 11 sections of 10 players each. There are 45 matches among the players in each section, and 495 matches in total.
When 2 players leave there are 108 players remaining. These are formed into 12 sections of 9 players each. There are 36 matches among the players in each section, and 432 matches in total. This is 63 fewer matches.
Manually from:
we can see that (for n + k > 3) there are 2 cases:
[Case 1] (n, k) → (n + 1, k − 1) ⇒ k = n − 1.
Which has no solution in positive integers.
[Case 2] (n, k) → (n − 1, k + 1) ⇒ k = n + 1.
And so there are 11 sections, each with 10 players.
LikeLike
GeoffR 3:49 pm on 19 November 2022 Permalink |
LikeLike
GeoffR 6:21 pm on 19 November 2022 Permalink |
# Assumed max no players and sections is 24 for both groups # Suffix 'B' for before matches and 'A' for after matches for playersB in range(1, 25): for sectionsB in range(1, 25): before_matches = sectionsB * (playersB * (playersB - 1) // 2) for playersA in range(1, 25): # The number of players will change by one if abs(playersA - playersB) != 1: continue for sectionsA in range(1, 25): # The number of sections will change by one if abs(sectionsA - sectionsB) != 1: continue # two players retire if sectionsB * playersB - 2 != sectionsA * playersA: continue after_matches = sectionsA * (playersA * (playersA - 1) // 2) # Differences in total number of matches if before_matches - after_matches != 63: continue # output player and sections data print(f"Players before two retire = {playersB} No.") print(f"Sections before two retire = {sectionsB} No.") print(f"Players after two retire = {playersA} No.") print(f"Sections after two retire = {sectionsA} No.")LikeLike