Can you solve the rogue AI riddle? - Dan Finkel

4,018,315 views ・ 2018-08-07

TED-Ed


Please double-click on the English subtitles below to play the video.

00:07
A hostile artificial intelligence called NIM has taken over the world’s computers.
0
7188
5299
00:12
You’re the only person skilled enough to shut it down,
1
12487
3048
00:15
and you’ll only have one chance.
2
15535
2353
00:17
You’ve broken into NIM’s secret lab,
3
17888
2227
00:20
and now you’re floating in a raft on top of 25 stories of electrified water.
4
20115
5369
00:25
You’ve rigged up a remote that can lower the water level
5
25484
2981
00:28
by ejecting it from grates in the sides of the room.
6
28465
3443
00:31
If you can lower the water level to 0,
7
31908
2324
00:34
you can hit the manual override,
8
34232
1960
00:36
shut NIM off,
9
36192
1136
00:37
and save the day.
10
37328
1315
00:38
However, the AI knows that you’re here, and it can lower the water level, too,
11
38643
4527
00:43
by sucking it through a trapdoor at the bottom of the lab.
12
43170
3536
00:46
If NIM is the one to lower the water level to 0,
13
46706
3036
00:49
you’ll be sucked out of the lab,
14
49742
1845
00:51
resulting in a failed mission.
15
51587
1958
00:53
Control over water drainage alternates between you and NIM,
16
53545
3904
00:57
and neither can skip a turn.
17
57449
1843
00:59
Each of you can lower the water level by exactly 1,
18
59292
3054
01:02
3,
19
62346
688
01:03
or 4 stories at a time.
20
63034
2124
01:05
Whoever gets the level exactly to 0 on their turn
21
65158
3065
01:08
will win this deadly duel.
22
68223
2212
01:10
Note that neither of you can lower the water below 0;
23
70435
3178
01:13
if the water level is at 2,
24
73613
1573
01:15
then the only move is to lower the water level 1 story.
25
75186
3848
01:19
You know that NIM has already computed all possible outcomes of the contest,
26
79034
4787
01:23
and will play in a way that maximizes its chance of success.
27
83821
3729
01:27
You go first.
28
87550
1510
01:29
How can you survive and shut off the artificial intelligence?
29
89060
3601
01:32
Pause here if you want to figure it out for yourself.
30
92661
3905
01:36
Answer in: 3
31
96566
1355
01:37
Answer in: 2
32
97921
1071
01:38
Answer in: 1
33
98992
1419
01:40
You can’t leave anything up to chance - NIM will take any advantage it can get.
34
100411
4418
01:44
And you’ll need to have a response to any possible move it makes.
35
104829
4076
01:48
The trick here is to start from where you want to end and work backwards.
36
108905
4465
01:53
You want to be the one to lower the water level to 0,
37
113370
2971
01:56
which means you need the water level to be at 1, 3, or 4
38
116341
3779
02:00
when control switches to you.
39
120120
2166
02:02
If the water level were at 2,
40
122286
1618
02:03
your only option would be to lower it 1 story,
41
123904
3164
02:07
which would lead to NIM making the winning move.
42
127068
2692
02:09
If we color code the water levels,
43
129760
2175
02:11
we can see a simple principle at play:
44
131935
2637
02:14
there are “losing” levels like 2,
45
134572
2060
02:16
where no matter what whoever starts their turn there does, they’ll lose.
46
136632
4850
02:21
And there are winning levels, where whoever starts their turn there
47
141482
3401
02:24
can either win or leave their opponent with a losing level.
48
144883
3976
02:28
So not only are 1, 3, and 4 winning levels,
49
148859
3401
02:32
but so are 5 and 6,
50
152260
2273
02:34
since you can send your opponent to 2 from there.
51
154533
3180
02:37
What about 7?
52
157713
1816
02:39
From 7, all possible moves would send your opponent to a winning level,
53
159529
4645
02:44
making this another losing level.
54
164174
2550
02:46
And we can continue up the lab in this way.
55
166724
3534
02:50
If you start your turn 1, 3, or 4 levels above a losing level,
56
170258
5198
02:55
then you’re at a winning level.
57
175456
2068
02:57
Otherwise, you’re destined to lose.
58
177524
2749
03:00
You could continue like this all the way to level 25.
59
180273
3493
03:03
But as a shortcut,
60
183766
1754
03:05
you might notice that levels 8 through 11 are colored identically to 1 through 4.
61
185520
5055
03:10
Since a level’s color is determined by the levels 1, 3, and 4 stories below it,
62
190575
5841
03:16
this means that level 12 will be the same color as level 5,
63
196416
4330
03:20
13 will match 6,
64
200746
1619
03:22
14 will match 7, and so on,
65
202365
2958
03:25
In particular, the losing levels will always be multiple of 7,
66
205323
4409
03:29
and two greater than multiples of 7.
67
209732
2525
03:32
Now, from your original starting level of 25,
68
212257
3272
03:35
you have to make sure your opponent starts on a losing level every single turn—
69
215529
5134
03:40
if NIM starts on a winning level even once,
70
220663
2681
03:43
it’s game over for you.
71
223344
2031
03:45
So your only choice on turn 1 is to lower the water level by 4 stories.
72
225375
5357
03:50
No matter what the AI does,
73
230732
2025
03:52
you can continue giving it losing levels
74
232757
2792
03:55
until you reach 0 and trigger the manual override.
75
235549
3815
03:59
And with that, the crisis is averted.
76
239364
3111
04:02
Now, back to a less stressful kind of surfing.
77
242475
3377
About this website

This site will introduce you to YouTube videos that are useful for learning English. You will see English lessons taught by top-notch teachers from around the world. Double-click on the English subtitles displayed on each video page to play the video from there. The subtitles scroll in sync with the video playback. If you have any comments or requests, please contact us using this contact form.

https://forms.gle/WvT1wiN1qDtmnspy7