Brainfucker

Collection of Highly Logical Puzzles

The Prison

Brainfucker
The Prison cover

Prologue

A hundred prisoners of the worst kind are locked up, serving their sentences in a dark and maze-like prison. One day, the warden offers the prisoners a mysterious game: if they manage to win, they will gain their freedom; if they fail, they will remain locked in their cells forever. The warden allows the prisoners to agree on a strategy before the game starts, then separates them and starts the challenge.

Description

The names of the prisoners are placed in a bowl. At the start of the game, a name is drawn, and the jailer takes that person from his cell to a room with only a lightbulb and a switch. The prisoner can choose to turn the lightbulb on, off, or leave its status unchanged. Upon leaving the room, the inmate is asked if every other inmate has been in the room at least once. He can choose not to answer or to say yes. If he says yes and is right, they all gain freedom. If he’s wrong, they all lose. If he doesn’t answer, the game continues: his name will be put back into the bowl and another name will be drawn.

The Question

What strategy can the prisoners adopt to have mathematical certainty of winning the challenge posed by the warden, ensuring that all inmates have been in the room at least once, before one of them responds?

FAQ

  • For simplicity, at the beginning of the game, the lightbulb is off. It’s possible to solve this riddle even without this information, but it’s much harder.
  • Prisoners cannot communicate with each other during the game.
  • There’s no way to exchange information between prisoners except through the status of the lightbulb (on or off).
  • Prisoners can only see the current state of the lightbulb when they enter the room.
  • There’s no limit to the number of times a prisoner can be called into the room.
  • The lightbulb doesn’t burn out or heat up.

Hints

Solution