The Switch of Unknown State
One hundred prisoners are taken, one per day in an arbitrary order in which every prisoner is chosen infinitely often, into a room containing a light bulb with a switch. The bulb's initial state (on or off) is unknown to everyone and cannot be assumed. Nobody else sees the bulb, and the room offers no other communication. Prisoners agree in advance on this protocol. - Prisoner A is the counter. On a visit, if the bulb is on, A turns it off and adds 1 to a tally. Otherwise A does nothing. - Every other prisoner keeps their own count of how many times they have switched the bulb on. On a visit, if the bulb is off and that count is below 2, they turn it on and add 1 to their count. Otherwise they do nothing. A declares "everyone has visited" as soon as the tally reaches T. What is the smallest T for which the declaration is guaranteed to be correct, no matter the initial state and the visiting order?
Related problems & prerequisites
Worth solving first
- Prisoners and the Lightbulb 7.0/10
Source: Variant of the classic prisoners-and-light-switch puzzle (initial state unknown) in wide circulation; no traceable original source. Statement written for AxiomIQ.