【TED ED 中英双语】 P86
Can you solve the rogue AI riddle
你能解决流氓AI之谜吗

A hostile artificial intelligence called NIM has taken over the world’s computers.
You’re the only person skilled enough to shut it down, and you’ll only have one chance.
You’ve broken into NIM’s secret lab, and now you’re floating in a raft on top of 25 stories of electrified water.
You’ve rigged up a remote that can lower the water level by ejecting it from grates in the sides of the room.
If you can lower the water level to 0, you can hit the manual override, shut NIM off, and save the day.

一个邪恶的人工智能 NIM 控制了全世界的电脑。
你是唯一一个有能力关闭它的人,且你只有一次机会。
你闯入了 NIM 的秘密实验室,现在正坐在浮在 25 层高的 带电水上的一个皮筏艇里。
你已装配了一个遥控器,它可以通过把水从房间两侧的格子 排走来降低水位。
如果你可以把水位降到 0,你就可以按下手动操作按钮,关闭 NIM并拯救世界。

However, the AI knows that you’re here, and it can lower the water level, too, by sucking it through a trapdoor at the bottom of the lab.
If NIM is the one to lower the water level to 0, you’ll be sucked out of the lab, resulting in a failed mission.
Control over water drainage alternates between you and NIM, and neither can skip a turn. Each of you can lower the water level by exactly 1, 3, or 4 stories at a time.
Whoever gets the level exactly to 0 on their turn will win this deadly duel.

但是这个 AI 知道你在这,它也能通过用实验室底部的 活板门抽水,让水位降低。
如果 NIM 把水位降低到了 0,你就会被吸出实验室,从而导致任务失败。
你和 NIM 轮流排水,谁也不可以跳过任何一轮。
你们俩每轮可以把水位降低刚好 1 层,3 层或 4 层。
谁在轮到自己时把水位降到了 0谁就是这生死之战的赢家。

Note that neither of you can lower the water below 0; if the water level is at 2, then the only move is to lower the water level 1 story.
You know that NIM has already computed all possible outcomes of the contest, and will play in a way that maximizes its chance of success.
You go first.
How can you survive and shut off the artificial intelligence?
Pause here if you want to figure it out for yourself.
Answer in: 3
Answer in: 2
Answer in: 1

注意,你们俩谁都不能让 水位降到 0 以下;假如水位在 2,那你们就一次只能让水位降 1 层。
你知道 NIM 已经计算出了 这场比赛的所有可能结果,而且它会选择以能让它自己 赢的可能性最大化的方式来玩。
你先出招。
你要怎样才可以存活下来 并终结这个人工智能呢?
如果你想自己想想的话, 请在这里暂停。
答案揭晓倒计时:3
答案揭晓倒计时:2
答案揭晓倒计时:1

You can’t leave anything up to chance - NIM will take any advantage it can get.
And you’ll need to have a response to any possible move it makes.
The trick here is to start from where you want to end and work backwards.
You want to be the one to lower the water level to 0, which means you need the water level to be at 1, 3, or 4 when control switches to you.
If the water level were at 2, your only option would be to lower it 1 story, which would lead to NIM making the winning move.
If we color code the water levels, we can see a simple principle at play: there are “losing” levels like 2, where no matter what whoever starts their turn there does, they’ll lose.
And there are winning levels, where whoever starts their turn there can either win or leave their opponent with a losing level.

你不可以把任何一步交给命运—— NIM 会利用任何潜在优势。
你得准备好应对 NIM 所有招数的措施。
这里的技巧是从理想结局开始进行倒推。
你想成为那个把水位降到 0 的人,意味着你需要水位在轮到你时在 1,3 或 4 的位置。
如果水位当时在 2 的位置,你唯一的选择便会是让水位降低 1 层,这就会让 NIM 获胜。
如果我们用颜色标记一下这些水位,我们就会发现玩这个游戏的一个简单原则:游戏里存在一些“必输”层,比如第 2 层,一旦轮到那一层,无论是谁都必输无疑。
游戏里也存在一些必胜层, 无论是谁轮到那些层谁都能赢或是把他们的对手逼到必输层。

So not only are 1, 3, and 4 winning levels, but so are 5 and 6, since you can send your opponent to 2 from there.
What about 7?
From 7, all possible moves would send your opponent to a winning level, making this another losing level.
And we can continue up the lab in this way.
If you start your turn 1, 3, or 4 levels above a losing level, then you’re at a winning level.
Otherwise, you’re destined to lose.

所以不只是 1,3 和 4是必胜层,5 和 6 也是,因为从那些位置你可以 把你的对手送到第 2 层。
那么第 7 层是什么情况呢?
到了第 7 层,所有可能的移动 都会把你的对手送到必胜层,所以这又是一个必输层。
我们可以继续这样往上推理。如果轮到你时你在一个必输层的上面 1,3 或 4 层的位置,那你就位于一个必胜层。
否则,你必输无疑。

You could continue like this all the way to level 25.
But as a shortcut, you might notice that levels 8 through 11 are colored identically to 1 through 4.
Since a level’s color is determined by the levels 1, 3, and 4 stories below it, this means that level 12 will be the same color as level 5, 13 will match 6, 14 will match 7, and so on, In particular, the losing levels will always be multiple of 7, and two greater than multiples of 7.

你可以像这样一路推理到第 25 层。
不过还有一条捷径,你可能注意到了,第 8 到 11 层和 第 1 到 4 层的颜色是一样的。
由于层级的颜色取决于 位于它下面 1,3 或 4 层的颜色,所以第 12 层的颜色会和第 5 层的颜色一样,13 会和 6 一样,14 会和 7 一样,以此类推,必输层的层数永远会是 7 的倍数,以及比 7 的倍数大 2 的数。

Now, from your original starting level of 25, you have to make sure your opponent starts on a losing level every single turn— if NIM starts on a winning level even once, it’s game over for you.
So your only choice on turn 1 is to lower the water level by 4 stories.
No matter what the AI does, you can continue giving it losing levels until you reach 0 and trigger the manual override.
And with that, the crisis is averted.
Now, back to a less stressful kind of surfing.

现在,从你的出发点 25 层起,你得确保你的对手在任何一局中 都位于必输层——因为一旦 NIM 处于必胜层,哪怕是一次,你就完了。
所以在第一轮时你唯一的选择 就是让水位降低 4 层。
这样无论 AI 怎么做,你都可以把必输层推给它直到你到达第 0 层, 启动手动操作装置。
这样危机就解除了。
现在,回到一种 更轻松的冲浪里吧(即上网)。