“Tomorrow, at the execution, I will give you a chance to go free. I will queue you up randomly and put a hat on your head. The hat is either red or blue. You cannot see the color of your own hat, only those of the prisoners in front of you. You will not be allowed to look behind you, nor are you allowed to touch, or talk to the other prisoners in any way. To be clear, the last prisoner will only see the 19 prisoners in front of him. The second-to-last prisoner will only see the 18 prisoners in front of him, and so on.”

The warden grins. “Starting with the last person in the row, I will ask a simple question: What is the color of your hat?”

“If he answers correctly, I will set him free. But you can guess what happens when the answer is wrong. He will be put to death immediately. Regardless of the outcome, I will then move to the prisoner in front of him, and ask the same question. From the last one in the row to the first one, you will all be asked.”

The warden lowers his voice. “And another thing. I will tolerate no cheating. If anyone answers anything besides ‘red’ or ‘blue’, I will execute you all right then and there!”

As he leaves, the warden sarcastically shouts: “Good luck tomorrow!”

The twenty prisoners can still talk freely during the night, so they are having heated discussions about how to free as many prisoners as possible. This turns out to be a difficult task. What is the most prisoners that can definitely be saved, and how?

Solution

It's all up to the first guy that is asked; in other words the prisoner at the end of the row. And if that isn't enough, this is the unluckiest position in the queue to be in. His chance equals that of the toss of a coin.This last prisoner can see 19 prisoners in front of him. Some of them have blue hats and he is to count how many. He says ‘blue’ if that number is odd, or ‘red’ if it's even. All the other prisoners are to pay close attention to what's been said, not only by the last prisoner but everyone behind them. Let's assume he says ‘blue’.

Prisoner #20 has now either been released, or executed, and prisoner #19 is up next. He too should count the number of blue hats. Consider the information now available to him. If he sees an odd number then he still sees the same number of blue hats as the prisoner behind him did — his own hat must be red! If he sees an even number, it must be because his own hat is blue and is not counted this time where it was before. So the prisoner can always give the correct answer. To continue the example I'll go for ‘blue’.

It's prisoner #18's turn. He has now heard ‘blue’ two times. That means the number of blue hats was odd, then went to even. In the same way he can deduce his own hat color, by counting the number of blue hats in front of him. Still even? Red. Odd? Blue. This time, assume the answer is ‘red’.

Since prisoner #18 said ‘red’, nothing has really changed for prisoner #17, and there are still an even number of blue hats. Prisoner #17 does the same as the prisoners behind him and counts the blue hats. Once again, still even? Red. Odd? Blue.

This can continue all the way down the line! With this method, 19 prisoners can be saved for sure. Only the unfortunate 20th prisoner has to accept a fifty/fifty chance. Wish him luck!

This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.

ReplyDeleteHats