100 prisoners and the light bulb
Asked at Jane Street, Citadel, SIG
100 prisoners are in solitary cells. Each day the warden picks one prisoner at random (uniformly, with repetition) to visit a room containing a single light bulb with an on/off switch. The prisoner may toggle the switch or leave it, then returns to their cell. No other communication is possible.
At any point, any prisoner may declare "Every prisoner has now visited this room at least once." If true, all go free; if false, all are executed. The bulb starts off (assume they know this). They strategize beforehand.
Devise a strategy that is guaranteed to eventually free them.
Show a hint
Appoint one special "counter." Ordinary prisoners can turn the bulb on exactly once each; the counter turns it off and tallies.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.