What am I missing? Team leader comes in finds 1 switch up and pulls it down. Prisioner A comes in and switches it up. Leader comes in switches it down. Prisoner A switches up. This continues for 44 trips with only these two entering the room. Like I said, what am I missing? Thanks, Bob
there are 2 switches. THey organize a method using one switch as the indicator. if the indicator is down or they have flipped it down, they mess with the other, if they have not flipped it down and it is up, they flip it down, the leader is the only one allowed to flip the indicator up, 22 times (HE KNOWS HE HAS BEEN IN THERE)
The warden says "Given enough time, everyone will eventually visit the switch room the same number of times as everyone else."
Now what happens if the warden takes each prisoner just once to the switches, and stops after 23 times?? The warden would still have kept his word(every prisoner would have visited the same number of times(once,in this case) as the others), but the prisoners will never be freed.
Maybe it's because it's 1am, but there's absolutely no conceivable reason that they would each flip the first switch up twice... If they only do it once, and spend all subsequent times playing with switch two, then the leader only has to count 23 flips down (22 for the prisoners, and a 23rd just incase it was up to begin with)...
That's simple. If the warden has stopped, then they have all been to the room the same number of times. As long as one prisoner knows he has been to the room, he knows everyone else has as well. He can then say 'we've all been.'
WHY TWICE:
If it starts down and each prisoner (except the leader) flips it up only once, it’ll only ever be flipped up 22 times. The leader will be forever waiting to flip it down for the 23rd time but will never get the chance.
IF THE WARDEN STOPS:
no one would ever know. They’re in isolated cells and might just think they’re not being picked for a while. The warden’s prisoner choice is random in sequence and whenever he feels so inclined...Why would the warden just keep taking prisoners in 44 or so times each??
man alright so i came up with a different method and i dont see any loopholes in my thinking: basically the switches only have 4 different positions. Written as Switch1 Switch 2: U U, U D, D U, D D. i labeled the first two combinations as the position you want to put the switches at if you have been to the room before. And i labeled the last 2 combos as the position you want to put the switches at if you havent been to the room. So basically everyone keep a count based on what position you see the switches in when you enter the room(+1 if UU or UD and +0 if DU and DD) and then follow the rules from there. So when one prisoner reaches 24 he knows that everyone has been in there. it may not be the most efficient method, but i still think it works
Assuming that I understood your UU/UD/DU/DD method, I don't think it does work. I'm sure there may be a case where it does, but here's one that falls over: prisoner 1 enters for the first time; a couple of others enter, and then prisoner 1 is brought back 23 times in a row. If I understood your method, this causes prisoner 1 to declare too early...
Slight twist... many more flips for leader, only one flip for ordinary prisoners
I didn't think of allowing each ordinary prisoner to flip the switch up twice. So I came up with this methodology instead, which uses some randomness. I believe it's less efficient but should still converge with probability 1.
Ordinary Prisoner algorithm: You need to remember whether you have ever seen switch 1 up and whether you have ever flipped switch 1 up yourself. Then: If switch 1 is down AND you have seen it up in the past AND you have not previously flipped it up yourself, flip it up. Otherwise, flip switch 2.
Leader algorithm: The first time you enter, flip switch 1 up if it is not already up. So when you leave for the first time, you know that switch 1 is up and that no one else has flipped switch 1 yet. Set your counters to zero at this point. Thereafter, when you enter, flip a coin to decide which switch to flip. Keep track of the number of total times you have flipped switch 1 down minus the number of total times you have flipped switch 1 up (not counting the initial flip up if the switch started in the down position). When this counter reaches 23, announce that everyone has entered the switch room.
I hope this is clear. The reason for requiring that the ordinary prisoners must have seen the switch up in the past is to allow the leader to get over the uncertainty of whether to count to 22 or 23. This way, since no one is allowed to move it from an initial down position except the leader, the leader effectively knows that it started in the up position.
Of course this also means that the leader has to randomly flip the switch up in the future, wasting time just in case there are prisoners who haven't yet seen the switch up.
(Actually, you can make the leader algorithm slightly more efficient by quitting when your counter is at 22 and switch 1 is in the up position, or equivalently always pulling switch 1 down in this counter=22 situation, rather than randomizing.)
When you start, the switches will be UU DD DU or UD.
Beforehand:Tell everyone to make switches UU DU or UD. Tell them to enter DD only if they have been in the room twice. the person after you will asume its their first time in or someone else has been in the room twice. In either senario, you will change it back to UU DU or UD.
If you see switches DD and its your first time entering the room this means you are the first person to enter the room or someone has entered twice or more. After entering twice put DD to let the next person know. If you see DD three times it means everyone has entered at least twice.
In the meeting, the prisoners assigned themselves numbers from 1 to 23. They decide they will make the right/bottom switch as the counter. They also decide to change the 'counter' switch only when they the enter the switch room the no. of times same as their assigned number. i.e prisoner 07 will change the state of the 'counter ' switch only when he enters the room 'seventh' time, at other times only the other swictch will be toggled.
They decide that everyone will keep conting the 'conter' switch flips whenever they enter the switch room.
Now, depending on which prisoner visits the room first and no. of times, when the prisoner no. 23 enters the room 23rd times and all other also completes the 23rd/24th time. one of the prisoner will count 23 flips for the 'counter switch' and BINGO !!!!!!!!!!!
However, you're assuming that someone is counting every flip.
Imagine this scenario:
Counter Switch is in position A (can be up or down) to begin with.
P1 (prisoner #1) flips counter switch (CS) to B when he enters room 1st time. P1 counts 1.
P2 flips CS back to A when he enters room 2nd time. P2 counts 1.
P3 flips CS back to B when he enters for 3rd time. P3 counts 1.
If P1 now enters the room again, remember he has not been in room between when he flipped CS and when P3 flipped the CS. CS is in position B which is how P1 left it. He will still count only 1!!!
It's hard (near impossible) to have someone actually count to 23 this way.
Alternative solution:
Have the prisoners agree to only flip CS if it's their first time, 5th, 10th... time (continue in intervals of 5) in the room. Any other time they can only flip the other switch. The first person to count 23 changes in position of the CS (including his own original flip) can safely say that everyone has been in the room.
This of course based on assumption that in the long run, average times in the room is same for everyone (as per puzzle description).
I beleive that since they cannot know the initial position, and cannot know who has went first or if they are first, AND only know that eventually they will all have gone the same number of times, that only 1 prisoner can free himself and even then, after everyone else dies of old age will probably take a while to prove even with just 1 guy.
If the warden truly selects prisoners at random, then no matter how much time transpires (how many selections are made), there can be no guarantee that everyone will visit the switch room the same number of times. Maybe this matters, maybe it doesn't but it throws the possibility of a solution into doubt.
The team nominates a leader. The group agrees upon the following rules
The leader is the only person who will announce that everyone has visited the switch room. All the prisoners (except for the leader) will flip the first switch up at their very first opportunity, and again on the second opportunity. If the first switch is already up, or they have already flipped the first switch up two times, they will then flip the second switch. Only the leader may flip the first switch down, if the first switch is already down, then the leader will flip the second switch. The leader remembers how many times he has flipped the first switch down. Once the leader has flipped the first switch down 44 times, he announces that all have visited the room.
It does not matter how many times a prisoner has visited the room, in which order the prisoners were sent or even if the first switch was initially up. Once the leader has flipped the switch down 44 times then the leader knows everyone has visited the room. If the switch was initially down, then all 22 prisoners will flip the switch up twice. If the switch was initially up, then there will be one prisoner who only flips the switch up once and the rest will flip it up twice.
The prisoners can not be certain that all have visited the room after the leader flips the switch down 23 times, as the first 12 prisoners plus the leader might be taken to the room 24 times before anyone else is allowed into the room. Because the initial state of the switch might be up, the prisoners must flip the first switch up twice. If they decide to flip it up only once, the leader will not konw if he should count to 22 or 23.
In the example of three prisoners, the leader must flip the first switch down three times to be sure all prisoners have visited the room, twice for the two other prisoners and once more in case the switch was initially up
o.k the solution show CAN work but is possible not to o.k say the leader and prisoner.b visit 1 after another with no one else visiting the switch room no matter how many times the leader should say after he anounces cause he has visited the room like 100 times and everyone dies of old age spirits crushed cause they never got out the leader and prisoner.b just keep fliping switch 2 know if the warden had an i.q higher than 100 he would do this and if he is as twisted as the story says he should have some fun killing them all if the leader or prisoner.b get bored or wathching the others suffer from lack of hope and say they have all visited so they die or the warden will enjoy watching them suffer muhwahahahahahahahahahahahahahahahahahahaha
by the way branden you are beyond dumb if you think people will belive you buy coping the answer and pasting itas a comment to try and look smart :p
and the answer:the leader is the only one flips the swich 1 down everyone else flips it up on there first trip then on there next trip wether the 2nd switch was up or down they flip it. once the leader flips switch 1 down 24 times(1 extra incase it was initailly up)he says they have all visited
the problem with the answer: the prisoners may not know which one is which because they have never seen it before and presuming at least one of them is dumb(cause they got in prison to start with)they all die a horrible death.and ll the answers stated here would take to long and ethier one cocky prisoner would get bored and say we have all visited or the leader dies (either of old age or unknown causes)no one knows and the rest die
o.k i should really stop writing know o.k thanks for reading :)
Ok here is my answer,
First there is no time limit to this question. Ok everyone has to agree on a number, i picked 10 cause i like 10. So all the prisoners agree that they will only flick the swith #1 their first 9 times in the room. On there 10th time they will flick swith #2. They will only flick switch numbe 2 their 10th trip. After any prisoner sees switch #2 move 3 times they can pretty confident that all prisoners have visited the switch room.
I think some of you might be forgetting what the puzzle is saying.
1) You can't rely on a "leader" entering the room a certain amount of times. Some of you are saying that he'll count "23 times" or whatever, and that might now work... the warden will bring the prisoners into the room an equal amount of times... what if he brings them in three times? Then those theories don't work.
2) Another issue is that some of you are saying to put the switches to a certain place when they've visited their second time. Well, that sounds great but you can only move one switch! What if both switches are up and it's your second time? You couldn't move them both down since you can only move one switch at a time.
3) And finally, if I'm using the correct logic, there isn't a way to figure out if anyone else has been there if say the prisoners only entered the room once. Technically, that could happen. So maybe this is one of those problems where fairness comes into play and since you can't figure it out if each prisoner only visits once, we can safely assume that each prisoner must visit the room twice or more?
I also forgot to mention that there doesn't seem to be any way to solve the problem if each prisoner takes their turns in a row, without anyone else visiting the room in between. For example, if the warden takes each prisoner in three times, but goes 1st guy three times, 2nd guy three times, and so on, the prisoners would never be able to figure out if anyone else had been in there considering they don't know how the switches look at first.
So again, can we safely assume that each prisoner has to go more than once, and that the warden will give them a chance to notice that someone else has been in there?
Now what happens if the warden takes each prisoner just once to the switches, and stops after 23 times?? The warden would still have kept his word(every prisoner would have visited the same number of times(once,in this case) as the others), but the prisoners will never be freed.
Fools _>
If it starts down and each prisoner (except the leader) flips it up only once, it’ll only ever be flipped up 22 times. The leader will be forever waiting to flip it down for the 23rd time but will never get the chance.
IF THE WARDEN STOPS:
no one would ever know. They’re in isolated cells and might just think they’re not being picked for a while. The warden’s prisoner choice is random in sequence and whenever he feels so inclined...Why would the warden just keep taking prisoners in 44 or so times each??
Ordinary Prisoner algorithm: You need to remember whether you have ever seen switch 1 up and whether you have ever flipped switch 1 up yourself. Then: If switch 1 is down AND you have seen it up in the past AND you have not previously flipped it up yourself, flip it up. Otherwise, flip switch 2.
Leader algorithm: The first time you enter, flip switch 1 up if it is not already up. So when you leave for the first time, you know that switch 1 is up and that no one else has flipped switch 1 yet. Set your counters to zero at this point. Thereafter, when you enter, flip a coin to decide which switch to flip. Keep track of the number of total times you have flipped switch 1 down minus the number of total times you have flipped switch 1 up (not counting the initial flip up if the switch started in the down position). When this counter reaches 23, announce that everyone has entered the switch room.
I hope this is clear. The reason for requiring that the ordinary prisoners must have seen the switch up in the past is to allow the leader to get over the uncertainty of whether to count to 22 or 23. This way, since no one is allowed to move it from an initial down position except the leader, the leader effectively knows that it started in the up position.
Of course this also means that the leader has to randomly flip the switch up in the future, wasting time just in case there are prisoners who haven't yet seen the switch up.
(Actually, you can make the leader algorithm slightly more efficient by quitting when your counter is at 22 and switch 1 is in the up position, or equivalently always pulling switch 1 down in this counter=22 situation, rather than randomizing.)
Beforehand:Tell everyone to make switches UU DU or UD. Tell them to enter DD only if they have been in the room twice. the person after you will asume its their first time in or someone else has been in the room twice. In either senario, you will change it back to UU DU or UD.
If you see switches DD and its your first time entering the room this means you are the first person to enter the room or someone has entered twice or more. After entering twice put DD to let the next person know. If you see DD three times it means everyone has entered at least twice.
Than its safe to say victory
They decide that everyone will keep conting the 'conter' switch flips whenever they enter the switch room.
Now, depending on which prisoner visits the room first and no. of times, when the prisoner no. 23 enters the room 23rd times and all other also completes the 23rd/24th time. one of the prisoner will count 23 flips for the 'counter switch' and BINGO !!!!!!!!!!!
However, you're assuming that someone is counting every flip.
Imagine this scenario:
Counter Switch is in position A (can be up or down) to begin with.
P1 (prisoner #1) flips counter switch (CS) to B when he enters room 1st time. P1 counts 1.
P2 flips CS back to A when he enters room 2nd time. P2 counts 1.
P3 flips CS back to B when he enters for 3rd time. P3 counts 1.
If P1 now enters the room again, remember he has not been in room between when he flipped CS and when P3 flipped the CS. CS is in position B which is how P1 left it. He will still count only 1!!!
It's hard (near impossible) to have someone actually count to 23 this way.
Alternative solution:
Have the prisoners agree to only flip CS if it's their first time, 5th, 10th... time (continue in intervals of 5) in the room. Any other time they can only flip the other switch. The first person to count 23 changes in position of the CS (including his own original flip) can safely say that everyone has been in the room.
This of course based on assumption that in the long run, average times in the room is same for everyone (as per puzzle description).
The leader is the only person who will announce that everyone has visited the switch room. All the prisoners (except for the leader) will flip the first switch up at their very first opportunity, and again on the second opportunity. If the first switch is already up, or they have already flipped the first switch up two times, they will then flip the second switch. Only the leader may flip the first switch down, if the first switch is already down, then the leader will flip the second switch. The leader remembers how many times he has flipped the first switch down. Once the leader has flipped the first switch down 44 times, he announces that all have visited the room.
It does not matter how many times a prisoner has visited the room, in which order the prisoners were sent or even if the first switch was initially up. Once the leader has flipped the switch down 44 times then the leader knows everyone has visited the room. If the switch was initially down, then all 22 prisoners will flip the switch up twice. If the switch was initially up, then there will be one prisoner who only flips the switch up once and the rest will flip it up twice.
The prisoners can not be certain that all have visited the room after the leader flips the switch down 23 times, as the first 12 prisoners plus the leader might be taken to the room 24 times before anyone else is allowed into the room. Because the initial state of the switch might be up, the prisoners must flip the first switch up twice. If they decide to flip it up only once, the leader will not konw if he should count to 22 or 23.
In the example of three prisoners, the leader must flip the first switch down three times to be sure all prisoners have visited the room, twice for the two other prisoners and once more in case the switch was initially up
by the way branden you are beyond dumb if you think people will belive you buy coping the answer and pasting itas a comment to try and look smart :p
and the answer:the leader is the only one flips the swich 1 down everyone else flips it up on there first trip then on there next trip wether the 2nd switch was up or down they flip it. once the leader flips switch 1 down 24 times(1 extra incase it was initailly up)he says they have all visited
the problem with the answer: the prisoners may not know which one is which because they have never seen it before and presuming at least one of them is dumb(cause they got in prison to start with)they all die a horrible death.and ll the answers stated here would take to long and ethier one cocky prisoner would get bored and say we have all visited or the leader dies (either of old age or unknown causes)no one knows and the rest die
o.k i should really stop writing know o.k thanks for reading :)
First there is no time limit to this question. Ok everyone has to agree on a number, i picked 10 cause i like 10. So all the prisoners agree that they will only flick the swith #1 their first 9 times in the room. On there 10th time they will flick swith #2. They will only flick switch numbe 2 their 10th trip. After any prisoner sees switch #2 move 3 times they can pretty confident that all prisoners have visited the switch room.
1) You can't rely on a "leader" entering the room a certain amount of times. Some of you are saying that he'll count "23 times" or whatever, and that might now work... the warden will bring the prisoners into the room an equal amount of times... what if he brings them in three times? Then those theories don't work.
2) Another issue is that some of you are saying to put the switches to a certain place when they've visited their second time. Well, that sounds great but you can only move one switch! What if both switches are up and it's your second time? You couldn't move them both down since you can only move one switch at a time.
3) And finally, if I'm using the correct logic, there isn't a way to figure out if anyone else has been there if say the prisoners only entered the room once. Technically, that could happen. So maybe this is one of those problems where fairness comes into play and since you can't figure it out if each prisoner only visits once, we can safely assume that each prisoner must visit the room twice or more?
Any thoughts?
So again, can we safely assume that each prisoner has to go more than once, and that the warden will give them a chance to notice that someone else has been in there?
Am I using the correct logic?