The Factory | Think Like A Coder, Ep 9

382,546 views ・ 2020-06-23

TED-Ed


請雙擊下方英文字幕播放視頻。

譯者: Clement Fu 審譯者: Helen Chang
[TED-Ed 原創系列]
《終極一編:騙遍新世界》
[地點:奴芯堡]
[第九集:成魔]
00:32
After a harrowing chase, Ethic, Hedge, and their new ally Lemma
0
32447
4555
經過狹路相逢的顛簸
「煙林」、「靈結」和新手足「連儂雅」
00:37
find themselves in a cavernous control room.
1
37002
7504
來到偌大的控制室
00:44
Here the last artifact— the Node of Memory—
2
44506
3320
最後一枚瑰寶「記憶之泉」
00:47
is suspended within a force field and powering a supercomputer.
3
47826
4838
就懸浮在力場中,推動著超級電腦
00:52
Ethic is about to deactivate the force field when Lemma stops her.
4
52664
4809
煙林正要解除力場,連儂雅制止她
00:57
She explains, a decade ago, she was assigned a research task:
5
57473
4909
連儂雅娓娓道來:
十年前,她被指派一項研究任務
01:02
to use the world machine to create something that would make everyone happy.
6
62382
4927
利用「創世機」打造一顆萬靈丹
讓人人無不臻極樂之境
01:07
After many failed attempts, Lemma discovered a compound that, when ingested,
7
67309
5048
連儂雅屢敗屢試,終尋獲一種化合物
服下讓人精神抖擻、其樂無比
01:12
made people motivated, happy, creative, loving… in short, their best selves.
8
72357
6677
創意無窮、關愛備至,總之成龍成鳳
01:19
It was rushed into production.
9
79034
2040
靈丹一俟研發便匆匆投產
01:21
Soon, the entire nation’s food supply came from Huxenborg,
10
81074
3670
不久,「奴芯堡」掌控一國食糧
01:24
with the compound mixed in.
11
84744
2790
施加化合物一手抓緊人民幸福感
01:27
The first year was paradise.
12
87534
1970
第一年有如置身天堂
01:29
The second, not so much.
13
89504
2150
第二年情況就沒那麼好了
01:31
Side-effects began to emerge: memory-loss, listlessness, and self-absorption.
14
91654
5298
靈丹的副作用開始浮現:失憶、頹廢
自我充斥眼中醉生夢死
01:36
In the third year, the government dissolved,
15
96952
2840
第三年,政權土崩瓦解
01:39
leaving the robots running everything in a self-sustaining loop.
16
99792
4588
餘下通天徹地的機器人在迴圈輪迴
01:44
By this point things were too far gone for Lemma to reverse.
17
104380
3890
事到如此地步,連儂雅無力扭轉乾坤
01:48
People had become dependent on the compound,
18
108270
2850
人民已依賴靈丹的化合物
01:51
and the few who refused it formed a resistance to try to fix things.
19
111120
4364
一小撮人不認命反抗,力圖重修正軌
01:55
It took 10 years for Lemma to find a cure.
20
115484
3100
連儂雅花了十年才找到解藥
01:58
This factory contains everything she’ll need to make it,
21
118584
3890
這座工廠恰好萬事俱備,只欠東風
02:02
but the second they take the Node of Memory,
22
122474
2240
一奪走記憶之泉,警報就會響起
02:04
the security system will alert the robots, and they’ll have to run.
23
124714
4242
驚動鐵甲桀犬,就要逃命
02:08
If, instead, they first reconfigure the factory to manufacture the cure,
24
128956
5183
亡命前若扭轉工廠生產解藥
02:14
the people can be saved.
25
134139
2210
人民便得救
02:16
Lemma has the whole factory redesign planned out.
26
136349
3460
連儂雅改造工廠的大計已躍然紙上
02:19
The problem is… it’s a little hard to read.
27
139809
2820
但草圖龍騰虎躍,仍須謄清才好讀
02:22
Her schematic shows all the steps in the manufacturing process
28
142629
3620
流程圖記下解藥的生產過程
每個所需步驟加以箭頭連結
02:26
needed to make the cure.
29
146249
1680
02:27
An arrow from “add nitric acid” to “shake vigorously”
30
147929
3880
例如「加入硝酸」指向「用力搖勻」
02:31
means that the acid addition has to happen before shaking.
31
151809
3870
表示倒入硝酸後方可搖晃
02:35
If a single step is performed out of order,
32
155679
2670
倘若一著不慎,步驟失序
02:38
the cure won’t work, or worse.
33
158349
2710
解藥便不奏效,後果甚或不堪設想
02:41
There aren’t any circular references, where step A requires step B
34
161059
4652
當中的步驟毫無循環參照
即是說,若步驟甲的先決是步驟乙
02:45
and step B eventually requires step A.
35
165711
4434
步驟乙終究就不需先做步驟甲
03:04
Here’s where Ethic and Hedge come in.
36
184771
2660
煙林、靈結當然無事不登三寶殿
03:07
Lemma needs Hedge to translate the tangled diagram
37
187431
3528
連儂雅需借靈結之力疏理流程圖
03:10
into a sequence of steps.
38
190959
2220
從凌亂中擷出一篇順序的步驟
03:13
That’ll be the order that things happen in the factory.
39
193179
2990
即是工廠中按先後次序排列的工序
03:16
Once input into the central computer,
40
196169
2280
再輸入到中央電腦中
03:18
the factory will reassemble itself as instructed.
41
198449
3700
工廠就會按指示重整生產線
03:22
Hedge’s ability to store information in a table will help here.
42
202149
3830
靈結能將資訊存成表格就派上用場
03:25
So how does Ethic program Hedge to turn out a correct sequence
43
205979
4557
煙林該如何指示靈結
編出一份齊整的程序去改造工廠?
03:30
that can reconfigure the factory?
44
210536
2335
03:32
Pause now to figure it out yourself.
45
212871
1872
[若要自己動腦筋,就按一下暫停]
03:34
Rules in 3
46
214743
850
[細則倒數 3]
03:35
Rules in 2
47
215593
968
[細則倒數 2]
03:36
Rules in 1
48
216561
920
[細則倒數 1]
03:39
Hint in 3
49
219470
1021
[秘訣倒數 3]
03:40
Hint in 2
50
220491
975
[秘訣倒數 2]
03:41
Hint in 1
51
221466
1145
[秘訣倒數 1]
03:42
It may help to first think about this problem as a human,
52
222611
3899
這道題該要如何理解
也許人先意會,才讓機器會意
03:46
rather than a machine.
53
226510
1650
03:48
Given this diagram, it’s clear to start with getting a bowl,
54
228160
4161
譬如這幅圖,第一步明顯是「備碗」
03:52
since no arrows point to it.
55
232321
2780
因為沒有其他步驟指向它
03:55
How might you mark up the diagram to figure out what to do next?
56
235101
4540
按此推之,要如何標記流程圖做下去?
03:59
Pause now to figure it out yourself.
57
239641
1970
[若要自己動腦筋,就按一下暫停]
04:01
Solution in 3
58
241611
880
[揭曉倒數 3]
04:02
Solution in 2
59
242491
1020
[揭曉倒數 2]
04:03
Solution in 1
60
243511
1126
[揭曉倒數 1]
04:04
Diagrams like the one Lemma has drawn are called directed acyclic graphs.
61
244637
6603
連儂雅所畫的是「有向無環圖」
04:11
A graph is a representation of data that shows different elements
62
251240
4000
「圖」表是一種資料表達的方式
顯示出當中的不同元素及相互關係
04:15
and how they’re related to each other.
63
255240
2257
04:17
Directed means that direction matters— as indicated by the arrows.
64
257497
5734
「有向」表示方向有關係
方向以箭頭表示
04:23
Here A leads to B, but B doesn’t lead to A.
65
263231
4198
範例中,甲引致乙,乙卻不引致甲
04:27
And acyclic means that there aren’t any loops.
66
267429
3720
「無環」則指當中沒有循環
04:31
Which is fortunate, because if there were, this problem wouldn’t be solvable.
67
271149
5079
慶幸如此,否則此題就無解
04:36
There’s a simple way to navigate the graph as a human:
68
276228
3480
一個人去理順這幅圖有個簡單方法:
04:39
start with a step that doesn’t have any arrows pointing to it.
69
279708
3710
首先,在外圍找沒有箭頭指向的一步
04:43
Once you do that, cross out that step and all arrows leading from it.
70
283418
4890
然後刪去那一步及所有指出去的箭頭
04:48
Choose another step with no arrows pointing to it,
71
288308
3230
再選沒有箭頭指向的另外一步
04:51
and repeat until you’ve hit every step.
72
291538
3680
重複上述一遍,直至尋遍每一步為止
04:55
There are two things here that are tricky to translate for a robot.
73
295218
4000
給機器轉譯這做法,有兩點較費神:
04:59
First, how do you keep track of the information?
74
299218
2960
首先,資訊該何以追蹤?
05:02
And second, what do you do if there are multiple options at the same time?
75
302178
5321
若同時有多個選項又該如何定先後?
05:07
For the first challenge,
76
307499
1250
就第一點
05:08
a convenient way for machines to store information is in a table.
77
308749
4240
機器有一個方式方便儲存資訊:表格
05:12
In this case, you can have Hedge list every step in the headers
78
312989
4000
套入目前情況,靈結可在欄首和列首
05:16
of both the rows and columns.
79
316989
2750
分別羅列出工序的每一個步驟
05:19
Then he can go through the rows one at a time.
80
319739
2910
然後,逐行由上至下看一遍
05:22
On the schematic, what points to mix?
81
322649
2861
流程圖所見,指向「調合」的
05:25
Both shake and titrate.
82
325510
2350
分別有「搖勻」和「滴定」
05:27
So Hedge should make a mark in both of their columns.
83
327860
3540
因此「調合」一行分別標記這兩欄
05:31
He can do the same for every row, one at a time, to make a table like this.
84
331400
5158
以此類推逐行看遍後得出這樣一個表
05:36
Of course the full table will be much bigger.
85
336558
4000
當然,表格實際上會大得多
05:40
Like a human, Hedge will also want to start
86
340558
2490
靈結無異於一個人
05:43
from one of the steps that has no arrows pointing to it—
87
343048
3480
都會想找外圍沒箭頭指向的一步開始
05:46
which is the same as having no marks in its row.
88
346528
4215
換言之,即是表格上沒作標記的一列
05:50
If there’s more than one,
89
350743
1290
若多於一列
05:52
a convenient way to choose is to pick the one that’s alphabetically earliest,
90
352033
4762
方便的做法是按英文字母順序擇先後
05:56
though other selection methods can work just as well.
91
356795
4065
當然,用其他的選擇方法也無妨
06:00
Next, Hedge can add that step to his running-order list,
92
360860
4000
這一步就可加到一張流水清單中
06:04
delete its entire column from the table—
93
364860
2450
然後在表格中橫豎都刪除
06:07
thus removing all the times it was a dependency––
94
367310
3030
一遍抹掉那些依賴這一步的足跡
06:10
and loop back to the start.
95
370340
2650
再回到起點重複迴圈
06:12
Because there are no circular references in the graph,
96
372990
3300
因為圖表沒有循環參照
06:16
each time we get here there’ll be at least one step with no remaining dependencies.
97
376290
5574
每次回首至少都有一步沒有殘餘先決
06:21
Hedge can add the alphabetically earliest to his running-order list,
98
381864
4692
據此可把英文字母先行的一步收納
06:26
remove it from the table, and loop back to the start again.
99
386556
4665
在表格中刪掉一欄,再從頭再來
06:31
So now we have a working loop,
100
391221
2020
一個做得出來的迴圈不經不覺誕生了
06:33
and it’ll run through all the elements in our table until none are left.
101
393241
4842
直至翻遍表格中所有元素,一個不留
06:38
Hedge drifts back and forth over the schematics,
102
398083
3010
在茫茫流程圖中,靈結翩翩精耕細作
06:41
and soon he starts spitting out instructions,
103
401093
2970
很快就編出收編的指示
06:44
which Ethic uses to configure the assembly lines.
104
404063
3230
好讓煙林去改造生產線
06:55
With the three working together,
105
415794
1760
三人合作無間
06:57
they churn out thousands of doses of the cure in no time.
106
417554
3710
上千劑解藥瞬間遍地開花
07:14
Ethic finally plucks the Node of Memory
107
434285
2400
終極一刻,煙林光復「記憶之泉」
07:16
from its holding field and trips the alarm.
108
436685
2970
就在高懸的力場打破一刻,警報響起
07:19
Within seconds bots are everywhere.
109
439655
2870
鐵甲桀犬瞬間遍布八方
08:02
As Ethic falls in shock, the Node restores not only her own memories,
110
482272
5037
那偉大的黑手蔽了天日,拋下了煙林
錯愕的雙眼穿透重拾的記憶
08:07
but reveals the last, missing pieces of the puzzle.
111
487309
4085
瞥見遠去的靈結
借屍還魂的惡靈,從來無處不在
08:11
Ethic built Hedge with a singular purpose:
112
491394
2870
煙林的初心是留得青山、一息尚存
08:14
to construct a maze that would protect the world machine
113
494264
3422
藉在地上建立迷宮守護「創世機」
08:17
from a corrupt government.
114
497686
1800
以免落入腐敗政權的邪惡手中
08:19
But in her haste, she made a critical mistake.
115
499486
3081
煙林匆忙間卻一著錯
08:22
She forgot to set the condition that would end the loop
116
502567
3220
最後關頭忘了設定終止迴圈的條件
08:25
which told Hedge how large the maze should be.
117
505787
3429
沒能告訴靈結迷宮的大小
08:29
So Hedge built and built until he could build no longer.
118
509216
4617
結果層層疊的迷宮變盡方法再蓋不下
08:33
And then he was conflicted.
119
513833
1760
靈結也墜落了一片迷霧:
08:35
He had to build a maze.
120
515593
1700
建造地上的迷宮可是煙林託孤寄命
08:37
But he couldn’t build further without hurting people
121
517293
3220
眼見鋪天蓋也蓋不住天下多麼無力
08:40
or flying over the Bradbarrier,
122
520513
2310
除非不惜傷害人或飛越「八達圍」
08:42
both forbidden by his programming.
123
522823
2500
卻又是煙林編下的指令絕不容許
08:45
So he wandered the land and searched for a solution,
124
525323
3330
只好尋遍大地找一線曙光解脫糾結
08:48
until he happened upon the Node of Power, the Node of Creation,
125
528653
4130
直至恰巧遇上「力量之泉」
「創造之泉」和「記憶之泉」
08:52
and the Node of Memory.
126
532783
2340
旋即意識到這是不可多得的尚方寶劍
08:55
He recognized their true, collective power
127
535123
2730
08:57
to grant self-awareness to those who lack it.
128
537853
3010
三位一體就能賦予它前所未有的自我
09:00
With all three he’d be able to change his programming
129
540863
2910
扭轉命中註定的束縛擺脫埋下的伏筆
09:03
and fulfill his drive to transform the entire world into a giant maze.
130
543773
5251
讓苦海與天下化成巨型迷宮同歸於盡
要一酬心魔、斬去糾結何嘗容易
09:09
It wouldn’t be easy:
131
549024
1650
09:10
the Nodes had safeguards to prevent robots from taking and using them.
132
550674
4745
三枚瑰寶設有明確保障以免所託非人
09:15
But if Hedge could find the right human
133
555419
2770
但若惡靈找到一個人,瞞住人心
09:18
and manipulate her with the promise of a heroic quest…
134
558189
4000
抹掉了記憶,只管敘述偉大的故事
結局將會不同
09:22
well that would be a different story.
135
562189
2290
09:24
A very different story.
136
564479
2560
結局將會大不相同
關於本網站

本網站將向您介紹對學習英語有用的 YouTube 視頻。 您將看到來自世界各地的一流教師教授的英語課程。 雙擊每個視頻頁面上顯示的英文字幕,從那裡播放視頻。 字幕與視頻播放同步滾動。 如果您有任何意見或要求,請使用此聯繫表與我們聯繫。

https://forms.gle/WvT1wiN1qDtmnspy7