Learning with AI · explainer
The muddy children puzzle
A teacher tells a group of children something every one of them already knows. It changes everything. This post draws every world the children think might be real, and lets you watch that picture collapse once the sentence is said.
by Duc V. Le · November 2026
The puzzle
Some children have been playing outside, and a few of them have mud on their foreheads. Every child can see everyone else’s forehead, but not their own. There are no mirrors, and nobody is allowed to say what they see.
The teacher gathers them and says one sentence: “At least one of you is muddy.” Then she rings a bell, again and again, with one rule: when the bell rings, anyone who is sure they are muddy steps forward. Everyone hears every bell and sees who steps forward.
If $k$ children are muddy, nothing happens for the first $k-1$ bells. Then, at bell $k$, all the muddy children step forward together. Click a child to add or wash off mud, then let the teacher speak and ring the bell.
Before the teacher speaks. Each child sees everyone’s forehead except their own. Click a child to change who is muddy.
The teacher says it out loud, to everyone at once.
The teacher gives only the rule, and says nothing about mud.
Bell . Nobody steps forward.
Bell . forward.
Every muddy child has stepped forward, and the clean children now know they are clean.
Nothing more will ever happen, however often the bell rings.
The teacher can’t truthfully say that when nobody is muddy. Put mud on someone first.
Now the strange part. Make two or more children muddy. Then every child can already see a muddy forehead, so every child already knows that at least one of them is muddy. The teacher tells nobody anything new.
Yet switch the teacher to only the rule and ring as often as you like: nobody ever steps forward. A sentence that tells nobody anything new is the whole difference between “stuck forever” and “solved”. The rest of this post is about why.
Every world a child can imagine
Call a world one possible answer to “who is muddy?”. With three children there are 8 worlds, and with $n$ children there are $2^n$. Only one of them is real, but no child knows which.
We stack the worlds by how many children are muddy: nobody at the bottom, everybody at the top. Each world is a row of dots, one per child, filled in if that child is muddy.
Now the key question: which worlds can a child not tell apart? Ana sees everyone except herself. So two worlds that differ only in Ana’s forehead look exactly the same to Ana. We join every such pair with a line in Ana’s colour, and do the same for Ben and Cy.
Eight worlds for three children, stacked by how many are muddy. A filled dot means that child is muddy.
Ana’s lines. Each one joins two worlds that differ only in Ana’s forehead. Ana sees exactly the same thing in both, so she can’t tell them apart.
Ben’s lines, made the same way.
Cy’s lines. Every world now touches exactly one line of each colour: one doubt per child. With three children, the lines form a cube.
Hover over a world, or tap it, to see who is muddy there. The picture has one line per child per world, and that line is the child’s doubt: in the real world, Ana’s line leads to the one other world she cannot rule out.
Knowing is a line with nothing at the other end
The whole explanation rests on one rule.
The rule
A child knows whether they are muddy exactly when their line leads to a world that has been ruled out. Then only one world fits what they see.
Before the teacher speaks, no world has been ruled out. Every line has a world at both ends, so in every world, every child is unsure. That means that in every world, nobody steps forward at the first bell.
So when the first bell rings and nobody moves, that silence is exactly what every world predicted. It rules nothing out. The second bell is the same story, and so is every bell after it. Here are three muddy children with a teacher who gives only the rule:
Three muddy children; the real world is outlined in dark blue. Every world still has all its lines.
The rule alone rules out no world. Every line still has a world at both ends, so in every world, every child is unsure.
Bell . Nobody steps forward, which is exactly what every world predicted. No world falls.
Ring as long as you like: the picture can never change.
The sentence knocks out the foundation
“At least one of you is muddy” rules out exactly one world: the one at the bottom, where nobody is muddy. Watch what that does. Every line that ran into the bottom world now has nothing at its far end; it dangles.
In each world with exactly one muddy child, that child’s line is one of the dangling ones. So in those worlds, the muddy child would know, and would step forward at the first bell. A ring around a dot marks a child who knows their own forehead in that world.
Now silence means something. If nobody steps forward at bell 1, the real world cannot be one of the one-muddy worlds, so that whole floor falls. Their lines dangle in turn, now into the two-muddy worlds, and so on. Each silent bell knocks out one more floor. When the collapse reaches the real world, the muddy children’s lines all dangle at once, and they all step forward together.
Pick who is muddy by clicking the children or a world; the real world is outlined in dark blue. Then let the teacher speak.
Only the rule: no world is ruled out, so nothing will ever fall. Switch the teacher’s sentence back on.
The teacher speaks. The bottom world, where nobody is muddy, is ruled out, and the lines that ran into it now dangle.
Bell . Nobody steps forward. In someone would have, so they are ruled out: a whole floor falls, and the lines into the next floor up now dangle.
Bell . Nobody steps forward, which every remaining world predicted. Nothing falls.
Bell . forward. The other worlds predicted something different, so fall.
Bell . forward, which is what every remaining world predicted.
The collapse has reached the real world. Every child now knows their own forehead.
Nothing can change any more: the next bell will bring exactly what every remaining world predicts.
The teacher can’t truthfully say that when nobody is muddy. Put mud on someone first.
Show the worlds as a table
| World: who is muddy | Status | Who knows their forehead there |
|---|
Try five children with four of them muddy. Three silent bells knock out the three floors below the real world, and the muddy children step forward at bell four. Nothing visible happens before then, but every silent bell is doing work.
But everyone already knew!
So what did the teacher add? Take three children, all muddy, and follow Ana’s doubt down the picture.
The real world: Ana, Ben and Cy are all muddy. Each of them can see a muddy forehead, so each of them knows that at least one of them is muddy.
But Ana can’t see her own forehead. For all she knows, she is clean and only Ben and Cy are muddy. That is the world at the other end of her line.
Now step inside that imagined world. There, Ben sees only Cy muddy, and he can’t rule out that he is clean too, which leaves only Cy muddy.
And in that world, Cy sees no mud at all. Cy can’t rule out that nobody is muddy.
So the all-clean world is three lines away from the real one. Everyone knows someone is muddy, but Ana doesn’t know that Ben knows that Cy knows it.
The teacher says it to everyone at once. The all-clean world is gone, so no chain of doubts can end there any more. That one missing world is what starts the collapse.
This is the general picture. Something is known to everyone, and known to be known, and so on to any depth, exactly when it is true in every world you can reach from the real one by walking along lines. Before the teacher spoke, “someone is muddy” failed in one reachable world, three lines away. One world was enough to hold the whole structure in place.
With $k$ muddy children the all-clean world is $k$ lines away. Before the teacher speaks, “everyone knows that everyone knows …” holds $k-1$ levels deep but fails at level $k$, and afterwards the muddy children stay silent for exactly $k-1$ bells. The two numbers match.
Other sentences
The teacher’s sentence is not magic. What matters is which worlds it removes, and which lines that leaves dangling. A few others to try:
- “At least two of you are muddy.” Removes the bottom two floors at once. The collapse starts higher, so the muddy children step forward one bell earlier.
- “Ana is muddy.” Removes every world where Ana is clean. All of Ana’s lines dangle, so she knows straight away. But none of anyone else’s lines is left dangling, so the others never learn anything, however long the bell rings.
- “An odd number of you are muddy.” Removes every other world. Every line joins an odd world to an even one, so every surviving line dangles and everyone knows at once.
Choose what the teacher says and who is muddy, then let the teacher speak.
Only the rule: no world is ruled out.
The teacher speaks: where the sentence is false are ruled out, and the lines into them dangle.
Bell . Nobody steps forward, so where someone would have are ruled out.
Bell . Nobody new steps forward, which every remaining world predicted. Nothing falls.
Bell . forward, and that predicted something else fall.
Bell . forward, which is what every remaining world predicted.
Every child now knows their own forehead.
Nothing can change any more. Any child whose line still has a world at both ends will never find out.
The teacher can’t truthfully say that here. Change who is muddy, or what the teacher says.
Show the worlds as a table
| World: who is muddy | Status | Who knows their forehead there |
|---|
So a sentence helps exactly as much as the lines it leaves dangling. A line that keeps a world at both ends is a doubt that no amount of waiting will remove.
The fine print
The collapse leans hard on the setup. Every child reasons perfectly, hears every bell, sees every step, and steps forward at the very bell they become sure. Nobody guesses, lies or dozes off, and everyone knows all of this about everyone else.
Take any of that away and the silence stops meaning anything. If a child might simply have missed a bell, then nobody stepping forward no longer rules a world out, and the collapse can stall. That fragility is why puzzles like this one turn up in distributed computing, where messages get lost and machines drift out of step.
Where this comes from: I met the puzzle in chapter 1 of Maurice Herlihy, Dmitry Kozlov and Sergio Rajsbaum, Distributed Computing Through Combinatorial Topology (Morgan Kaufmann, 2014; chapter DOI), which draws the same structure in a different way. The pictures and wording here are my own, and so are any mistakes.
Did it work?
If one of the animations didn’t make the idea click, that is the most useful thing you could tell me. Select the sentence next to it, press suggest an edit, and say what you expected to see.