The Furnace Bots | Think Like A Coder, Ep 3
-
0:36 - 0:41Ethic and her robot Hedge agree
to help the resistance leader, Adila, -
0:41 - 0:45sabotage the art-incinerating
furnace-bots. -
0:45 - 0:46In exchange,
-
0:46 - 0:50Adila promises to lead them
to the first object of Ethic’s quest, -
0:50 - 0:55an artifact called the Node of Power.
-
0:55 - 0:58Years ago, there was just
one furnace-bot. -
0:58 - 1:01It had a 0 inside its furnace
and an unknown, -
1:01 - 1:04randomly generated serial number.
-
1:04 - 1:11Over time, the original self-replicated
to produce more identical furnace-bots. -
1:11 - 1:16Each child inherited the original’s
unknown serial number within its furnace, -
1:16 - 1:22and had a random, unique serial
number of its own inscribed on its shell. -
1:22 - 1:26The second generation of furnace-
bots also self-replicated in the same way, -
1:26 - 1:31always passing their own serial
numbers to their offspring’s furnaces. -
1:31 - 1:35This continued on for many generations.
-
1:35 - 1:40Today, each furnace-bot receives
its orders from its parent. -
1:40 - 1:46So if Ethic can find the original 0 bot
and somehow change its instructions, -
1:46 - 1:50she could take over
the entire army, all at once. -
1:50 - 1:53Adila has the perfect solution:
-
1:53 - 1:56a data crystal that she’s
been carrying for years, -
1:56 - 1:59waiting for the right moment
to activate it. -
1:59 - 2:03It contains a program designed
to gain control of a bot -
2:03 - 2:06and give it new instructions.
-
2:06 - 2:10But if it’s uploaded to any furnace-
bot other than the original, -
2:10 - 2:13the 0 bot will override
the instructions -
2:13 - 2:16and destroy the data crystal
in the process. -
2:16 - 2:19The feeding is just
a few minutes away, -
2:19 - 2:22and there’s only one
chance to get this right. -
2:22 - 2:27Fortunately, Hedge’s ability
to store data can help. -
2:27 - 2:28In programming,
-
2:28 - 2:32a piece of information gets
stored in something called a variable. -
2:32 - 2:39Variables are basically containers that
hold onto numbers, words, or other values. -
2:39 - 2:45How does Ethic program Hedge to find
the original 0 bot as quickly as possible? -
2:45 - 2:48Pause now to figure it out for yourself.
-
2:50 - 2:51Here’s a hint.
-
2:51 - 2:56Programs can be written to have
as many variables as you need, -
2:56 - 2:59but you can solve this problem
with just one. -
2:59 - 3:02Hedge can use it to store
a serial number -
3:02 - 3:05and replace it with a new one
as often as he needs. -
3:05 - 3:08Pause now to figure it out for yourself.
-
3:10 - 3:15A key insight here is that Hedge
doesn’t need to map out the entire -
3:15 - 3:18set of relationships to find
the original furnace-bot. -
3:18 - 3:23If, for example, he gets lucky and picks
the original one right away, -
3:23 - 3:24he’ll be done.
-
3:24 - 3:26But if he starts with any other bot,
-
3:26 - 3:31he can still find a path that leads
straight back to the 0-bot -
3:31 - 3:34by following a simple set of instructions.
-
3:34 - 3:38To help craft them, let’s first
simplify the problem. -
3:38 - 3:41Let’s say there were only
three furnace-bots; -
3:41 - 3:45a parent and two children, but you don’t
know which is which. -
3:45 - 3:49You could have Hedge pick one
at random and look inside its furnace. -
3:49 - 3:53Now, you know the family tree
looks like this. -
3:53 - 3:57If the number inside the furnace is a 0,
you’ve found the parent. -
3:57 - 4:01If not, then no matter
which child you chose, -
4:01 - 4:04it must have the parent’s serial
number in its furnace. -
4:04 - 4:11So in this scenario, you’re guaranteed
to find the parent in one or two moves. -
4:11 - 4:14In actuality, there are many
furnace-bots, -
4:14 - 4:16and you don’t know how
many generations there are -
4:16 - 4:19nor what the family tree looks like.
-
4:19 - 4:20But you don’t need to,
-
4:20 - 4:24because Hedge can just keep repeating
the same sequence of actions -
4:24 - 4:27until he gets to the original.
-
4:27 - 4:29How? With a loop.
-
4:29 - 4:33Hedge can pick any bot at random,
look inside its furnace, -
4:33 - 4:36and store that serial
number as a variable. -
4:36 - 4:40Then he’ll begin the following
loop that will repeat -
4:40 - 4:42until the stored variable equals 0,
-
4:42 - 4:46the furnace number of the original bot:
-
4:46 - 4:511. Find the bot whose shell serial number
matches the stored number. -
4:51 - 4:542. Look inside its furnace.
-
4:54 - 4:593. Store that new number,
overwriting the old one. -
4:59 - 5:03Once the loop ends, we’ll know
that Hedge has found the 0 bot, -
5:03 - 5:06so he should upload the control program.
-
5:06 - 5:08So here’s what happens:
-
5:08 - 5:11Hedge only takes 5 repetitions
to find the original: -
5:11 - 5:16robot 733 has the 0 in its furnace.
-
5:16 - 5:18In a blink of a mechanical eye,
-
5:18 - 5:23the program spreads through the entire
army, and Adila takes control. -
5:23 - 5:26She has the furnace-bots
give off theatrical bouts of flame -
5:26 - 5:30to hide the fact that they’re now secretly
safe-guarding -
5:30 - 5:33all of that artistic output.
-
5:33 - 5:35Now that Ethic’s delivered
the furnace-bots, -
5:35 - 5:38Adila honors her end of the deal.
-
5:38 - 5:42She leads Ethic and Hedge
to the location of the first artifact, -
5:42 - 5:45the Node of Power.
-
5:45 - 5:48There, one thing is immediately clear:
-
5:50 - 5:52they’ll have to steal it.
- Title:
- The Furnace Bots | Think Like A Coder, Ep 3
- Speaker:
- Alex Rosenthal
- Description:
-
View full lesson: https://ed.ted.com/lessons/the-furnace-bots-think-like-a-coder-ep-3
This is episode 3 of our animated series “Think Like A Coder.” This 10-episode narrative follows a girl, Ethic, and her robot companion, Hedge, as they attempt to save the world. The two embark on a quest to collect three artifacts and must solve their way through a series of programming puzzles.
Lesson by Alex Rosenthal, directed by Kozmonot Animation Studio.
- Video Language:
- English
- Team:
- closed TED
- Project:
- TED-Ed
- Duration:
- 05:56
lauren mcalpine edited English subtitles for The Furnace Bots | Think Like A Coder, Ep 3 | ||
lauren mcalpine edited English subtitles for The Furnace Bots | Think Like A Coder, Ep 3 | ||
Elise Haadsma approved English subtitles for The Furnace Bots | Think Like A Coder, Ep 3 | ||
Elise Haadsma accepted English subtitles for The Furnace Bots | Think Like A Coder, Ep 3 | ||
lauren mcalpine edited English subtitles for The Furnace Bots | Think Like A Coder, Ep 3 |