Puzzle time! Of colored hats and blindfolded people…
It has been a long time since I posted a puzzle. This is a variation of those category of logic problems where blindfolded people regularly get colored hats put on them and they have to guess the color of the hat on their own head 🙂
This particular one goes this way – Twelve sailors get marooned in an island. The local tribe finds them out and takes them to their leader. Their leader, not knowing what to do with the prisoners, come up with a novel idea. He tells them that next day morning, he was going to line them up in a straight line and put a cap on their head while they are blindfolded. The only colors he has his hats in are black and white. (I do not have the faintest idea why on God’s green earth the tribal leader had black and white hats, but that is what he had 🙂 ) After that, he would remove everybody’s blindfold. Then, every sailor could see the color of the hats of all the people in front of himself but not his own or that of the ones behind.
The leader would start from the last person in the rear and ask him to name the color of the hat he was wearing. He could only say “Black” or “White”. Any other words spoken would result in everybody getting killed. If the person got the right answer, he would be spared, else he would be killed. Then the leader would move to the next person who was ahead of the last person and go thru the same procedure… till he was done with all twelve of them.
You can assume that everybody can hear the answer given by the person being asked. All the people who were spared would be given a boat and shown how to go back to their land.
Tonight, the sailors have to come up with a strategy to save as many of themselves as they can.
What would be the best strategy to maximize the number of people who can survive? How many can survive?
Every other sailor had to say the color of hat of the person in front ?
The best strategy would be for the 12 sailors to get their captors drunk at night and divulge the way back to land, then grab the boat and set sail. Tribal leaders have strange humors – who is to say that the despot won’t change his mind and have them bumped off, regardless of their answers?
Interesting! I have a staright forward solution to save 6 sailors for sure and remaining 6 have a 50% chance of life. Lets see if we can improve that 🙂 Rajib Roy
Debajyoti, I assume your approach is like Natasha’s. In her case too, the even person from the end would get saved and for the other six it would be 50-50 chance. That is a good solution. But it is possible to save more people…
Rupa, and they can always use the drink from my post previous to this to accomplish your strategy 🙂
i found another one where 8 prisoners can be saved for sure … writing it up
Natasha’s solution will save 1 prisoner (the prisoner at the beginning of the q) for sure and the rest are 50% chances I guess, isn’t it?
No, I think her approach is the following – last one yells out the color of the hat in front of him. HE himself has a 50-50 chance of that being his color too but for sure, the guy in front of him now knows what is his color. You extend that logic for every pair of guys…
This is a smarter solution than the even-odd one below for getting the same outcome
You do realize that it is not the same outcome, right? This approach saves half the people for sure. The odd even saves all but one for sure.
Aargh! Feeling stupid. I wasn’t thinking and lost a small detail that you can only say one color
so is 8 the answer … i mean 8 prisoners can be saved for sure?
how would you save 8 for sure?
dividing in groups of 3 and the last person in each grp can call out depending on the 4 combinations possible for the remaining 2 ahead.
If there is no restriction on how “black” or “white” are said, could save 11 at least, with the last having a 50% chance:)
Anu, if I understand your question, you are asking not how they pronounce black or white but do they have full freedom to yell whatever they want? If so, the answer is yes. And 11 is the correct answer!!
Yes:)
Anu, just to be sure, each can yell only one word. Either black or white
….in the prevailing public sentiment, calling out “black” and “white” on anything and esp with ref to prisoners is fraught with risks of misunderstanding, so I respectfully recuse myself from this problem..
yes, that’s why I asked about the tone they could yell out the two colors in:)
Anu, now I understand the question. No, the tone, timing, etc have nothing to do with it. This is not a trick question, pure logic.
Ram, I thought about red and blue but then again, it is an election year 🙂
Debajyoti cracked it.
So the last person calls out the color of the guy in front of him (50/50 chance of his survival), now the next guy yells his own color if the guy in front of him has the same color or whispers it if the guy in front of him has the opposite. That way 11 are def saved!
I love how you try all lateral thinking – like whispering etc, Anu 🙂
lol:) Thank you:)
Answer to the puzzle:
The crux of the logic lies in telling the person in front of you something that the person can use to “diff” against what he sees. Obviously, it cannot be the number of black or white. Since by saying “Black” or “White”, you can only signal two numbers. But what you can do is signal “even” or “odd”. So, if you signal to the person in front of you that you see odd number of white hats (by saying “White”, let’s say), the person in front can now check whether he sees odd or even number of white hats in front of him and therefore deduce his answer. And from his answer, coupled with your answer the people in front of him can deduce whether there is even or odd number of white hats in front of the person in front of you and so on.
So, let’s see how it will work. The strategy they come up with is the following: The last person in the line (the first to be asked) will call out “White” if he sees odd number of white hats in front of him. And that is all that is required.
Let’s say that person called “White”. Well, it is 50-50 chance that he has White. That is about pure luck. But the person in front of him knows that the last person saw odd number of White hats. If he himself sees odd number of white hats in front of him, he calls “Black” correctly. And the people in front of him know that from the third last person onwards, there are still odd number of white hats left. So, the third last person counts the number of white hats in front of him and then correctly calls his own. Of course, if the second person had seen even number of White hats in front of him, he would have called “White” and everybody would now know that there are even number of hats left and so on…
So, the generic logic for every person other than the last one is the following:
1. Start by saying to yourself “Even”
2. Now, everytime you hear somebody behind you yell “White”, toggle your mental count. So, if you were “Even”, tell yourself “Odd” and vice versa.
3. And when it is your chance, see whether you see even or odd number of white hats in front of you. If your mental count and your visual count match, you have Black, else White.
11 of them can be saved for sure. The last person in the queue is a 50-50 chance.
Answer to the puzzle:
The crux of the logic lies in telling the person in front of you something that the person can use to “diff” against what he sees. Obviously, it cannot be the number of black or white. Since by saying “Black” or “White”, you can only signal two numbers. But what you can do is signal “even” or “odd”. So, if you signal to the people in front of you that you see odd number of white hats (by saying “White”, let’s say), the person in front can now check whether he sees odd or even number of white hats in front of him and then deduce his answer. And from his answer, coupled with your answer the people in front of him can deduce whether there is even or odd number of white hats in front of the person in front of you and so on.
So, let’s see how it will work. The strategy they come up with is the following: The last person in the line (the first to be asked) will call out “White” if he sees odd number of white hats in front of him. And that is all that is required.
Let’s say that person called “White”. Well, it is 50-50 chance that he has White. That is about pure luck. But the person in front of him knows that the last person saw odd number of White hats. If he himself sees odd number of white hats in front of him, he calls “Black” correctly. And the people in front of him know that from the third last person onwards, there are still odd number of white hats left. So, the third last person counts the number of white hats in front of him and then correctly calls his own. Of course, if the second person had seen even number of White hats in front of him, he would have called “White” and everybody would now know that there are even number of hats left.
So, the generic logic is for every person is
1. Start by saying to yourself “Even”
2. Now, everytime you hear somebody behind you yell “White”, toggle your mental count. So, if you were “Even”, tell yourself “Odd” and vice versa.
3. And when it is your chance, see whether you see even or odd number of white hats in front of you. If your mental count and your visual count match, you have Black, else White.
11 of them can be saved for sure. The last person in the queue is a 50-50 chance.