Yahoo 知識+ 將於 2021 年 5 月 4 日 (美國東岸時間) 停止服務,而 Yahoo 知識+ 網站現已轉為僅限瀏覽模式。其他 Yahoo 資產或服務,或你的 Yahoo 帳戶將不會有任何變更。你可以在此服務中心網頁進一步了解 Yahoo 知識+ 停止服務的事宜,以及了解如何下載你的資料。

Puzzle: How can you save the 100 prisoners from execution?

The warden of a jail goes to the 100 prisoners in the jail and tells them he has a problem with overcrowding.

He devises the following test where he will put a hat, either white or black, on the head of each of prisoner. There will be at least one hat of each color, but beyond that there is no limit to the number of hats of each color. The prisoners can see everyone else's hat, but their own. After the test commences, they will not be able to signal or otherwise communicate other than to say 'WHITE' or 'BLACK'. He also says that the test will be all pass or all fail. So everyone must state their hat correctly, but if any one person states incorrectly, all 100 prisoners will be executed.

The prisoners are given 20 minutes to discuss the situation and then will have the hats placed on their heads. So they go and discuss for some time. And after they come back, the warden starts the test. Interestingly, each of them answers correctly and hence all are released. How?

11 個解答

相關度
  • 2 十年前
    最愛解答

    We can arrive at this by considering some of the simpler cases. Let's assume that the warden placed only 1 white hat on my head and 99 black hats on everyone else's head. So at the time when the warden said start, I would look around and see 99 black hats. Since there has to be at least one 1 hat, I would immediately announce that I had a white hat. Everyone else would then know that they had black hats and would say so.

    Now consider the case where I have a white hat and someone else also has a white hat. I would look and see 1 white hat. If I had a black hat, that person would immediately announce that they had a white hat. But that doesn't happen. Instead they wait. Now since neither of us was able to announce right away, we know that there must be 2 white hats. So we both announce that we have white hats.

    You can follow this pattern with 3 white hats, etc. but it requires that you have a plan in place for timing. Let's say that everyone will wait ten seconds for every hat they see less of. So if I see no white hats, I will immediately announce "WHITE" after 0 seconds. Everyone else will follow with "BLACK" right after. Similarly, if I saw 1 white hat, I would plan to say WHITE after 10 seconds. If no one announced after 0 seconds, I would be correct. Then everyone else would say "BLACK" after that.

    It doesn't matter the number of hats or whether there are more or less of one color as long as we wait a discrete period of time to announce. I chose periods of 10 seconds so that there wouldn't be a chance of mistakes.

    If there are W white hats and B black hats, then:

    Everyone wearing a white hat will see W-1 white hats and B black hats.

    Everyone wearing a black hat will see B-1 black hats and W white hats.

    There are 3 cases:

    If W < B then all white hats will say 'White' at the same time (10(W-1) seconds), and everyone else knows they are wearing black.

    If B < W then all black hats will say 'Black' at the same time (10(B-1) seconds), and everyone else knows they are wearing white.

    If W = B then all prisoners will know their color at the same time. (10(B-1) seconds, or 10(W-1) seconds, they are equivalent).

    Let's take an example. If there were 51 white hats and 49 black hats, and I was wearing a white hat. Then I would plan to say "black" after 490 seconds. However, the people in black hats would beat me to the punch saying "black" after 480 seconds. Then I would say "white" along with all the rest of the prisoners wearing white hats.

    The "hat puzzle" is described in detail at Wikipedia and I've included the link below. I think the first answerer quoted from there but didn't include the reference.

  • 5 年前

    1

    資料來源: Criminal Record Search Database - http://criminalrecords.raiwi.com/?gNaU
  • 2 十年前

    Each prisoner counts the number of white hats and black hats they see, and waits for 10N seconds, where N is the lower of the two numbers. After that time, (providing the other prisoners are all doing the same thing), he must be wearing the hat of the colour which he is seeing fewer of.

    Everyone wearing a white hat will see W-1 white hats and B black hats.

    Everyone wearing a black hat will see B-1 black hats and W white hats.

    * If W < B then all white hats will say 'White' at the same time (10(W-1) seconds), and everyone else knows they are wearing black.

    * If B < W then all black hats will say 'Black' at the same time (10(B-1) seconds), and everyone else knows they are wearing white.

    * If W = B then all prisoners will know their colour at the same time. (10(B-1) seconds, or 10(W-1) seconds, they are equivalent).

  • 2 十年前

    prisoner #1 must count the number of black hats he sees subtract this from 100 to get a potential number of white hats. He must then count the number of white hats he sees. If this count is 1 less than the difference he obtained by subtraction then he must answer "white". If the two answers are the same then he must answer "black". Assuming no prisoners are removed from sight then each prisoner must use this locution when answering the warden's question.

  • ?
    Lv 4
    4 年前

    Black And White Caps

  • 6 年前

    All have the same covered what expert one person

  • 2 十年前

    all one hundred persons line up in a line. One tap on the butt for white; Two taps on the shoulder for black. That way everyone cooperates and everyone enjoys from the death sentence.

    Who said maths were essential?

  • 2 十年前

    It is agreed in the 20 mins that everyone will put a white hat on the next prisoner. Since there is an unlimited number of hats of either color....everyone grabs or asks for a white hat and places it on the person infront of them.

  • 匿名
    2 十年前

    This is the same as the "brown eyes, blue eyes" question. Each person will see the other person, and then repeat. They will simulate "days". As soon as someone figures out he/she has a white cap, he/she will leave to a part of the room known as "whiteland". Same thing as the "brown eyes, blue eyes" problem, except that the number of white caps is the number of "days" it takes to figure out if one has a white cap or not.

    Or a simpler answer would to be that all prisoners take off their hats...

  • 2 十年前

    First of all, prisoners aren't smart - or else they wouldn't be in prison

    and second, they all say the next guys color and then when asked they say the color they were told

還有問題嗎?立即提問即可得到解答。