🔴 Riddle #64 of 240
A chessboard has a coin on every square, each showing heads or tails at random. A key is hidden under one square. The first prisoner, who knows where the key is, may flip exactly one coin, then leaves. The second prisoner, who sees only the resulting board, must point to the square hiding the key. The two may agree on a system beforehand. How can the second prisoner always succeed?
Think about it first. When you're ready:
XOR of tails-square labels
Label squares 0–63 in binary; the first prisoner flips the coin on the square labelled (XOR of tails labels) XOR (key label), so the board's XOR code becomes the key label, which the second prisoner reads off.