you are trapped in a room with a bunch of people and informed of an evil fate that you are all about to share. Everyone is to be lined up, and a red or blue hat to be put on each head. There will be no way of seeing your own hat, or the hat of anyone behind you in line. At this point a vile man will come in and start at the back of the line, asking "what color hat are you wearing?" If you answer this question correctly you will be set free... if not you will be shot in the head. You may not speak out of order, or apply any unusual inflection of your simple answer of either "red" or "blue." This dude is really mean. On the bright side, you have a few minutes to formulate a plan with everyone else before you are lined up. How many lives can you save?
Originally posted by PosthumousThere is a collective course of action that will, if executed properly, save all but one person for certain. The one excepted person would be the one at the back of the line who is questioned first. His chances of survival are basically 50/50.
you are trapped in a room with a bunch of people and informed of an evil fate that you are all about to share. Everyone is to be lined up, and a red or blue hat to be put on each head. There will be no way of seeing your own hat, or the hat of anyone behind you in line. At this point a vile man will come in and start at the back of the line, asking "wha formulate a plan with everyone else before you are lined up. How many lives can you save?
Originally posted by LemonJelloYep. If they think binary and use parity, the guy in back will say \"red\" if there are an odd number of red hats [odd parity] in front of him, and \"blue\" if there are an even number [or 0] red hats [even parity] in front of him. The 2nd guy deduces his hat color by looking at the hats in front of him. If the parity of hats he sees matches the parity called out by the back guy, his hat must be blue. If it does not match, it must be red.
There is a collective course of action that will, if executed properly, save all but one person for certain. The one excepted person would be the one at the back of the line who is questioned first. His chances of survival are basically 50/50.
From then on, each guy one place further front knows both the total parity and every hat color but his own [and maybe the back guy\'s, but that doesn\'t matter], and deduces his own hat color in the same fashion. As long as the line isn\'t too long, everyone should be able to remember what colors have been called out. [There is a way around the difficulty, however...]
Originally posted by PosthumousIf everyother person says the color of the persons hat in front of them at least half will be saved.
you are trapped in a room with a bunch of people and informed of an evil fate that you are all about to share. Everyone is to be lined up, and a red or blue hat to be put on each head. There will be no way of seeing your own hat, or the hat of anyone behind you in line. At this point a vile man will come in and start at the back of the line, asking "wha ...[text shortened]... formulate a plan with everyone else before you are lined up. How many lives can you save?
Originally posted by ArachnarchistThat could require almost half of the people in line to knowingly give the wrong answer and forfeit their own life to save the guy in front of them. Better hope your fellow inmates are altruistic!
If everyother person says the color of the persons hat in front of them at least half will be saved.