100 Prisoners and 100 Boxes
100 prisoners are numbered through . A room contains 100 boxes, also numbered –. Each box contains a slip with one prisoner's number, placed in a uniformly random permutation.
One by one, prisoners enter and may open up to 50 boxes. To survive, each prisoner must find the slip with their own number. They can plan a strategy beforehand but cannot communicate once it starts.
Maximize the probability that all 100 prisoners survive.
"Random opening is hopeless." True: each prisoner finds their number with probability , so all 100 surviving has probability:
— roughly the chance of winning the lottery three times in a row.
"Even with a smart strategy, maybe a few percent?" No. The actual answer is roughly . That's a factor of better than random. The strategy is one of the most surprising results in elementary probability.