The mind reader who survives a lie
Think of a number from 0 to 15 and keep it secret. For each of the seven cards, say whether your number is on it. You may lie on one card if you like. The page will name your number anyway, and tell you which answer was the lie. Then switch to Reveal to see how.
Your seven answers, in card order: –
A failed check scores 1, 2 or 4. The total is the number of the lying card.
waiting
waiting
waiting
Build the cards yourself
Pick a card, click the numbers that should be on it, then check. Hint: cards 3, 5, 6, 7 are the 8s, 4s, 2s and 1s. Card 1 must make check A come out even, so a number is on card 1 exactly when it is on an odd number of cards 3, 5, 7.
Here the page plays the person and you choose where the lies go. Pick a secret, then click a card to turn its honest answer into a lie. Try one lie, then two.
What's going on
Cards 3, 5, 6 and 7 are the ordinary binary cards for 8, 4, 2 and 1. Cards 1, 2 and 4 are checking cards, chosen so that three groups of answers always contain an even number of yeses: cards 1, 3, 5, 7; cards 2, 3, 6, 7; and cards 4, 5, 6, 7. Those groups are the cards whose numbers have a 1 in the ones place, the twos place and the fours place.
A lie on card k breaks exactly the checks that card k belongs to, and those checks are the binary digits of k. Score 1, 2 and 4 for the failed checks and the total names the liar. Flip it back and read the number off cards 3, 5, 6, 7. If nothing fails, nobody lied.
This is the Hamming(7,4) code: four bits of message, three bits of checking, any single error corrected. The 16 honest strings, each with its 7 one-lie neighbours, account for 16 × 8 = 128 = 27 strings: every seven-bit string belongs to exactly one secret. That perfect fit is why two lies send the decoder confidently to the wrong answer, which the Two lies tab lets you watch.
Sheet: The mind reader who survives a lie. Related: Counting to 31 on one hand, Odd, even and things that never change.