One hundred boxes
There are prisoners, numbered to , and boxes, also numbered. A random permutation of the numbers to is placed in the boxes, one per box. Each prisoner, alone, may open boxes; nobody can communicate after the first one enters. All prisoners are freed only if every one of them finds their own number.
They agree on this strategy: prisoner opens box , then the box whose number they just found, and so on. What is the probability that all of them succeed? Give a decimal answer.
Fractions, decimals with at least 3 significant digits, and expressions such as sqrt(2)/2, e^-1 or pi/4.
Following the numbers from box traces the cycle of the permutation that contains . When does prisoner find their number within boxes?
Everybody succeeds exactly when the permutation has no cycle longer than . Count the permutations of that have a cycle of a given length .
h
s Shown after a correct answer. Revealing it first marks the problem as seen, not solved.
Idea. The strategy makes the prisoners' successes depend only on the cycle structure of the permutation. They all succeed or fail together, depending on whether there is a cycle longer than , and that has a simple probability.
Step 1: what the strategy does. Starting at box and following the numbers walks around the cycle containing ; the number is the last one found on that cycle. So prisoner succeeds if and only if their cycle has length at most . All succeed if and only if every cycle has length at most .
Step 2: a long cycle. A permutation of elements has at most one cycle longer than . The number of permutations with a cycle of length exactly is choose the elements of the cycle, arrange them in a cycle, and arrange the rest freely. So that cycle exists with probability .
Step 3. The events for different are disjoint, so
Why this is surprising. If each prisoner opened random boxes, the probability would be . The cycle strategy makes their successes perfectly correlated, and the answer stays above for any number of prisoners.