📜 ⬆️ ⬇️

Save the gnomes from the terrible, but fair Troll

There are a lot of problems about poor gnomes, but I puffed on this one the longest, and even thought that I proved that it is not solvable - and it is solvable.

So, the standard story:

A cunning but fair Troll has caught many dwarfs (a lot means no one knows exactly how much, maybe a dozen, or maybe a lot more). I planted them in a dark cave, where nothing is visible, and put each gnome on a cap, red or blue, in a random order. And he said that tomorrow at dawn, the dwarfs would be taken out one at a time and put in a single file, so that the last one will see all the heads of the dwarfs in front of him, the next will follow all and so on, and the very first will admire the dawn, but none of his fellows will see .
Then, starting from the very last, the Troll will ask each dwarf what color the cap is on his head. Those who correctly guess the color of their cap - Troll will let go, and those who do not guess - Troll will eat. Each gnome can only answer "blue" or "red", nothing more can be said and done.

Do gnomes have time until the morning to come up with a strategy with the least losses, help the gnomes.

')

Source: https://habr.com/ru/post/139455/


All Articles