# Can you solve the prisoner's riddle?

Channel: Veritasium
Source: https://www.youtube.com/watch?v=DCiPrr-dQyw
Recap page: https://rapidrecap.app/video/DCiPrr-dQyw
Generated: 2025-07-07T05:08:17.001+00:00

---
## 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.

**Context:** The riddle involves 100 prisoners, a single room with a light switch, and a warden who sends prisoners into the room one by one in random order. The goal is for one prisoner to declare that all 100 prisoners have visited the room, without knowing who has visited or how many times each has entered. A wrong guess means execution for all.

## Detailed Analysis

The "prisoner's riddle" is a classic logic puzzle that demonstrates how a group can achieve a shared goal with limited communication. The solution involves a pre-agreed strategy. One prisoner is chosen as the "counter." Their sole responsibility is to track how many unique prisoners have visited the room. The other 99 prisoners are given a simple rule: if they enter the room and the light is off, they turn it on, but they must only do this once in total. If they enter and the light is already on, they do nothing. The counter, upon entering the room, will always turn the light off if it's on, and for each time they turn it off, they increment their internal count. This ensures that each "on" state of the light, when turned off by the counter, represents one unique non-counter prisoner's single contribution. Once the counter's tally reaches 99, it means all 99 other prisoners have successfully turned the light on at least once. At this precise moment, the counter can confidently declare that all 100 prisoners (themselves included) have visited the room, thus solving the riddle and securing their freedom. This method is foolproof, relying on the random nature of prisoner selection to eventually ensure everyone gets a chance to enter and contribute to the count.

**Key Moments:**
- **00:15**: Introduction of the riddle's setup: 100 prisoners, light switch, random entry.
  ![Screenshot at 00:15](https://ss.rapidrecap.app/screens/DCiPrr-dQyw/00-00-15.png)
- **01:00**: Explanation of the designated "counter" prisoner's role.
  ![Screenshot at 01:00](https://ss.rapidrecap.app/screens/DCiPrr-dQyw/00-01-00.png)
- **01:45**: Description of the non-counter prisoners' rule: turn on light once.
  ![Screenshot at 01:45](https://ss.rapidrecap.app/screens/DCiPrr-dQyw/00-01-45.png)
- **02:30**: Demonstration of the counter decrementing the light and incrementing their count.
  ![Screenshot at 02:30](https://ss.rapidrecap.app/screens/DCiPrr-dQyw/00-02-30.png)
- **03:15**: The moment the counter reaches 99 and declares success.
  ![Screenshot at 03:15](https://ss.rapidrecap.app/screens/DCiPrr-dQyw/00-03-15.png)

**Insights:**
- The light switch acts as a crucial, albeit limited, one-way communication channel from the 99 prisoners to the counter.
- The "once only" rule for non-counter prisoners prevents double-counting and ensures each increment represents a unique visit.
- The counter's role is critical for aggregating information and making the final, informed decision.
- The solution guarantees success, demonstrating the power of pre-agreed protocols in constrained environments.
- The time taken to solve the riddle can be very long, depending on the randomness of prisoner selection, but success is inevitable.

**Action Items:**
- Designate one prisoner as the "counter" before the process begins.
- Instruct the 99 non-counter prisoners to turn the light on if it's off, but only once per prisoner.
- Instruct the counter to turn the light off if it's on, and increment their count.
- The counter must declare all prisoners have visited only when their count reaches 99.
