Saturday, July 02, 2005

Logical problem

The problem:

  1. There is an arbitrary number of gnomes.
  2. Each gnome wears a green, orange or red hat, and the distribution of colors is random.
  3. The gnomes will eventually line up.
  4. Before they line up they can discuss strategy, e.g., "Odd number gnomes will say the color of the hat of the gnome in front of him."
  5. While in line, each gnome can only see in front of him and cannot see the color of his own hat.
  6. Each gnome can only say "green," "orange" or "red" and the gnomes cannot convey any additional information by the way they say the color, e.g., by saying it loudly or by inflecting differently depending on the color of the hats they see.
  7. Once in line, the first gnome - who can see all other gnomes - says the color of his hat. The second gnome then does the same. And so forth.
  8. If a gnome says a color different from the color of his hat he dies. Otherwise, he lives.

HINTS

  1. This is a a problem of how best to convey information. Come up with a way for a group of gnomes or a gnome to convey information about the hats it sees to the other gnomes.
  2. The percentage of gnomes' lives that the optimal solution guarantees approaches 100% as the number of gnomes approaches infinity. There is more than one way to do this.

In a week or a few days, I'll post the solution and, for your viewing pleasure, my less elegant and optimal but similarly effective solution.

0 Comments:

Post a Comment

<< Home