There are 20 Dwarfs in a Mine. A Dwarf is wearing a red or a blue helmet but they don't know what color they are wearing. At 17:00 the dwarfs are coming out of the Mine and now they have to stay always next to each other with the same helmet colors like: The red Dwarfs next to each other and the blue dwarfs next to each others.
The Problem is, that they can't speak together and they also can't point somewhere. So every dwarf has to decide on his own where he is going to stay.
How is it possible that they made two correct groups out of blue helmet dwarfs and red helmet dwarfs?
Some more Rules: The dwarfs are not coming out of the mine together this means that the first dwarf is not seeing any other dwarf he will stay at any point he want to then the second dwarf is only seeing the helmet of the first dwarf and so on.
Which means that the last dwarf is able to see if there are two correct groups or not because he sees all the colors of the other dwarf helmets.
The Dwarfs are not able to look in a mirror to see there color and they can't take there helmet off to see it.
I think with this inputs you can find a strategy to solve this problem