Problem bank

Problem 254 of 333MediumBrainteaserP254

A line of hats in three colours

  1. 100 prisoners stand in a line, all facing forward. Each wears a red, green or blue hat, assigned in any way the warden likes. Each prisoner sees every hat in front of him, but not his own or any behind him. Starting from the back of the line, each prisoner in turn says one of the three colours aloud, and everyone hears every answer. A prisoner who names the colour of his own hat is freed. The prisoners may agree on a strategy beforehand. How many can they guarantee to free?