Brain Teasers
Prisoners and 2 Switches - Scenario A
The warden meets with 23 new prisoners when they arrive. He tells them, "You may meet today and plan a strategy. But after today, you will be in isolated cells and will have no communication with one another.
"In the prison there is a switch room which contains two light switches labeled A and B, each of which can be in either the 'on' or the 'off' position. BOTH SWITCHES ARE IN THEIR OFF POSITIONS NOW.* The switches are not connected to anything.
"After today, from time to time whenever I feel so inclined, I will select one prisoner at random and escort him to the switch room. This prisoner will select one of the two switches and reverse its position. He must move one, but only one of the switches. He can't move both but he can't move none either. Then he'll be led back to his cell."
"No one else will enter the switch room until I lead the next prisoner there, and he'll be instructed to do the same thing. I'm going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back."
"But, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time any one of you may declare to me, 'We have all visited the switch room.'
"If it is true, then you will all be set free. If it is false, and somebody has not yet visited the switch room, you will be fed to the alligators."
*note - the only difference from Scenario B, the original position of the 2 switches are known.
"In the prison there is a switch room which contains two light switches labeled A and B, each of which can be in either the 'on' or the 'off' position. BOTH SWITCHES ARE IN THEIR OFF POSITIONS NOW.* The switches are not connected to anything.
"After today, from time to time whenever I feel so inclined, I will select one prisoner at random and escort him to the switch room. This prisoner will select one of the two switches and reverse its position. He must move one, but only one of the switches. He can't move both but he can't move none either. Then he'll be led back to his cell."
"No one else will enter the switch room until I lead the next prisoner there, and he'll be instructed to do the same thing. I'm going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back."
"But, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time any one of you may declare to me, 'We have all visited the switch room.'
"If it is true, then you will all be set free. If it is false, and somebody has not yet visited the switch room, you will be fed to the alligators."
*note - the only difference from Scenario B, the original position of the 2 switches are known.
Hint
Assuming that:A) There is no restriction on the amount of time the prisoners could take before sending the notice to the warden that everyone has been to the switch room at least once.
B) There is no restriction on the number of time each prisoner can visit the switch room
C) The warden will not attempt any foul moves, such as intentionally not bringing a certain prisoner to the switch room forever.
Answer
1. Appoint a "scorekeeper" and the other 22 prisoners as "transmitters".2. When a transmitter enter the switch room for the first time, he will flick switch B ON if he sees it in the OFF position. Alternatively, he will flick switch A if he sees switch B is in the ON position and waits for his next visit. The transmitter's mission is to find ONE opportunity to flick switch B to the ON position. After he completes his mission, he will flick switch A for all subsequent visits. In short, each transmitter's role is to send a signal to the scorekeeper that he has been to the switch room.
3. The scorekeeper's role is to flick off switch B whenever he sees it in the ON position. Each time he flicks off switch B he adds 1 to his score. When he sees switch B is already OFF, he flicks switch A instead and does not add to the score. As soon as he accumulates 22, he reports to the Warden.
Hide Hint Show Hint Hide Answer Show Answer
What Next?
View a Similar Brain Teaser...
If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own.
Solve a Puzzle
Comments
I like it!!! Cool
Interesting logic but I had in mind something that would take less time. Hope the scorekeeper doesn't die before the strategy carries through.
Jun 26, 2004
That was weird. I didn't understand what you were asking though.
that was really hard, and took a little too much time. i liked it though, and i would have never thought of the answer
Hmm...It's okaaaaaaaay, I guess. But yeah, it's basically impossible for anyone to think of the answer to that, and also I didn't know what we had to figure out, so I think you should have made that clearer!
I dont like people who give me headaches...
Ok i liked this 1 but the problem that there was no question...there is no point...the answer may be 15ducj=k and i have the right to say that cuz there is no question make it clearer the next time
This is very good. I liked the way it made my head ache.
Excellent Teaser in my opinion. It's perfectly logical, and it's perfectly solvable, though certainly not very easy.
The question though not stated in the given is implied, so I don't think it to be a big deal that it's missing.
The question though not stated in the given is implied, so I don't think it to be a big deal that it's missing.
OK so I just found a problem with the solution (provided the current statement of the given) For the solution to work the prisoners will have to keep visiting the jail cell even after all of them visited it an equal number of times.
You see nowhere in the problem does it say that the warden will keep pulling prisoners into the switch room indefinitely. Problem states that he will pick them randomly, and that everyone will visit the room as many times as everyone else. Well what if the luck of the draw happens that randomly they will all be picked only once and all 23 will visit the room only once? Then the counter can only do one flip of the switch, and then they will never be freed.
So basically the problem needs an extra statement: “Assume that this exercise continues indefinitely until one of the prisoners speaks out.â€
You see nowhere in the problem does it say that the warden will keep pulling prisoners into the switch room indefinitely. Problem states that he will pick them randomly, and that everyone will visit the room as many times as everyone else. Well what if the luck of the draw happens that randomly they will all be picked only once and all 23 will visit the room only once? Then the counter can only do one flip of the switch, and then they will never be freed.
So basically the problem needs an extra statement: “Assume that this exercise continues indefinitely until one of the prisoners speaks out.â€
It seems to me that the answer is slightly incorrect. In part 3 of the answer, the second ON should read OFF.
Thanks Sakirski, the pre-condition you mentioned is stated in the hint section. I like those 3 teasers you posted too.
Aug 16, 2004
super
Assuming non of the prisoners died in the jail. Then they would stay there 4ever.
coooooooooool
wha...wha...wha?
As a matter of fact or fiction, this scenario's countless improbabilities bequeath indistinct objectives to its foreseen populace. This is neither bad nor good
If the warden picked one random prisoner every day, it would take about 596 days on average.
I wasn't sure what the question was asking - i was trying to work out how the warden would know if they were lying or not...(for some reason i had a nice double blind going on, and the warden didn't know who he was taking out either...)
Jul 23, 2005
its too hard & it takes toooooo long
What exactly are we supposed to find out? What does this teaser ask? I only see plain text with an explanation fallen from the sky.
Where is Scenario B?
Unless I don't understand the problem correctly, I think there is a flaw. For ease let's say that the warden has already decided that he is going to pick each prisoner 5 times. What if the scorekeeper is picked to make the first 5 visits? Who keeps score then?
Sorry, I'm new here. I guess I should have looked at the date of the problem first.
I think this is a nice try... for those of you who say you didn't know what to do then something is wrong with you cuz anyone could figure out that the prisoners should devise a plan to get out... DUH!!!! OBVIOUSLY... now as for the answer... if the scorekeeper counts 1 for every time that he flicks off the switch B that would be incorrect. If 1 prisoner goes before him and flicks B on and then the scorekeeper goes and flicks it off and they alternate like that for 3 turns then the scorekeeper would count 3 when in fact only 1 of his fellow prisoners has been to the room. For this reason the answer is wrong in my mind.
what was the question?
that solution makes a lot of sense...
I have to agree with mercenary007. alternating between the scorekeeper and one other person multiple times would ruin the solution.
As it stands the prisoners are alligator chow.
As it stands the prisoners are alligator chow.
Read the problem again mercenary and cresh. Each transmitter only flips B to on if it's off one time, then only flips A after that, no matter whether they find B off again or not in later visits.
I agree though that it's not totally clear if the warden is guaranteed to keep bring prisoners back or if he will stop after they've all had the same number of turns.
I agree though that it's not totally clear if the warden is guaranteed to keep bring prisoners back or if he will stop after they've all had the same number of turns.
I think THINK that i foud a flaw.
What happened if 2 transmitters go to the room, and neither of them have gone to the room, how does the reciver know that 2 people has gone, not one?Unless someone explaines the tatic, i think the answer is wrong
What happened if 2 transmitters go to the room, and neither of them have gone to the room, how does the reciver know that 2 people has gone, not one?Unless someone explaines the tatic, i think the answer is wrong
O wait, never mind
Jan 07, 2007
question is flawed... you have to assume too much... but i still liked it
i never knew the question
(sigh) well people, its to the alligators. Theres no way; we could have been in there for a hundred billion years. Still, yeah sure, the answer works out, and I was beat by the puzle... ih. I tried to split em into 2's and 4's with 4 possible combinations, and clubbing the warden, nope wasn't gona solve that one. a transmitter... don't feel bad, a transmitter, dude! okay so what if we're in the planning stage, and someone says what if the transmitter dies. hmm...
OW!!! My head hurts how do you come up with this stuff!!! It's so brilliant!!!
Jun 13, 2007
Great teaser, very creative.
I was able to come up with the same solution, However, thought that there would be a more efficient one because this solution means pretty much that it will takes them an extremely long time to get out depending on their luck/probability.
Maybe change the number of prisoners to a smaller number. Then again, it is a jail haha
I was able to come up with the same solution, However, thought that there would be a more efficient one because this solution means pretty much that it will takes them an extremely long time to get out depending on their luck/probability.
Maybe change the number of prisoners to a smaller number. Then again, it is a jail haha
brilliant!!!!! My math teacher gave this to us, but never told us the answer. Thanks!!!!
How do you come up with this stuff? I mean really! Does it just hit you?
Jan 11, 2008
I'm going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back."
and hint B) there are no restrictions to how many times each prisoner can visit the room...
make it impossible for the prisoners to devise a plan that doesnt involve luck.
and hint B) there are no restrictions to how many times each prisoner can visit the room...
make it impossible for the prisoners to devise a plan that doesnt involve luck.
how 'bout flicking switch B on everytime a prisoner goes into the switch room for the first time, and flicking switch A if he/she already got there...then it's everybody's role to count the ons and offs of light B, because if they appoint only one 'counter', just one missed count could lead to dying old in prison...the counter would never reach 23...or is this what the solution suggests?
ow.
head achy achy...
ow.
head achy achy...
Yes it works. Every one could count. This is a better way.
I love this teaser.
And I know it's 3 years later, but what plokolplok suggests doesn't work. If you have more than one person who counts, who turns off switch B? Only one person can turn off switch B, otherwise they could be staying in there a LOT longer than they would with the poster's solution. And if one person turns it off, you can't have other people counting; a counter could come in five times in a row, see the switch ON each time and add 5, even though nobody else came in.
And I know it's 3 years later, but what plokolplok suggests doesn't work. If you have more than one person who counts, who turns off switch B? Only one person can turn off switch B, otherwise they could be staying in there a LOT longer than they would with the poster's solution. And if one person turns it off, you can't have other people counting; a counter could come in five times in a row, see the switch ON each time and add 5, even though nobody else came in.
I LOVE IT!!!!!!!! (little tricky though. Cut that out. not little, but A LOT!) I still love it though.
There is no 100% guaranteed solution, and it is in fact entirely hopeless. It's one thing for the warden to offer them a deadly game where he's the judge who doesn't have to play by the rules. But by giving it an element of randomness that only he controls, he's bluntly announcing that it's a trap to get all the prisoners killed. He won't ever pick anyone. It *looks* solvable and he's actually generous to give them a full day to think about it, but they'll probably come up with a flawed plan or nothing at all. Even if in the latter case they agree to do nothing, so long as they don't collectively realize that it's a trick, someone will inevitably try their luck. The idea of freedom is too tempting. Even suggesting to the sadistic warden that no solution exists still carries the risk of death. This puzzle is really creepy when you think about it.
Why does there not seem to be any logical solution here??? How can you with reasoned analytical deduction solve close to 46 random selections without a way to empirically verify that indeed all have flipped a switch? An electrician knows light switches: there are 4 screws. Electricians set the screw head slot to vertical which indicates 12. The first man sets the screw (top left) to 1 o'clock and men stop at setting 5 and go to bottom screw and do 5 more. 4 screws allow 20 people. When a man comes in and sees all set at 5, he starts over at top left screw. Ergo any man is both the recorder and counter. In this scenario each prisoner must cheat with his fingernail. Subterfuge is a dishonest mans calling. The 23 or 45 or 46 visit or any can be ascertained at any time by any man. All men should know how to tell time. How would any man know when he was 13th . He would simply count.
the funny thing is all this thinking is unnecessary, the answer is simple.
they hold their strategy meeting in the "switch room" and they each flip the switch. they are all free as soon as they all get back to their cells and one of them declares they have all been in the room.
they hold their strategy meeting in the "switch room" and they each flip the switch. they are all free as soon as they all get back to their cells and one of them declares they have all been in the room.
What an amazing and fantastic logic puzzle! I had to ponder this quite a bit to find the solution. The answer is deducible. I enjoyed the comments almost as much as the teaser. There is a lot of misunderstanding of the situation even given the solution! Thanks to the probability god who provided let us know this would take just over 500 visits to the room. I was wondering that.
To post a comment, please create an account and sign in.
Follow Braingle!