#TITLETOPICDIFFICULTYSTATUS
There are 100 prisoners in a prison. Each day, the warden selects a prisoner uniformly at random (with replacement) and sends them into a special room containing a lightbulb, which is initially off. The prisoner may turn the bulb on, turn it off, or leave it unchanged.
The prisoners may confer before the game begins, but cannot communicate afterward. The lightbulb is their only source of information.
At any point, a prisoner may declare: "We have all been in the room." If true, they are all freed. If false, they are all executed.
Q1: What strategy guarantees their release with certainty?
Q2: What is the expected duration of this strategy?