2026-11-21

Problem — 2026-11-21

Hard

HardLogic

Twelve islanders sit evenly around a round table. Each is either a knight (always tells the truth) or a knave (always lies). Every one of them says: My two neighbours are of the same type as each other (both knights or both knaves). A visitor also learns, reliably, that at least one knave is at the table. How many knights are at the table?

Enter an integer

Show solution
Write xi=1x_i=1 for a knight and 00 for a knave. Person ii's statement is true iff xi−1=xi+1x_{i-1}=x_{i+1}, and it is true iff ii is a knight, so xi=1⊕xi−1⊕xi+1x_i=1\oplus x_{i-1}\oplus x_{i+1}, i.e. xi−1+xi+xi+1≡1(mod2)x_{i-1}+x_i+x_{i+1}\equiv1\pmod 2 for every ii. Subtracting consecutive equations gives xi+2=xi−1x_{i+2}=x_{i-1}, so the pattern repeats every 33 seats (consistent since 3∣123\mid12), and each block of three has an odd number of knights: either 33 (everyone a knight) or exactly 11. All knights is ruled out, so the pattern is knight, knave, knave repeated: check that a knight sees two knaves (true) and a knave sees a knight and a knave (false). That gives 12/3=412/3=4 knights.