FEATURED

# Prisoners and a Bulb

There are 100 prisoners in solitary cells. There is a central living room with one light bulb in it, which can be either on or off initially. No prisoner can see the light bulb from his or her own cell. Every day, the warden picks a prisoner at random and that prisoner visits the living room. While there, the prisoner can toggle the light bulb if he wishes to do so. Also, at any time, every prisoner has the option of asserting that all 100 prisoners have already been in the living room. If this assertion is false, all 100 prisoners will be executed. If it is correct, all prisoners will be set free.

The prisoners are allowed to get together one night in the courtyard and come up with a plan. What plan should they agree on, so that eventually someone will make a correct assertion, and they will be set free?

First, the prisoners should elect one of them to be a leader and the rest – followers. The first two times a follower visits the living room and sees that the light bulb is turned off, he should turn it on; after that he shouldn’t touch it anymore. Every time the leader visits the living room and sees that the light bulb is turned on, he should turn it off. After the leader turns off the lightbulb 199 times, this will mean that all followers have already visited the room. Then he can make the assertion and set everyone free.

##### Unknown Author

We do not know where this puzzle originated from. If you have any information, please let us know via email.

#### Responses

1. What if the warden does not take the leader there enough times?

1. Good points, the extra condition that everyone goes infinitely many times inside the room will be added.
However, if the warden picks a prisoner every day truly at random, the probability that everyone will visit the room infinitely many times is 100%.