show/hide this revision's text 2 added 123 characters in body

There are some dwarves approaching to a bridge. They have to cross it to come back home from the cave where they work. Unfortunately, a dragon has just decided to reside under that bridge, and it's hungry. But it's also bored, so it doesn't want just to eat the dwarves, but proposes them a game: it will put on each of them one hat, either black or white, in no specific proportion (for example, it can happen all hats to be white). Of course they can't see their own hat, but they can see the others'. They will be then queueing at the beginning of the bridge, and each of them can just say one word. If this word matches with the colour of the hat that dwarf is wearing, then he's allowed to pass and to come back home. Otherwise, he'll be eaten by the dragon. Of course, they can decide for a strategy before the game begins.

What's the best strategy, and how many dwarves die on average?

PS

EDIT: sorry if cross-posting(deleted the previous PS, modified into this one) PS: Since I didn't read solve all the answers...previous puzzles posted, I would be glad if someone could point me at equivalent puzzles, if any!

show/hide this revision's text 1 [made Community Wiki]

There are some dwarves approaching to a bridge. They have to cross it to come back home from the cave where they work. Unfortunately, a dragon has just decided to reside under that bridge, and it's hungry. But it's also bored, so it doesn't want just to eat the dwarves, but proposes them a game: it will put on each of them one hat, either black or white, in no specific proportion (for example, it can happen all hats to be white). Of course they can't see their own hat, but they can see the others'. They will be then queueing at the beginning of the bridge, and each of them can just say one word. If this word matches with the colour of the hat that dwarf is wearing, then he's allowed to pass and to come back home. Otherwise, he'll be eaten by the dragon. Of course, they can decide for a strategy before the game begins.

What's the best strategy, and how many dwarves die on average?

PS: sorry if cross-posting, I didn't read all the answers...