Alex Rivera | Logout

Finding your own number in a box

Asked 2008-08-29T10:39:13.537
9

100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100.

One by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers from 1 to 100 (the numbers inside the boxes are randomly permuted!).

Once inside room B, each prisoner gets to open 50 boxes (he chooses which one he opens). If he finds the number that was assigned to him in one of these 50 boxes, the prisoner gets to walk into a room C and all boxes are closed again before the next one walks into room B from room A. Otherwise, all prisoners (in rooms A, B and C) gets killed.

Before entering room B, the prisoners can agree on a strategy (algorithm). There is no way to communicate between rooms (and no message can be left in room B!).

Is there an algorithm that maximizes the probability that all prisoners survive? What probability does that algorithm achieve?

Notes:

  • Doing things randomly (what you call 'no strategy') indeed gives a probability of 1/2 for each prisoner, but then the probability of all of them surviving is 1/2^100 (which is quite low). One can do much better!

  • The prisoners are not allowed to reorder the boxes!

  • All prisoners are killed the first time a prisoner fails to find his number. And no communication is possible.

  • Hint: one can save more than 30 prisoners on average, which is much more that (50/100) * (50/99) * [...] * 1

Edit
Report

1 Answer

0

Maybe I'm not reading it right, but the question seems to be badly constructed or missing information.

If he finds the number that was assigned to him in one of these 50 boxes, the prisoner gets to walk into a room C and all boxes are closed again before the next one walks into room B from room A. Otherwise, all prisoners (in rooms A, B and C) gets killed.

Does the last sentence there mean that all prisoners are killed the first time a prisoner fails to find their number? If not, what happens to prisoners that don't find their number?

If no communication is possible, and whenever a prisoner enters room B it is always in an identical state then there is no possibility for a strategy.

The prisoners could could say before they leave room A which number box they are going to open. But without subsequent prisoners knowing whether they were successful or not (assuming failure for one isn't failure for all) when the next prisoner enters room B they still have the same odds of picking their number as the previous prisoner (always 1:100).

If failure for one is failure for all, then by knowing which box the previous prisoners opened, and by dint of the fact that they haven't all been killed, each successive prisoner could reduce the odds of picking the wrong box by one box. i.e. 1:100 for the first prisoner, 1:99 for the second, down to 1:1 for the last.

answered 2008-08-29T11:27:40.050

Your Answer