This one is nice,however might be known to You...
There is a prison with 100 captives in the solitary cells. Every night the guard will pick one of the prisoners(at random) and allow him to spend a night in a living room with a lightbulb(which is not visible from the cells). Prisoner can toogle the bulb,if he wishes,but if he does,he must guess who spend a night in the room before him. If the guess is correct,they are all realesed,if not they would be all killed.
Captives have one night to discuss a plan,but after that night,one of them(picked intentionally by the guard) will be killed.
What shalll they do ???
There are 100 prisoners. In one hour the warden will pick one of them at random and kill that person (I'm assuming no other prisoner knows which prisoner was killed). They also know that tomorrow (and every day from here on) one prisoner will be selected at random and led into a room where they have the option of toggling a light switch. If while in this room they tell the warden which prisoner was in the prison the day before they all go free. If they are incorrect they all die. After the hour is up they will all be kept isolated so they must plan a strategy in the next hour.
What strategy should they employ?
There are 100 prisoners. In one hour the warden will pick one of them at random and kill that person (I'm assuming no other prisoner knows which prisoner was killed). They also know that tomorrow (and every day from here on) one prisoner will be selected at random and led into a room where they have the option of toggling a light switch. If while in this room they tell the warden which prisoner wa ...[text shortened]... After the hour is up they will all be kept isolated so they must plan a strategy in the next hour.One clarification-They can discuss a plan only once...
If they all know the initial state of the light bulb to start, it's simply a matter of using that light bulb as a signal of sorts.
I have a solution but it has a 1% fail rate. Doesn't seem to be any way around that initial death..
There is also the possibility that the guard can guess at the plan, and can choose prisoners in such a way as to greatly increase the odds none of them ever get out.
(Note, I am assuming the plan and roles are confidential and not overheard or leaked in any way. I am also assuming the guard is under no obligation to obey any particular rules save for 2 of them.
1) He must pick a prisoner each night.
2) He would not pick the same prisoner twice in a row, as that would guarantee their release.)
Originally posted by XanthosNZThis is not the problem first stated. However, I think this might work;
There are 100 prisoners. In one hour the warden will pick one of them at random and kill that person (I'm assuming no other prisoner knows which prisoner was killed). They also know that tomorrow (and every day from here on) one prisoner will be selected at random and led into a room where they have the option of toggling a light switch. If while in this r ...[text shortened]... t isolated so they must plan a strategy in the next hour.
What strategy should they employ?
Two prisoners are labelled A and B. All prisoners need to remember who A and B are. All prisoners need to keep track of the days, more precisely if the number of days passed since this day is odd or even. I assume the light is off at the start.
Prisoner A turns the light on on an even day, prisoner B does so on an odd day. Otherwise none of them do anything.
The light remains off until either prisoner A or B has been in the room. If on a day a prisoner finds the light on, he only needs to know if the previous day number was even or odd.
If is was even, prisoner A was there the day before. If it was odd, prisoner B was there.
Only one of the two can be shot in the beginning, leaving the other alive to continue as planned.
If the light was on at the start, the prisoners will have to turn the light off, instead of on.
Originally posted by ChoreantThe first problem was good. This one is crap, it's also been posted many many times.
So,another one about bulbs.
You are in a room with three switches. One is attached to a lightbulb upstairs,and two others do nothing. Task is to find which one is working. It is impossible to see the bulb without going upstairs,however once you did,you cannot return to the switch room.
Originally posted by TheMaster37Nice solution. A further question, this would also work with 3 prisoners tasked to turn on lights (A, B, C) turning them on only when day mod 3 = 0,1,2. Is this faster or slower?
This is not the problem first stated. However, I think this might work;
Two prisoners are labelled A and B. All prisoners need to remember who A and B are. All prisoners need to keep track of the days, more precisely if the number of days passed since this day is odd or even. I assume the light is off at the start.
Prisoner A turns the light on on ...[text shortened]...
If the light was on at the start, the prisoners will have to turn the light off, instead of on.
And can it be shown that a strategy similar to this is optimal?
Originally posted by XanthosNZWel, this strategy for N persons would be just as fast.
Nice solution. A further question, this would also work with 3 prisoners tasked to turn on lights (A, B, C) turning them on only when day mod 3 = 0,1,2. Is this faster or slower?
And can it be shown that a strategy similar to this is optimal?
It's a chance of N/100 for one of the special prisoners to be chosen. It's a further chance of 1/N that he will be chosen on the right day. This gives the prisoners a 1/100 chance every day of ending their captivity 🙂