100 Prisoners and 100 Boxes
18 Aug 2008
Puzzle

A room has 100 boxes labeled 1 thru 100. The names of 100 prisoners have been placed in these boxes by the warden. The prisoners shall visit the room one by one. Each prisoner is allowed to inspect the contents of at most 50 boxes, one after the other and leave the room with no communication with other prisoners. If the prisoner discovers his own name in the boxes he inspects, he is released. The prisoners are allowed to collude before hand and devise a strategy to maximize the chances of releasing each and every prisoner. What is their strategy?

Source

A colleague at Google asked me this puzzle in 2008.

© Copyright 2008—2023, Gurmeet Manku.