When the number of colors increases, the problem stops being a simple game of immediate deduction and begins to require a much finer form of coordination. His interest is in how a single intervention can order what comes next.
The executioner and the hats (3 colors)
Riddle statement
There are 10 people in a row, numbered 1 to 10, where 10 is behind everyone.
Each hat can be red, blue or green. Person 10 speaks first and sees the hats of the 9 people in front of him; the 9 sees 8; and so on. No one sees their own hat or those behind them.
Take turns, each person must say a single word out loud: “red”, “blue” or “green”. They cannot add anything else.
If someone guesses the color of his hat correctly, he survives; If you fail, you die. Before starting they can agree on a strategy.
How many lives can they guarantee at least?
Show solution
Solution
Answer: 9** saved are guaranteed.
Coding: red = 0, blue = 1, green = 2 (module 3).
Let $x_1,\dots,x_{10}$ be the real value of each hat.
Person 10, who sees $x_1,\dots,x_9$, says:
It can fail, but leaves the equation fixed:
Person 9 knows $y_{10}$, sees $x_1,\dots,x_8$ and clears $x_9$:
He says it out loud and gets it right. Person 8 already knows $x_9$—has heard it—sees $x_1,\dots,x_7$ and solves for $x_8$ in the same way. So on until person 1.
All are determined uniquely, except the first to speak, whose answer encodes the sum but cannot know his own hat.
Guarantee: 9 saved always. Person 10 only has a probability of $1/3$ of being correct.