From The Sunday Times, 10th September 2017 [link] [link]
Three expert logicians played a game with a set of twenty-one cards each containing a different two-figure prime number. Each drew a card and held it up so that they could not see their own card but could see the others. Alf, Bert and Charlie in turn were then asked two questions, namely “Is your number the smallest of the three?” and “Is your number the largest of the three?”. In the first round all three answered “Don’t know” to both questions. The same happened in rounds two and three. In round four Alf answered “Don’t know” to the first question.
What did Alf answer to the second question and what numbers did Bert and Charlie have?
News
When I started the S2T2 site (in February 2019), I already had notes for a number of Teaser puzzles that I had solved at the time of publication. And since then I have been steadily posting my notes for these puzzles to the site. This puzzle completes the accumulation of these notes, so there is now a complete archive of puzzles I solved at the time of publication from July 2015 to present.
I shall continue to post puzzles from 2011 – 2015 corresponding to the collections of Teasers published as books in 2019 and 2020 (see: [Books]), but these puzzles will be new to me.
Also, the posting of this puzzle also means that all puzzles from Teaser 2831 onwards are available on S2T2. Earlier Teaser puzzles are available via The Sunday Times Digital Archive (which is my source for older puzzles on the site).
[teaser2868]
Jim Randell 6:47 am on 11 January 2026 Permalink |
The setter has an additional piece of information – i.e. they can observe the total number of people in the group. If it is possible to break this total down in into knights and knaves in only one way that is consistent with the statements made, then the composition of the group can be determined with certainty.
The following Python program runs in 71ms. (Internal runtime is 158µs).
from enigma import (irange, inf, decompose, filter2, is_prime, is_square_p, printf) # consider increasing group sizes (at least 6) for t in irange(6, inf): # collect candidate solutions for this total size sols = list() # decompose into (a) knights and (b) knaves for (a, b) in decompose(t, 2, min_v=1, increasing=0, sep=0): # evaluate the statements ss = filter2(bool, [ # 1. "a is prime" is_prime(a), # 2. "a is odd" (a % 2 == 1), # 3. "b is square" is_square_p(b), # 4. "b is even" (b % 2 == 0), # 5. "a + b is odd" (t % 2 == 1), # 6. "b > a" (b > a), ]) # check minimum group sizes if len(ss.true) > a or len(ss.false) > b: continue # record this candidate sols.append((a, b)) printf("[{t} -> {sols}]") # check for unique solutions if len(sols) == 1: (a, b) = sols[0] printf("a = {a}; b = {b}") breakSolution: (a) There are 5 knights; (b) There are are 2 knaves.
The total size of the group is 7, and the statements made are:
There are 4 true statements, and 2 false statements, so both knaves made a false statement, and 4 of the 5 knights made a true statement.
And this is the only way a group of 7 can be broken down consistent with the statements.
If we allow the program to continue to larger group sizes, we see that the number of candidate breakdowns grows, so it would not be possible to determine the composition of a larger group.
LikeLike