Math paradoxes

The blue-eyed islanders A visitor says what everyone already knew. What happens?On night 100, all 100 blue-eyed leave.

An island is home to 100 people with blue eyes and 100 with brown eyes. There are no mirrors, and nobody may talk about eye colour. Anyone who works out their own eye colour must take the ferry at midnight that day and leave the island for good. All islanders are perfect logicians, and everyone knows it. One day a visitor says in front of everyone: "I can see someone with blue eyes." Everyone already knew that. What happens?

It seems that nothing happens: everyone sees at least 99 pairs of blue eyes. But the visitor changed not what each person knows, but what everyone knows about what the others know. The blue-eyed count the nights: if the 99 blue-eyed people I see have not left by night 99, I must be blue-eyed too. On night 100 all 100 leave together.

Make a guess
Night 100all 100 blue-eyed leave together
99nights when nothing happens
0new facts in the visitor's words
The puzzle

One island, one sentence, no new facts

This puzzle has been called the hardest logic puzzle in the world, Terence Tao has written about it, and it is a favourite of interview-prep collections. Behind it stands a whole branch of logic: how what people know about each other's knowledge changes what they do.

  1. 1

    The island

    200 people live here: 100 have blue eyes, 100 have brown. The islanders do not know these numbers: each one just sees everyone else's eyes.

  2. 2

    The taboo

    No mirrors, no puddles, no photos. Nobody talks about eye colour or hints at it. Nobody has ever seen their own eyes.

  3. 3

    The ferry

    A ferry comes every night at midnight. Anyone who worked out their own eye colour during the day must leave on it. In the morning everyone sees who left.

  4. 4

    The logicians

    Every islander reasons perfectly and never slips. Everyone knows the island's rules, and everyone knows that everyone knows them.

  5. 5

    The visitor

    One day a visitor arrives and says in front of everyone: "I can see someone with blue eyes." What happens next?

Intuition says

"Nothing: the visitor told them nothing new"

Everyone sees at least 99 blue-eyed people, so "there are blue-eyed people here" is news to nobody. Yet on night 100 all 100 blue-eyed leave together. What is new is that now everyone knows that everyone knows that everyone knows… without end.

Assumptions

  • Everyone sees everyone else's eyes but not their own. Nobody knows in advance how many islanders are blue-eyed.
  • You may leave only when you know your colour for certain. Guesses do not count.
  • The visitor tells the truth, everyone heard the words, and everyone knows that everyone heard them.
  • The islanders do not know which eye colours exist at all. So someone who learns "my eyes are not blue" still does not know their colour.
  • Nobody leaves the island except by the ferry rule.
Round 1 · Guess

What happens after the visitor speaks?

100 blue-eyed, 100 brown-eyed, one sentence everyone already knew. Pick an answer.

A breakdown of your answer will appear here.

Hints

Hard to decide? Open the hints one at a time: the easy one first, then stronger ones.

Round 2 · Game

Change what the visitor does and try to break the logic

A smaller island. Choose how many people have blue and brown eyes, and how the visitor delivers the news: to everyone at once, to nobody, to each person in a whisper, or to all but one. Step through the nights and watch who leaves. Click an islander to see the island through their eyes.

Blue-eyed
Brown-eyed
What the visitor does
–

