Can you solve the prisoner hat riddle Alex Gendler

You and nine other individuals
have been captured

by super intelligent alien overlords.

The aliens think humans look quite tasty,

but their civilization forbids eating
highly logical and cooperative beings.

Unfortunately, they’re not sure
whether you qualify,

so they decide to give you all a test.

Through its universal translator,

the alien guarding you
tells you the following:

You will be placed in a single-file line
facing forward in size order

so that each of you can see
everyone lined up ahead of you.

You will not be able to look behind you
or step out of line.

Each of you will have either a black
or a white hat on your head

assigned randomly,

and I won’t tell you
how many of each color there are.

When I say to begin, each of you must
guess the color of your hat

starting with the person in the back
and moving up the line.

And don’t even try saying words
other than black or white

or signaling some other way,
like intonation or volume;

you’ll all be eaten immediately.

If at least nine of you guess correctly,
you’ll all be spared.

You have five minutes to discuss
and come up with a plan,

and then I’ll line you up,
assign your hats, and we’ll begin.

Can you think of a strategy guaranteed
to save everyone?

Pause the video now
to figure it out for yourself.

Answer in: 3

Answer in: 2

Answer in: 1

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.

But she only sees one, so she deduces
that her hat is also black.

Prisoners five through nine are each
looking for an odd number of black hats,

which they see, so they figure out
that their hats are white.

Now it all comes down to you
at the front of the line.

If the ninth prisoner saw
an odd number of black hats,

that can only mean one thing.

You’ll find that this strategy works
for any possible arrangement of the hats.

The first prisoner has a 50% chance of
giving a wrong answer about his own hat,

but the parity information he conveys

allows everyone else
to guess theirs with absolute certainty.

Each begins by expecting to see an odd
or even number of hats

of the specified color.

If what they count doesn’t match,
that means their own hat is that color.

And everytime this happens,

the next person in line will switch
the parity they expect to see.

So that’s it, you’re free to go.

It looks like these aliens
will have to go hungry,

or find some less logical
organisms to abduct.

你和其他九个人

被超级聪明的外星霸主俘虏。

外星人认为人类看起来很好吃,

但他们的文明禁止吃
高度逻辑和合作的生物。

不幸的是,他们不确定
您是否符合条件,

因此他们决定给您全部考试。

通过它的通用翻译器,

守卫你的外星人
告诉你以下内容:

你将被放置在一个单排的
队伍中,按大小顺序面向前方,

这样你们每个人都可以看到
每个人都排在你前面。

您将无法回头看
或越界。

你们每个人的
头上都会随机分配一顶黑色或一顶白色的帽子

,我不会告诉你
每种颜色有多少。

当我说开始时,你们每个人都必须从后面的人开始
猜测帽子的颜色,

然后向上移动。

甚至不要尝试说
黑色或白色以外的词

或以其他方式发出信号,
例如语调或音量;

你们都会立即被吃掉。

如果至少有九个人猜对了,
那么你们都将幸免于难。

你有五分钟的时间讨论
并提出一个计划,

然后我会为你排好队,
分配你的帽子,然后我们就开始了。

你能想出一个可以
保证拯救所有人的策略吗?

现在暂停视频
,自己弄清楚。

回答: 3

回答: 2

回答:

1 关键是排
在后面的

人可以看到其他人的帽子,
可以使用“黑色”或“白色”字样

来传达一些编码信息。

那么,可以

那些允许其他
人推断出他们的帽子颜色的词赋予什么含义呢?

它不能
是黑帽子或白帽子的总数。

有两个以上的可能值,

但有两个可能值的
是该数字的奇偶性,

即它是奇数还是偶数。

所以解决方案是
同意先走的人,

例如,如果他看到奇数个黑帽,就说“黑”,如果他
看到偶数个黑帽

,就说“白”

让我们看看
如果帽子像这样分配会怎样。

最高的俘虏看到
他面前的三个黑帽子,

所以他说“黑色”,告诉其他人
他看到了奇数个黑帽子。

他把自己的帽子颜色弄错了,
但这没关系,

因为你被集体
允许有一个错误的答案。

犯人 2 也看到了
奇数个黑帽子,

所以她知道她的帽子是白色的,
并且回答正确。

犯人三看到
了偶数个黑帽,

所以他知道他的一定是

前两个犯人看到的黑帽之一。

四号犯人闻言,

知道自己应该
找偶数个黑帽子,

因为后面有一个。

但她只看到一个,所以她
推断她的帽子也是黑色的。

5 到 9 名囚犯每个人都
在寻找奇数的黑帽子

,他们看到了,所以他们
发现他们的帽子是白色的。

现在,这一切都归结为您
在生产线的最前面。

如果第九个犯人看到
了奇数个黑帽子,

那只能说明一件事。

您会发现这种策略适用
于任何可能的帽子排列方式。

第一个囚犯有 50% 的机会
给出关于他自己帽子的错误答案,

但他传达的平价信息

让其他人
可以绝对肯定地猜测他们的帽子。

每个人都希望看到指定颜色的奇数
或偶数

帽子。

如果他们计算的不匹配,
那意味着他们自己的帽子就是那个颜色。

每次发生这种情况时

,下一个排队的人都会切换
他们期望看到的平价。

就这样,你可以自由了。

看起来这些外星人
将不得不挨饿,

或者找到一些不太合乎逻辑的
生物来绑架。