1

There are $100$ prisoners in solitary cells. There's a central living room with one light bulb; this bulb is initially off. No prisoner can see the light bulb from his or her own cell. Everyday, the warden picks a prisoner equally at random, and that prisoner visits the living room. While there, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting that all $100$ prisoners have been to the living room by now. If this assertion is false, all $100$ prisoners are shot. However, if it is indeed true, all prisoners are set free. Thus, the assertion should only be made if the prisoner is $100\%$ certain of its validity. The prisoners are allowed to get together one night in the courtyard, to discuss a plan. What plan should they agree on, so that eventually, someone will make a correct assertion?

My idea: The prisoner who's selected on the first night, call him $P$, gets a special role; he will be the one who eventually declares that all the other prisoners have been in the room.

After every subsequent night, a prisoner will switch the light from OFF to ON iff it was his first time in the room and the light was OFF when he entered. The designated prisoner $P$, will switch the light from ON to OFF every time he enters (he will not touch the switch if it was already OFF).

After P finds the light ON $99$ times, he declares that all the other prisoners have entered the room.

My questions:

  1. What's the expected number of days until the plan succeeds?

I calculated $100\times99 + 1000\times H_{100}$, but I'm not sure if this is correct.

  1. Is there a more efficient plan?
Mkch
  • 399
  • 3
    Possible duplicate of 100 prisoners and a lightbulb (Short recap: There are many different plans they could agree on, it is unknown what the "optimal" plan is, and it's not even clear what "optimal" means. So you can't really answer the question of what they should agree on. Your specific strategy is also discussed.) Also note that if the warden picks people truly at random, then there is no guaranteed strategy. – Arthur Nov 17 '19 at 21:44

0 Answers0