Brain Teasers and Puzzles

Brain teasers, puzzles, riddles, and other challenges

Prison Keys Strategy

A prison warden was feeling capricious and played a game with the prison keys:

  1. Each prisoner is handed a key to another prisoner’s cell.
  2. Each prisoner will know which other prisoner was initially given the key to their cell (but does not know whose key they were handed).
  3. Each day, when all prisoners are out of their cells and no one is watching, each prisoner is allowed to place keys in another prisoner’s cell.
  4. Each night, each prisoner can collect any keys placed in their cell.
  5. The prisoners can summon the warden when they’re sure everyone has their own key – but if they are wrong, they’re immediately executed.
  6. The prisoners can discuss a strategy beforehand but cannot communicate in any way after keys are handed out.

What is the fewest number of days it would take for the prisoners to be sure everyone has their key? What was the strategy to achieve this?

View Solution