Night log

    Round 3 · Exact check

    Every possible island, not random ones

    No dice are needed here: the logic can be checked completely. An island of n people has 2n ways to assign who is blue-eyed. The page keeps all these "possible worlds" in memory, marks for each person which worlds they cannot tell apart, and every night strikes out the worlds that contradict what was seen at the pier. This is how logic has modelled knowledge since Kripke and Hintikka.

    Islands checked
    –
    Exceptions to "k blue-eyed leave on night k"
    –
    Left with no visitor
    –
    Time taken
    –

    Row k means "k of the n people have blue eyes". Each cell shows the night when someone first leaves, the same for every island with that k; "never" is checked n + 2 nights ahead, after which the model no longer changes. The column "brown, if only two colours" adds the assumption that everyone knows eyes are only blue or brown. The islander who "missed it" did not hear the visitor, and everyone knows that. A private whisper changes the knowledge only of someone who hears something new.

    Round 4 · Five explanations

    Why words that everyone knew changed something

    Let's start with tiny islands and climb to 100. Then we'll see exactly what the visitor added to the island's knowledge.

    One blue-eyed

    She sees no blue eyes at all

    Before the visitor?"my eyes could be any colour"
    After the visitornight 1"he can only have meant me"

    If only Ann has blue eyes, she sees nothing but brown. The visitor says he sees blue eyes, so they must be hers. She leaves on the very first night. For her the visitor's words really are news, and this is the only case where they are.

    Two blue-eyed

    A silent first night is a message too

    Ann and Bob are blue-eyed. Ann sees Bob and thinks: "If my eyes are not blue, Bob sees no blue eyes and will leave on the first night." Bob thinks the same about Ann. In the morning both are still there. So each of them does see blue eyes, and the only ones Ann cannot see are her own. They leave together on the second night.

    Brown-eyed Carl sees two blue-eyed people and waits for night three. But they leave on night two, exactly as they would if his eyes were not blue. So Carl learns only that he is not blue-eyed.

    Any k

    Every quiet night raises the bar by one

    A blue-eyed islander sees 99 blue-eyed people. He reasons: "If my eyes are not blue, there are exactly 99, and 99 blue-eyed people, by the same logic, will leave on night 99." He waits. On night 99 nobody leaves. So there are not 99 blue-eyed people but 100, and he is the hundredth. All 100 reason the same way, so they leave together on night 100.

    A brown-eyed islander sees 100 blue-eyed people and would wait for night 100. They leave right then, so he learns only that his eyes are not blue. If everyone knows there are only two colours, he leaves on the next night, night 101; under our rules he stays.

    What the visitor added

    "Everyone knows that everyone knows…", but not forever

      Where intuition slips

      "Nothing new" is true of the fact, not of the knowledge

      Depth of "everyone knows that…" before99levels with 100 blue-eyed
      After the visitor∞levels: common knowledge

      The argument "the visitor added nothing" checks only the first level: does everyone know the fact. But the blue-eyed reasoning rests on level 100: "I know that Ann knows that Bob knows that… knows there are blue-eyed people." Before the visitor this chain broke at step 100. After a public sentence it became endless, and that is why the count of nights began.

      Sub-theory · epistemic logic

      A Kripke model: a three-person island as a cube

      Each corner of the cube is a possible world: which of the three people A, B, C have blue eyes. An edge in a person's colour joins two worlds that this person cannot tell apart: they differ only in that person's own eyes. A person knows a statement if it holds in every world their edges reach from the current one. The visitor's public sentence deletes the world "nobody is blue-eyed", and every night cuts the edges between worlds where the morning pier looks different.

      The philosopher David Lewis gave the first full analysis of common knowledge in his 1969 book "Convention", and Robert Aumann gave it a mathematical form in his 1976 paper "Agreeing to Disagree": an event is common knowledge if it holds in every world reachable by any chain of edges.

      E p = KAp ∧ KBp ∧ KCp  ·  C p = E p ∧ E²p ∧ E³p ∧ …
      For formula lovers

      Induction on the number of blue-eyed

      Statement P(k): if exactly k people are blue-eyed and the visitor's sentence is common knowledge, then all k leave on night k, and nobody leaves earlier.

      P(k):|B|=k⇒tleave=k

      Base: for k = 1 the blue-eyed person sees no blue eyes, so knows it is them. Step: a blue-eyed person sees k others; if they were not blue, by P(k) those would leave on night k. They don't, so they are blue-eyed.

      P(1),P(k)⇒P(k+1)⇒P(100)

      Without the visitor: with k blue-eyed, "everyone knows that…" holds exactly k − 1 times in a row. Depth k already fails, and that is the depth the induction step needs.

      Ejpholds⇔j≤k−1

      Generalisation: if the visitor says "I see at least m blue-eyed people", the count starts at m, and all k leave on night k − m + 1.

      |B|≥m⇒tleave=k−m+1

      Both halves are needed. Without the base the induction has nowhere to start: at k = 1 it is the visitor's sentence that gives the blue-eyed person knowledge. Without the step it is unclear why a silent night means anything: it does only because everyone knows how the others would reason.

      Round 5 · Scaling up

      Muddy children, two generals and TCP

      The islanders open the door to three worlds. In mathematics the depth of knowledge becomes a number you can measure. In logic it turns out that common knowledge cannot be built from unreliable messages. And in practice network engineers, central banks and even storytellers have long lived with that fact.

      Mathematics

      Muddy children: father says "at least m"

      Click a child to muddy or wash its forehead. Each child sees the other foreheads but not its own. Father says how many children at least are muddy, and asks again and again: "Who knows whether their forehead is muddy?" The children answer all at once.

      Children
      Father says "at least…"

      Depth of knowledge as a number

      Every "at least" saves a question

      This is the same puzzle in a school uniform, known as the muddy children puzzle. Here there are only two states, muddy and clean, and everyone knows it, so right after the muddy ones the clean ones answer too.

      If father says "at least m", then with k muddy children they answer "I know" at question k − m + 1. The phrase "at least m" makes m levels common knowledge at once, and the count starts at m. If father says nothing, nobody ever finds out: only the depth k − 1 the children already have is available, and depth k is needed.

      Logic

      Two generals: break a messenger plan

      Generals A and B stand on two hills. They win only together. Messengers cross a valley where the enemy may catch them. The plan: messengers go in turn A → B → A → …, each one sets off only after the previous one arrived, and a general attacks only if every messenger addressed to him has arrived. Choose how many messengers the plan uses, and click the messenger the enemy will catch.

      The coordinated attack problem

      The last messenger is always at risk

      However many confirmations the plan uses, the enemy only needs to catch the last messenger. Its sender got everything he was waiting for and attacks, while its addressee is still waiting and stays put. Make the rule more cautious, and the attack simply shifts to another messenger.

      In 1990 Joseph Halpern and Yoram Moses proved the general statement in the journal JACM: if messages can get lost, no finite exchange of them creates common knowledge. After m delivered messengers the depth of "A knows that B knows that…" is m, and no more. The islanders were lucky: they had one public sentence that everyone heard together.

      Practice

      TCP's three-way handshake

      A client and a server agree on a connection with three packets: SYN, SYN-ACK, ACK. Choose which packet gets lost first.

      A pragmatic compromise

      TCP does not solve the generals' problem, it sidesteps it

      After three packets the server knows that the client knows that the server got its request. That is three levels, not infinity: the client that sent the ACK does not know whether it arrived. TCP (RFC 793, 1981; now RFC 9293) simply does not require certainty. The client treats the connection as open right after its ACK, and if the ACK was lost, the server repeats SYN-ACK after a timeout. Mistakes can happen, but they are fixed by retrying, not by logic.

      Where common knowledge is what you need, you make a public statement, like the visitor on the island. Central banks announce rate decisions at a press conference for everyone at once rather than phoning each bank: what matters is that everyone knows that everyone else knows too. And in Andersen's tale "The Emperor's New Clothes" (1837) a child says out loud what everyone saw. After his words the naked emperor is seen by all together, and nobody can pretend any more.

      Bonus · Fun facts

      Things to tell your friends

      1953

      Three ladies in a carriage

      In "A Mathematician's Miscellany" John Littlewood described three ladies in a railway carriage: each has a dirty face, and each laughs at the others. Suddenly one of them realises that she is dirty too. Littlewood put it first among his favourites and already extended it to n ladies by induction, the same argument as the islanders'.

      1969

      A philosopher and traffic rules

      In his book "Convention" David Lewis explained how agreements such as "drive on the right" hold together. For that he needed common knowledge: everyone knows the rule, knows that the others know it, and so on.

      1976

      You cannot agree to disagree

      Robert Aumann proved that if two rational people share a common prior and their probability estimates for an event are common knowledge, those estimates must be equal. In 2005 Aumann received the Nobel Prize in economics together with Thomas Schelling.

      1978

      A name for the generals

      The unreliable messengers problem was described in 1975 by Akkoyunlu, Ekanadham and Huber, as two gangs of gangsters. Jim Gray recast it as a paradox of two generals in his 1978 notes on database operating systems.

      1997

      A Gödel Prize for knowledge

      Halpern and Moses received the Gödel Prize for their paper "Knowledge and Common Knowledge in a Distributed Environment" (JACM, 1990). It showed that the language of knowledge is a handy way to reason about distributed computer systems. In 2009 the same paper won the Dijkstra Prize as well.

      2008

      Tao and "the hardest puzzle"

      In the mid-2000s Randall Munroe of xkcd posted a version with a guru (a stranger on a Boston street told it to him) and called it the hardest logic puzzle in the world. Our version, with its midnight ferry, follows his. In February 2008 Terence Tao posted the puzzle on his blog with two conflicting arguments, "the visitor changes nothing" and "after 100 days all the blue-eyed leave", and invited readers to find the flaw.

      Reasoning About Knowledge

      Ronald Fagin, Joseph Y. Halpern, Yoram Moses, Moshe Y. Vardi

      1995 · section 1.1

      Littlewood's Miscellany

      J. E. Littlewood

      1986 · opening section, the three ladies

      All books →
      Discussion

      What do you think?

      Share your own explanation, an objection or a variant of the puzzle. You need a GitHub account to comment.

      Newsletter

      New puzzles, explanations and discussions

      I keep adding new puzzles, new ways to explain them and write-ups of the discussions they start. Leave your email and I'll write when something new is out. No spam, one-click unsubscribe.

      The sign-up form will appear here soon.