7 prisoners stand in a line such that they can only see the prisoners in front of them. Each prisoner randomly gets either a great haircut or bad haircut (without them knowing which). Starting from the back of the line, each prisoner must
either
guess her own hair situation or pass.
In order to win, at least one prisoner must guess correctly, and no prisoners can guess incorrectly .
They can strategize in advance. What is the optimal strategy? How likely is it to work?
99%75%-90% 90%-99%
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Strategy:
For the first person to be asked: If there are 1 or more people with a bad haircut in front of him, pass. If there are 0 people in front of him with a bad haircut, say that he himself has a good haircut.
The second person to be asked: If the person before him says that he has a good haircut, pass. If the person before him says pass, and there are 0 people with a bad haircut in front of him, say that he has a good haircut. If the person before him says pass, and there are 1 or more people in front of him with a bad haircut, say pass.
The third, fourth, fifth, sixth and seventh person would follow the same algorithm as the second person.
The idea for this is that should anybody say that he has a good haircut, and that he isn't the first person, it means that he sees 0 person in front of him with a good haircut and the guy before him has seen 1 person in front of him with a good haircut, and this indicates that he is the one with a good haircut.
The only way for this not to work is when the first person sees 0 people with a bad haircut, causing him to guess his own haircut. The probability of everybody else having a bad haircut is 2 6 1 , and the probability for the first person to guess it wrong is 2 1 .
Therefore, the probability that this would work is 1 − 2 6 1 × 2 1 = 9 9 . 2 1 9 %