100 prisoners are put into solitary cells. There's a central living room with one light bulb; the bulb is initially off. 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 goes to the central living room. While there, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting the claim that all 100 prisoners have been to the living room. If this assertion is false (that is, some prisoners still haven't been to the living room), all 100 prisoners will be shot for their stupidity. However, if it is indeed true, all prisoners are set free and inducted into MENSA, since the world can always use more smart people. Thus, the assertion should only be made if the prisoner is 100% certain of its validity.
The prisoners are allowed to get together one night, to discuss a plan. What plan should they agree on, so that eventually, someone will make a correct assertion?
Well, I am assuming that everyone can see the light in the living room from their cell because of it's central location. Since only one per day is allowed, then the inmates can count the number of days, right? So if they toggle on the day when they are new, and don't toggle if they've toggled before, then the other inmates can simply count the number of days that the switch has been toggled. Once it has been toggeled 100 times, the next inmate can make the proper assertion.
The answer in short ... toggle only the first time you are randomly selected. Count the day only if the light is toggled.
Posted by Lawrence
on 2003-09-01 10:10:51