100 Prisoners
Probability Theory — Collective Cognition — Emergent Strategy
Based on the 2003 puzzle by Gal and Miltersen. One hundred prisoners. One hundred boxes. Each prisoner may open fifty. All must find their own number — or everyone dies. A random strategy gives near-zero odds. One counterintuitive strategy wins roughly 31% of the time. The math is proven. The reason it works is more interesting than the proof.
The Numbers
The Problem
One hundred prisoners are each assigned a unique number from 1 to 100. In a room, 100 boxes are arranged — each containing a random slip with one of those numbers. The prisoners must enter the room one at a time, open up to 50 boxes, and find the slip bearing their own number.
They cannot communicate once the trials begin. They cannot leave marks. Each prisoner enters, opens boxes, and leaves — with no way to signal what they found.
If every single prisoner finds their number, they all go free. If even one fails, everyone is executed.
A random strategy — each prisoner opens 50 boxes at random — gives each individual a 50% chance. But the probability that all 100 succeed independently is (1/2)^100. This is not a rounding error. It is effectively zero.
The cycle-following strategy changes the collective probability to approximately 31%. This should not be possible. No communication occurs. Each prisoner acts alone. Yet the strategy coordinates them through the structure of the room itself.
The strategy: each prisoner starts at the box numbered with their own prisoner number. They open it, read the slip inside, and open the box with that number next. They follow this chain — each slip pointing to the next box — until they either find their own number or exhaust their 50 opens.
This works because the 100 slips form a mathematical structure called a permutation. Any permutation can be decomposed into cycles — closed loops where following the chain always returns to the starting point.
If every cycle in the permutation has length 50 or less, every prisoner following the strategy will find their number within their allowed opens. The question becomes: what is the probability that a random permutation of 100 elements contains no cycle longer than 50?
The answer is approximately 31%. Not because of any trick. Because of the mathematical structure of permutations — a structure the prisoners exploit without ever discussing it.
The Strategies
Simulation
Three difficulty modes. Play manually as each prisoner, watch the smart cycle strategy execute, or watch random selection fail. The end screen reveals the full permutation cycle structure — which cycles were safe, which were lethal, and why.
Connection to Friction Bloom
The 100 Prisoners Problem and Friction Bloom study the same phenomenon from opposite directions. Friction Bloom introduces disruption to a navigating agent and measures whether it finds a novel path — a Bloom. The prisoners face a fixed constraint and must discover whether the room's hidden structure allows escape.
In both cases, the system finds a solution that was never designed for it. The cycle-following strategy was not written into the room. It emerges from the mathematical structure of permutations. The Bloom path was not designed into the grid. It emerges when the agent is forced off its baseline route by friction.
The deeper connection is cognitive. The prisoners cannot communicate, yet the smart strategy coordinates them — through the structure of the environment rather than through direct exchange. This is the same principle that governs emergent behavior in multi-agent systems, distributed cognition, and the MentiSystema Mesh. Structure, not signal, does the work.