This is a problem of collective discipline under a severe restriction: one word per person and almost no second chances. Its beauty appears when the prisoners stop trying to save themselves individually and begin to act as a single system.

The hundred prisoners with hats

Strategist
Master plays

Riddle statement

One hundred prisoners stand in a line. Each is given either a red or a blue hat at random.

Each prisoner can see every hat in front of them, but not their own hat or any hat behind them. Starting with the prisoner at the back of the line and moving forward, each person must say exactly one word aloud: “red” or “blue.” Nothing else may be said.

A prisoner survives if the word matches the color of their own hat; otherwise, they die.

Beforehand, the prisoners may agree on a strategy.

What is the best possible strategy, and how many prisoners can it guarantee will survive?