23 prisoners and two switches
A prison has 23 prisoners in 23 different cells. The prisoners have no way to communicate with each other in any way from their cells. There is another room, the rec room, that has two switches on the wall (A and B). The switches have on and off positions but they start in an unknown position.
Prisoners are randomly taken to and from the rec room one at a time. They must change the position of only one of the two switches each time they go to the room. At any point a prisoner can yell out, “Every prisoner has been here!” If the prisoner is correct that all of the prisoners have visited the rec room, then they all go free. If they aren’t correct then they are all executed.
Before they start they are given one planning session during which they can discuss a method to win the game. What method can they use to ensure they all go free?
Here are the rules they can use to ensure they will all go free eventually:
The prisoners will choose one ‘leader’ and everybody else will be a follower. If you are a follower:
- If switch A is in the on position, toggle switch B.
- If switch A is off, you have not toggled switch A yet, and you have seen switch on during a previous visit; then toggle switch A. Otherwise toggle switch B.
If you are a leader:
- If switch A is off, turn it on.
- If switch A is on, turn it off. If you did not turn switch A on during their previous visit, increment the count of prisoners.
Once the leader increments the count to 23 they can yell, “Every prisoner has been here!” and all of them will be released.
Your Answer
More puzzles to try-
Car and thief Riddle
Ron’s father’s flying car got stolen and during the trial, he told that his father’s car was stolen by his ...Read More »Does this look like a spiral?
Does this look like a spiral? It’s actually a bunch of concentric circles. Use your mouse to trace one circle ...Read More »Teddy bears never hungry
Why are teddy bears never hungry?Read More »Famous Spy
What body of water was named after a famous spy?Read More »Doing what?
There were five children in a room. John drew a picture, Jacob played video games, Anthony played chess, and Christina ...Read More »How many did you count?
This is a simple one. You just have to count the number of F in the given sentence. Finished Files ...Read More »Born out of water puzzle
I am born out of water And live on land Touch of my mother Brings demise on hand. Who am ...Read More »Find the initial amount
One day when I was walking on the road in New Delhi, a group of boys approached me for donation ...Read More »Weighing Proposition
The sum of a mother, her baby and her dog’s weight is 170 Kg. How much does the baby weigh ...Read More »Unbroken Eggs
A little girl goes to the store and buys one dozen eggs. As she is going home, all but three ...Read More »What is the age of grand father puzzle
A boy asks his father, “what is the age of grand father?“. Father replied “He is x years old in ...Read More »What is my aunt’s share?
When my uncle in Madura died recently, he left i will, instructing his executors to divide his estate oi Rs.1,920,000 ...Read More »Coin Toss investigation puzzle
A dead body is found at the bottom of a multi-storey building. Seeing the position of the body, it is ...Read More »what is he
He has rib bones and back bones. He swallows human beings whole, then spits them out alive. What is he ...Read More »What day is tomorrow?
When the day after tomorrow is yesterday, today will be as far from Wednesday as today was from Wednesday when ...Read More »Key, Door, Lock, Room, Switch on
Key, Door, Lock, Room, Switch on Arrange the words given above in a meaningful sequence. A) 4, 2, 1, 5, ...Read More »Find the number of brother and sister
A family I know has several children. Each boy in this family has as many suters as brothers but each ...Read More »Bus number puzzle
While visiting a small town in the United States, I lost my overcoat in a bus. When I reported the ...Read More »Always True
This is the thing that always tells the truth. This shows off everything that this sees. This comes in all ...Read More »answer if you can
Mary gets in the shower, but surprisingly her hair is not wet when she gets out. How is this possible?Read More »