Can you solve the rogue AI riddle Dan Finkel

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.

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.

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

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.

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.

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.

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.

一种名为
NIM 的敌对人工智能已经接管了世界上的计算机。

你是唯一一个足够熟练的人
来关闭它

,你只有一次机会。

你闯入了 NIM 的秘密实验室

,现在你漂浮在
25 层通电水上的木筏上。

您已经安装了一个遥控
器,可以

通过将水位从
房间两侧的格栅中弹出来降低水位。

如果您可以将水位降低到 0,

您可以按下手动控制,

关闭 NIM,

并节省一天的时间。

然而,人工智能知道你在这里
,它也可以

通过实验室底部的活板门吸水来降低水位

如果 NIM 是将
水位降至 0 的人,

你将被吸出实验室,

导致任务失败。

对排水的控制
在您和 NIM 之间交替进行,

两者都不能跳过。

你们每个人一次可以将水位
降低 1、3

或 4 层。


在自己的回合中将等级精确到 0,谁

就会赢得这场致命的决斗。

请注意,你们谁都不能
将水位降低到 0 以下;

如果水位为 2,

那么唯一的举措就是
降低水位 1 层。

您知道 NIM 已经计算
了比赛的所有可能结果,

并且将以最大化成功机会的方式进行比赛

你先走吧。

您如何生存
并关闭人工智能?

如果您想
自己弄清楚,请在此处暂停。

回答:3

回答:2

回答:1

你不能让任何事情靠运气
——NIM 会利用它可以获得的任何优势。

你需要对它做出
的任何可能的举动做出回应。

这里的诀窍是从
你想要结束的地方开始并向后工作。

您想成为
将水位降低到 0 的人,

这意味着当控制切换到您时,您需要
水位处于 1、3 或 4

如果水位为 2,

您唯一的选择是将
其降低 1 层,

这将
导致 NIM 取得胜利。

如果我们对水位进行颜色编码,

我们可以看到一个简单的原理:

有像 2 这样的“失败”级别,

无论从那里开始
轮到他们的人做什么,他们都会失败。

并且有获胜级别
,无论谁开始他们的回合,

他们要么赢,要么让
对手输掉。

因此,不仅 1、3
和 4 获胜级别,

5 和 6 也是如此,

因为您可以将对手
从那里发送到 2。

7号呢?

从 7 开始,所有可能的动作都会
让你的对手进入获胜级别,

从而成为另一个失败的级别。

我们可以
通过这种方式继续实验室。

如果您在第 1、3 或 4 回合开始时
高于失败级别,

则您处于获胜级别。

否则,你注定要输。

你可以一直这样
一直到 25 级。

但作为捷径,

你可能会注意到 8 到 11 级
的颜色与 1 到 4 相同。

因为一个级别的颜色
由下面的 1、3 和 4 层决定 它,

这意味着 12
级将与 5 级颜色相同,

13 将匹配 6,14 将匹配 7,等等,

特别是,失败的级别
将始终是 7 的倍数,

并且两个大于 7 的倍数 .

现在,从你最初
的 25 级开始,

你必须确保你的对手
每回合都从失败的级别

开始——如果 NIM 甚至一次从获胜的级别开始

你的游戏就结束了。

所以你在第 1 回合唯一的选择
就是将水位降低 4 层楼。

无论人工智能做什么,

你都可以继续给它失去等级,

直到你达到 0
并触发手动覆盖。

这样一来,危机就被避免了。

现在,回到一种压力较小
的冲浪。