Home » Puzzle » The Prisoners and the Light Bulb

The Prisoners and the Light Bulb

100 prisoners are in solitary confinement, but there is one room with a light bulb that is initially off. The prisoners can visit the room one at a time in any order, and each time a prisoner enters, they can toggle the light bulb. If a prisoner concludes that all prisoners have visited the room, they can declare it. If correct, they are freed; if wrong, they are executed. How can they be freed?

Answer: Designate one prisoner as the counter. Only this prisoner can turn the light bulb off. Every time a different prisoner enters and the bulb is off, they turn it on if they haven’t done so before. The counter counts each time they turn the bulb off. Once they count 99 times, they can declare everyone has visited.

Leave a Reply

Your email address will not be published. Required fields are marked *