Brainteasers & Logic

Lesson 2 of 4

Knowledge Puzzles: Hats and Cheryl's Birthday

Treat every statement as a filter on the worlds a player cannot rule out, and hat lines, Cheryl's birthday and the blue-eyed islanders all come apart the same way.

Knowledge as ruling out worlds

In a knowledge puzzle each player carries a list of worlds they cannot rule out. A player knows a fact when it is true in every world on their list. That makes "I don't know" useful: once it is said out loud, everyone can delete each world in which the speaker would have known.

Take Alice and Bob, each given a positive integer and told that the two numbers are consecutive. Alice holds 3 and Bob holds 4. Write worlds as (Alice, Bob), so Alice's list is {(3,2),(3,4)}\{(3,2), (3,4)\}.

Alice says "I don't know your number." Only someone holding 1 would know, since the other number must be 2, so every world with Alice on 1 is deleted.

Bob says "I don't know your number." Holding 2, Bob's list would have been {(1,2),(3,2)}\{(1,2), (3,2)\}, and Alice's remark already removed (1,2)(1,2), so he would have known. Holding 1, he would have known immediately. Both are deleted.

Alice says "Now I know." Her list was {(3,2),(3,4)}\{(3,2), (3,4)\}, Bob's remark removed (3,2)(3,2), and (3,4)(3,4) is all that is left.

Every puzzle in this lesson runs on the same loop: write down the worlds, turn each statement into a filter, and apply the filters in the order they are spoken. Statements get harder when they nest. "Alice knows pp" checks Alice's list. "Alice knows that Bob doesn't know pp" has to check, for every world on Alice's list, what Bob's list would be in that world. Most wrong answers to Cheryl's birthday come from flattening that second kind of statement into the first.