Locker Problem

In a prision there are 2n prisoners, 2n lockers and 2n hats. The prisoners, the lockers and the hats, each of them have a distinct number in the range of (1,2n) and every prisoner is aware of that and is able to identify his own number and the number of any locket or hat by looking at it.

They are gathered one time in a grand hall and are told that their 2n hats are randomly distributed over all the 2n lockets, so that in every locket lies a hat. They are then told, that one after another is allowed to visit exactly n lockets and look at the hat, that is inside. Then, if the prisoner is able to correctly guess the safe his hat is hidden in, then he is allowed leave the prison. If he guesses wrong, his soul enters the state of being no longer well defined, a gruesome fate indeed.
After a prisoners has become either free or not well defined, the next prisoner is given the exact same choice. Before this game of freedom and non well definedness begins, the prisoners are allowed to come up with a plan to maximize their chances that all of them become free.

After the start of the game the prisoners are no longer able to communicate or exchange information between each other.

What is the best chance, the likelihood L of all prisoners escaping the prison successfully?

For the problem, one can assume, that the n becomes big, really really big. For the answer, type in 1000 L 1 \lfloor 1000*L \rfloor - 1

As a hint: 0 is not the answer of the problem, even if the n goes to infinity...


The answer is 305.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Matt Janko
Mar 17, 2020

This is an instance of the "100 prisoners" problem . Regard the placement of hats into lockers as a permutation σ \sigma on { 1 , , 2 n } \{1,\dots,2n\} so that locker q q contains hat σ ( q ) \sigma(q) . The goal of prisoner p p is to find locker q q such that σ ( q ) = p \sigma(q) = p . He can do this by following a cycle in σ \sigma . Prisoner p p first opens locker p p , then locker σ ( p ) \sigma(p) , then locker σ ( σ ( p ) ) \sigma(\sigma(p)) , and so on. This cycle is sure to contain p p , and if the length of the cycle is no more than n n , the prisoner is guaranteed to find his hat within the allotted number of turns. For all the prisoners to find their hats, σ \sigma must contain no cycles with length greater than n n , and this happens with probability 1 ( H 2 n H n ) , 1 - (H_{2n} - H_n), where H n H_n denotes the n n th harmonic number. For large n n , this probability is approximately 1 ln 2 0.3069 , 1 - \ln 2 \approx 0.3069, so the desired value is 1000 ( 0.3069 ) 1 = 305 \lfloor 1000(0.3069) \rfloor - 1 = 305 . The Wikipedia article linked above gives the derivation of this probability.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...