100 Prisoners in Solitary Cells

♠ Posted by GeekyFry in , at 9:55 AM

There are 100 prisoners in a prison in solitary cells. The warden of the prison offered them a challenge one day.
  • He will put one prisoner per day, selected at random (a prisoner can be selected more than once), into a special room with a light bulb and a switch which controls the bulb. No other prisoners can see or control the light bulb.
  • The prisoner in the special room can either turn on the bulb, turn off the bulb or do nothing.
  • On any day, the prisoners can stop this process and say “Every prisoner has been in the special room at least once”.
If that happens to be true, all the prisoners will be set free. If it is false, then all the prisoners will be executed. The prisoners can discuss and figure out a solution together before they start out for the challenge. How do they ensure they all go free?

Possible Solution:

They should select a particular prisoner say Tom as counter.Now they should make some rules as following for all the prisoners other than Tom, the counter:
  • On entering the room, if that prisoner has never turned on the light bulb before and the light bulb is off, they turn it on.
  •  If not, they don’t do anything.
If Tom, the counter, enters the room, he does the following:
  • If the light bulb is already on, he adds one to his count and turns off the bulb.
  • If the bulb is off, he does nothing.
On any day, when Tom sees that his count has become 99, he can go to the warden and declare that all the prisoners have entered the room atleast once. 

0 comments:

Post a Comment