trickey one !!!
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
"In the prison 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. I am not telling you their present positions. 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 anyone of you may
declare to me, 'We have all visited the switch room.' and be 100%
"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
What is the strategy they come up with so that they can be free?
Its something along the lines of...
One guy is the counter.
He switches the light off whenever it is on.
Everyone else turns it on ONCE unless it is already on in which case they leave it. (i.e. if they have already come into the room and turned the light on earlier then they dont turn it on again)
Once the counter has turned the light off 23 times he knows everyone has turned it...
Just typed that then re-read the question to realize that's not really the right answer...
Something along those lines...
What do the switches A and B do? Does one turn it off and one turn it on? Do they both turn it off and on? Is there two lights..?
Modify my answer somehow and I imagine it'll work...
may be answer but not
The group of prisoners here will have to choose a leader among
themselves.So barring him there are 22 other persons.The leader will
be the person who will flip the first switch "DOWN".The other 22
members will flip that switch "UP" two times each.So when the leader
counts that he has flipped that switch "DOWN" 44 times, he will tell
the warden that they have all visited the dungeon and be freed.
but few flaws here
1. say the warden decides to send each only once inside the switch box
& the last or the first man is the leader then your solution would not
address this probem.
2.say everyone other than the leader visits the box twice and at last
the leader is sent in to the switches room twice
the same day then his count would still only be zero !
The last one to be conquered will be death !
Every prisoner takes a shoe off and throws it in the corner.
Count the shoes.
Originally Posted by Deadstar
What if their jail sentence (say 5 years) ends before all the prisoners
Originally Posted by bluffmaster.roy.007
have visited at least once? (Cool)