The key is that the person at the back of the line who can see everyone else's hats
其實重點在于排在隊尾的人,他在看到其他所有人的帽子后
can use the words "black" or "white" to communicate some coded information.
可以用黑白來傳遞加密信息。
So what meaning can be assigned to those words that will allow everyone else to deduce their hat colors?
那么我們應當在這些詞上附加什么含義,以使得其他人可以推測他們帽子的顏色呢?
It can't be the total number of black or white hats.
首先不能是黑帽子或白帽子的總數。
There are more than two possible values,
那樣可能的值就會超過兩種。
but what does have two possible values is that number's parity, that is whether it's odd or even.
但是數字的奇偶性恰好只有兩種可能,那就是奇數或偶數。
So the solution is to agree that whoever goes first will, for example,
所以,解決方案就在于第一個說的人,舉個例子,
say "black" if he sees an odd number of black hats and "white" if he sees an even number of black hats.
比如他看到了奇數個黑帽子,他就要說“黑色”,當他看到了偶數個黑帽子時就要說“白色”。
Let's see how it would play out if the hats were distributed like this.
我們看下如果帽子顏色是這樣分配的話,這個策略執行起來如何。
The tallest captive sees three black hats in front of him,
最高的人看到前面有三個黑帽子,
so he says "black," telling everyone else he sees an odd number of black hats.
所以他說“黑色”,告訴其他所有人他看到的是奇數個黑帽子。
He gets his own hat color wrong, but that's okay since you're collectively allowed to have one wrong answer.
他沒有說對自己帽子的顏色,但是沒關系,因為所有被抓的人總共可以犯一個錯誤。
Prisoner two also sees an odd number of black hats, so she knows hers is white, and answers correctly.
第二高的人也看到奇數個黑帽子,她就會知道她的是白色的,就答對了。
Prisoner three sees an even number of black hats,
第三個人看到前面是偶數個黑帽子,
so he knows that his must be one of the black hats the first two prisoners saw.
所以他知道他的一定是前面兩個人看到的其中一頂黑帽子。
Prisoner four hears that and knows that she should be looking for an even number of black hats since one was behind her.
第四個人聽到后就知道她應當看到前面有偶數頂黑帽子,因為其中一頂在她身后。