The Hundred Boxes
Also asked as: The 100 prisoners problem · 100 prisoners and 100 boxes · the cycle-following strategy
One of the classic quant interview questions, free to read in full.
Problem
100 prisoners are numbered 1 to 100. A room contains 100 boxes; a uniformly random permutation assigns one prisoner's number to each box's interior. One at a time, each prisoner enters, opens at most 50 boxes of his choice, and must find his own number; boxes are restored before the next prisoner. No communication is allowed once the process starts, but the prisoners may agree on a strategy beforehand. All go free only if every prisoner succeeds. Independent random guessing succeeds with probability . With the optimal strategy, what is the success probability?
Your answer
Accepts decimals, fractions (5/12), and percentages (25%).