Home > Riddles > The four prisoners and the wall

The four prisoners and the wall

Pure logicLevel 3/5

The Four Prisoners and the Wall belongs to that family of problems in which each sentence changes the available knowledge. The reward comes when you read the dialogue as a series of logical filters and not as loose comments.

Four prisoners, A, B, C and D, are lined up. There is a wall between C and D. - A goes to B and C.

  • B sees C.
  • C and D don't see anyone on the other side of the wall. Four hats are distributed, two black and two white, one for each prisoner. Everyone knows that information. In order, they are asked if they can deduce the color of his hat. After a moment, one of them answers yes. Who can know and how do you deduce it?

Hints

Show hints
  1. A is the one who sees the most; If I could know his color for sure, I would speak first.
  2. If A remains silent, B already knows that A was not seeing two hats of the same color.
  3. B then compares C's color with that silence and deduces his own.

Solution

Show full solution

Answer: speaks B, and deduces its color by logical discard. 1. If B and C were the same color, A would see it and could immediately deduce that his own color is the opposite (because he knows there are 2 blacks and 2 whites).

  1. Since A does not speak, B concludes that B and C do not have the same color.
  2. B does see C's color, so he deduces that his hat is the opposite color. Therefore, B can state its color with certainty.

Related riddles

Keep practicing

If you enjoyed this one, try more pure-logic riddles, explore this theme, browse the full archive, or read the riddle-solving guide.

← Previous: The "look and say" sequence · Next: The plane and the conveyor belt →