## Line of colourful hats

(Given by Stephanie)

Consider “n” people in a line, each person looking at the person in front, except the one in front of the line that cannot see anyone. Each person has a hat that can be RED, GREEN, or BLUE. Furthermore, each person can see the colour of everyone in front of him, but he cannot see the colour of his own hat, nor the colour of the hat of the people in his back.

They then perform the following task. The person in the back says a colour (that must be RED, GREEN or BLUE), then the person in front also says one of these colours, and so on until the person in front. Everyone can hear the people colours.

Before receiving their hats and going into a single line, the group of people can discuss a strategy. The question is:

– What strategy can they use that maximises the number of people saying the colour of their own head (in the worst case)?

**Explore posts in the same categories:**Puzzles You can comment below, or link to this permanent URL from your own site.

September 23, 2009 at 2:25 pm

Let T be the number of people saying the right colour of their hat.

If n = 1 then, assuming worst case, T = 0;

If n = 2 then T = 1 (last guy says the colour of the front guy)

For n >= 3 I can give a strategy with T = n-2. Do you now a better strategy?

September 23, 2009 at 3:18 pm

T = n-2 is a very good result. Actually, the best strategy gives T = n-1 in the worst case. You probably missed a small technical detail, but I cannot imagine what it can be. Just let me know if you want the solution by e-mail.

September 26, 2010 at 10:47 am

hey simpple can u please mail the detail of solutin please to me urgently

September 26, 2010 at 10:49 am

mail id is manish763@gmail.com