Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 951 Bytes

File metadata and controls

20 lines (15 loc) · 951 Bytes

Grouped by color

Source Difficulty

Imagine that there is a group of dwarves that live in a cave. All dwarves wear hats. Some dwarves wear red hats, others wear blue hats. No dwarf knows the color of his own hat, and in the cave, it is also too dark to see any other dwarf's hat color.

The dwarves are faced with the following task. They have to exit the cave one by one and have to order themselves into two groups, according to their hat color. Outside of the cave they see the color of all other hats, but not theirs. After the process has started, they are not allowed to communicate in any way. They have to pick a place outside immediately and are not allowed to move afterwards.

How are the dwarves able to order themselves into groups?

See solution