# Sorting kids by hat colours [duplicate]

I have taken a group of students on a school trip. I want to organise them into two groups and so I have given each one a coloured hat. Some hats are red, while others are blue. Each child can see everyone else’s hats, but not their own.

I am feeling obtuse, so I have asked the students to get themselves into two groups based on the colours of their hats, with all the red hats together and all the blue hats together. But! I have told them they are not allowed to talk or communicate in any way.

What strategy should they use to form the two groups?

I think this is a classic (and probably a duplicate):

Take any two of the students and line them up side by side. After this, the remaining students, one by one, insert themselves at the point where two different hats are side by side; if no such point exists, they add themselves to either side of the line.

To separate the two groups cleanly

one of the students on either far end reinserts themself exactly the same way as before, and everyone that is standing on the side this student came from (including this last insertion) forms one group; the others form the second group.

If you see an even number of red hats, you're in group A, otherwise you're in group B.

• How would this work for them to categorise themselves in practice, given that they're not allowed to talk or communicate with each other? Aug 17 '21 at 0:26
• @Randal'Thor: Walk to the left side of the room if you're in group A, otherwise to the right side of the room. Aug 17 '21 at 11:04
• And how do they communicate that to each other? Aug 17 '21 at 11:44
• @Randal'Thor They don't need to communicate anything. You should probably ask OP to specify how the groups should be represented, such that it doesn't result in any communication. I suppose they could raise their left or right hand, or move to the left or right sides of the room while having their eyes closed. Performing several steps and then letting the students react to what they're seeing, as in the other answer, should not be allowed since they can communicate information to each other that way. Aug 17 '21 at 12:21
• They never mentioned that there is an even number of kids in the class, or that the groups are equal. Aug 17 '21 at 13:43