Four people, four hats and a wall in between. Every silence in this problem says as much as an answer, and following the thread of what each prisoner can or cannot see is the only way to get to the end.

The four prisoners and the wall

Strategist
Pure logic

Riddle statement

Four prisoners—A, B, C, and D—are lined up, in that order. A wall separates C from D, so that no one looks at the other side.

  • A sees B and C.
  • B sees C.
  • C and D do not see any other prisoners.

Exactly four hats are distributed: two black and two white, one per prisoner. They all know that distribution.

They are asked, one by one, if they can deduce the color of their own hat. After a few moments, one of them answers yes.

Who is he, and how do you know?

Show solution

Solution

Answer: speaks B, and deduces its color by logical discard.

  1. If B and C were wearing hats of the same color, A would see it and could immediately deduce that his is the opposite color, since he knows that there are two of each color.
  2. Since A does not speak, B concludes that B and C are wearing hats of different colors.
  3. B sees C's hat, so he knows that his is the opposite.

Therefore, B can state its color with certainty.