Brain-Teaser 523: [Alphabet cricket]
From The Sunday Times, 20th June 1971 [link]
The Alphabet Cricket Club (26 playing members, every surname having a different initial letter) ran into trouble last season. The selected 1st XI consisted of those with initials A to K; the 2nd XI was to be picked from the remainder, but personal feeling had crept in. (To save space, players are referred to by initials).
U refused to play in the same team as Z. Q said that he would not be available if either L or M was picked. P announced that he would not turn out (a) unless M was in the side, (b) if either O or W played. Z declined to play in an XI containing more than one of R, S, T. Finally, V agreed to play only with Q.
The secretary managed to pick an XI but then a further complication arose: two of the 1st XI fell ill and two of the selected 2nd XI were taken to fill the gaps. Fortunately the secretary was still able to field a 2nd XI (which, incidentally, won, M making a century).
Who were the two promoted to the 1st XI, and who were omitted altogether?
This puzzle was originally published with no title.
[teaser523]
Jim Randell 9:49 am on 21 June 2020 Permalink |
This Python program runs in 52ms.
from enigma import (subsets, intersect, diff, join, printf) players = "LMNOPQRSTUVWXYZ" # generate possible 2nd XI's def generate(): for ps in subsets(players, size=11): # verify conditions: # "U refused to play in the same team as Z" if 'U' in ps and 'Z' in ps: continue # "Q said that he would not be available if either L or M was picked" if 'Q' in ps and ('L' in ps or 'M' in ps): continue # "P announced that he would not turn out (a) unless M was in the # side, (b) if either O or W played" if 'P' in ps and ('M' not in ps or 'O' in ps or 'W' in ps): continue # "Z declined to play in an XI containing more than one of R, S, T" if 'Z' in ps and len(intersect((ps, "RST"))) > 1: continue # "V agreed to play only with Q" if 'V' in ps and 'Q' not in ps: continue yield ps # choose two sets for the second eleven for (s1, s2) in subsets(generate(), size=2, select="P"): # M is in the final set if 'M' not in s2: continue # the two promoted are in the first but not the second ps = diff(s1, s2) if len(ps) != 2: continue # the ones who were never picked ns = diff(players, s1 + s2) printf("promoted={ps} omitted={ns} [{s1} -> {s2}]", ps=join(ps), ns=join(ns), s1=join(s1), s2=join(s2))Solution: Q and V were promoted. P and Z were omitted.
The original 2nd XI was: N O Q R S T U V W X Y.
And then Q and V were promoted to the 1st XI. L and M stepped in to take their places.
So the actual 2nd XI was: L M N O R S T U W X Y.
P and Z were omitted from both line-ups.
V will play only with Q, so it makes sense that Q and V were promoted together. (Although I didn’t check that the requirements for the 2nd XI were satisfied by the new 1st XI, but in this case they would be).
These are the only two possible line-ups allowed for the 2nd XI for the given conditions, so the one with M in must be the actual line-up.
LikeLike
John Crabtree 8:06 pm on 25 June 2020 Permalink |
Four players were initially not picked.
From the two statements involving Z, if Z plays, U does not play and at least two of R, S and T do not play.
The two statements involving Q may be written as:
Q + ~Q.~V = 1
Q.~L.~M + ~Q = 1
Combining them gives Q.~L.~M + ~Q.~V = 1
Either L and M do not play, or Q and V do not play, and so Z does not play,
The statements involving P may be written as P.M.~O.~W + ~P = 1
If P plays, Q, V, O, W and Z do not play. And so P does not play.
And so Q and V were promoted. P and Z did not play.
L and M were brought in to the 2nd XI as replacements.
LikeLike