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
As a hint: 0 is not the answer of the problem, even if the n goes to infinity...
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.
This is an instance of the "100 prisoners" problem . Regard the placement of hats into lockers as a permutation σ on { 1 , … , 2 n } so that locker q contains hat σ ( q ) . The goal of prisoner p is to find locker q such that σ ( q ) = p . He can do this by following a cycle in σ . Prisoner p first opens locker p , then locker σ ( p ) , then locker σ ( σ ( p ) ) , and so on. This cycle is sure to contain p , and if the length of the cycle is no more than n , the prisoner is guaranteed to find his hat within the allotted number of turns. For all the prisoners to find their hats, σ must contain no cycles with length greater than n , and this happens with probability 1 − ( H 2 n − H n ) , where H n denotes the n th harmonic number. For large n , this probability is approximately 1 − ln 2 ≈ 0 . 3 0 6 9 , so the desired value is ⌊ 1 0 0 0 ( 0 . 3 0 6 9 ) ⌋ − 1 = 3 0 5 . The Wikipedia article linked above gives the derivation of this probability.