100 Prisoners and a Light bulb

Problem:

There are 100 prisoners are in solitary cells, unable to see, speak or communicate in any way with each other. There’s a central living room with one light bulb, the bulb is initially off. No prisoner can see the light bulb from his own cell. Everyday, the warden picks a prisoner at random, and that prisoner goes to the central living room. While there, the prisoner can toggle the bulb if he wishes. Also, the prisoner has the option of asserting the claim that all 100 prisoners have been to the living room. If this assertion is false (that is, some prisoners still haven’t been to the living room), all 100 prisoners will be shot for their stupidity. 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.

Before the random picking begins, the prisoners are allowed to get together to discuss a plan.  What plan should they agree on, so that eventually, someone will make a correct assertion?

light-bulb-100-prisoner-350x250

Solution:

In evaluation of the problem, there is no limit on the number of times that a prisoner can go into the cell, however the prisoners need a way to communicate with each other on who when into the cell.  Therefore one person is chosen as the counter.

Every time any prisoner is selected other than counter person , they follow these steps. If they have never turned on the light bulb before and the light bulb is off, they turn it on. If not, they don’t do anything (simple as that).
Now if Counter person is selected and the light bulb is already on, he adds one to his count and turns off the bulb. If the bulb is off, he just sits and do nothing. The day his count reaches 99, he calls the warden and tells him “Every prisoner has been in the special room at least once”.

.

4 Thoughts on “100 Prisoners and a Light bulb

  1. Ashok Kumar Rajpurohit on October 16, 2013 at 8:50 am said:

    if a prisoner is going to the first time to the cell he will toggle the bulb else he will just sit and come back so every prisoner can keep the count how many times the switch was toggled. when 100th prisoner go to the cell he know that all others have already been to the room so he can call to the warden and tell him.

  2. Ash Hacker on November 4, 2013 at 12:53 pm said:

    If a bulb is initially switch on then it will surely make the prisoners shot death.
    As counter increases by on at last 100 position one goes to call the warden..

  3. Nayanika Ghosh on February 21, 2015 at 9:11 pm said:

    perhaps the warden never choose the counter person….in that duration may be 99 prisoners have been to the cell many time,while the first one would have only turned on yhe bulb…In that case…the prisoners will be never freed?

  4. Boluwatife Ben-Adeola on September 6, 2019 at 2:52 am said:

    An out-of-box solution, that is may not be fool-proof.

    Let the lifespan of the bulb (40 to 80 days) serve as the value that is steadily decremented for every first-time visit by a prisoner.

    If it’s your first time visiting as a prisoner, you make sure you leave the bulb on when you’re leaving. That is, if it was on before, do nothing and leave it as it is. If it was off, turn it on as you leave. That would mean the lifespan would’ve reduced by 1 day only on your first visit when the next chosen prisoner is selected.

    If it’s not your first visit, if you meet it off, leave it as is. If you meet it on, turn it off, so that day doesn’t count as a decrement in the lifespan.

    The base case would be when a prisoner comes to meet the bulb burnt out.

Leave a Reply to Ash Hacker Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation