Can you solve the prisoner's riddle? — Veritasium
Quick Overview
Key Takeaway: Yes, the prisoners can solve the riddle and guarantee their freedom by implementing a specific counting strategy involving a light switch.
Key Points: One prisoner is designated as the "counter" responsible for declaring when all prisoners have visited the room. Other prisoners, if they enter the room and find the light off, turn it on only once. The counter turns the light off each time they enter and find it on, incrementing their internal count. Once the counter has turned the light off 99 times (meaning all other 99 prisoners have turned it on at least once), they confidently declare that everyone has visited.
Summary
The prisoner's riddle, involving 100 prisoners and a light switch, is solvable through a clever strategy. One prisoner is designated as the "counter." Their primary role is to keep a tally of how many unique prisoners have entered the room. The other 99 prisoners are instructed to turn the light switch on if they enter the room and find it off, but only to do this once. If they enter and the light is already on, they do nothing. The counter, upon entering, will turn the light off if it's on, and increment their internal count. Once this counter's tally reaches 99, it signifies that each of the other 99 prisoners has, at some point, entered the room and turned the light on. At this precise moment, the counter can confidently declare that all 100 prisoners (themselves included) have visited, securing their freedom. This method guarantees a successful outcome, albeit potentially requiring a significant number of entries into the room before the condition is met.
Key Points: The solution relies on a designated "counter" prisoner and a shared communication mechanism (the light switch). Each of the 99 non-counter prisoners will turn the light on exactly once if they find it off. The counter's role is to turn the light off whenever it's on and increment a personal tally. The counter declares success when their tally reaches 99, ensuring all other prisoners have visited. This strategy guarantees success, though it might take a long time for all prisoners to visit and for the counter to reach 99. The random order of entry is crucial as it ensures eventually all prisoners will enter and contribute to the count.