Prisoners and the Lightbulb
100 prisoners will be taken, one at a time in an arbitrary (possibly repeating) order, into a room containing a single light switch, initially off. At any visit, a prisoner may declare "all 100 of us have visited the room." A correct declaration frees everyone; a wrong one is fatal. The prisoners may strategize once beforehand. In the standard guaranteed strategy, one prisoner is designated the counter and everyone else signals with the switch. How many times must the counter find the light switched on before safely declaring?
Related problems & prerequisites
Worth solving first
- Three Switches, One Bulb 6.0/10
Source: Classic distributed-protocol puzzle in wide circulation; no traceable original source. Statement written for AxiomIQ.