Red and Blue hats -- All or Nothing

Question

In a long hallway, 100 prisoners are given red or blue hats, whose color only the other prisoners can see. At a signal given by the warden the prisoners must walk single file through a door and take their places inside a large room. The room is circular and its wall, ceiling and floor are featureless. Nothing is said, nor are any gestures made to prisoners as they enter the room and take their place. When the last prisoner has taken his place the warden inspects the configuration of their hat colors. If the colors form two monotonic groups separable, say, by some straight line, then all the prisoners are freed. If their hat colors instead are intermingled, they are all executed.

Prisoners are allowed to discuss strategy before receiving their hats. What is their fate?

Let's see, what else? Oh ya, they can't just pass their hats around. They're super-glued on their heads. Ouch. And no one has a magic marker to ... uh ... you know, make a line ... or anything like that.

Share this post

Link to post

Share on other sites

1 answer to this question

First prisoner walks in the room. Second prisoner stands to the right him (unless they're not allowed to move again? Then, he stands to the right still, but not too close.) The third prison can then see the colors of the hats of the first two prisoners. If the hats are different colors, the third prisoner stands between the first two prisoners. If the hats are the same color, the third prisoner stands to the right of the second prisoner. So, now the fourth prisoner does the same thing. If the hats are all the same color, he stands to the outside. If the hats are different colors, he stands between the two people who have opposite colored hats that are standing next to each other. Continue in this fashion. This sorts the prisoners into a long line, where all the red hats are together and all the blue hats are together. The monotonic groups are separated by the line between the only two people standing next to each other with opposite colored hats (unless all hats were the same color to begin with.) So, basically this line is between the last person and the 99th person, assuming at least one hat of each color.

Example, in case I explained that poorly. Numbers indicate the entrance of the prisoners