The Furnace Bots Think Like A Coder Ep 3

Ethic and her robot Hedge agree
to help the resistance leader, Adila,

sabotage the art-incinerating
furnace-bots.

In exchange,

Adila promises to lead them
to the first object of Ethic’s quest,

an artifact called the Node of Power.

Years ago, there was just
one furnace-bot.

It had a 0 inside its furnace
and an unknown,

randomly generated serial number.

Over time, the original self-replicated
to produce more identical furnace-bots.

Each child inherited the original’s
unknown serial number within its furnace,

and had a random, unique serial
number of its own inscribed on its shell.

The second generation of furnace-
bots also self-replicated in the same way,

always passing their own serial
numbers to their offspring’s furnaces.

This continued on for many generations.

Today, each furnace-bot receives
its orders from its parent.

So if Ethic can find the original 0 bot
and somehow change its instructions,

she could take over
the entire army, all at once.

Adila has the perfect solution:

a data crystal that she’s
been carrying for years,

waiting for the right moment
to activate it.

It contains a program designed
to gain control of a bot

and give it new instructions.

But if it’s uploaded to any furnace-
bot other than the original,

the 0 bot will override
the instructions

and destroy the data crystal
in the process.

The feeding is just
a few minutes away,

and there’s only one
chance to get this right.

Fortunately, Hedge’s ability
to store data can help.

In programming,

a piece of information gets
stored in something called a variable.

Variables are basically containers that
hold onto numbers, words, or other values.

How does Ethic program Hedge to find
the original 0 bot as quickly as possible?

Pause now to figure it out for yourself.

Here’s a hint.

Programs can be written to have
as many variables as you need,

but you can solve this problem
with just one.

Hedge can use it to store
a serial number

and replace it with a new one
as often as he needs.

Pause now to figure it out for yourself.

A key insight here is that Hedge
doesn’t need to map out the entire

set of relationships to find
the original furnace-bot.

If, for example, he gets lucky and picks
the original one right away,

he’ll be done.

But if he starts with any other bot,

he can still find a path that leads
straight back to the 0-bot

by following a simple set of instructions.

To help craft them, let’s first
simplify the problem.

Let’s say there were only
three furnace-bots;

a parent and two children, but you don’t
know which is which.

You could have Hedge pick one
at random and look inside its furnace.

Now, you know the family tree
looks like this.

If the number inside the furnace is a 0,
you’ve found the parent.

If not, then no matter
which child you chose,

it must have the parent’s serial
number in its furnace.

So in this scenario, you’re guaranteed
to find the parent in one or two moves.

In actuality, there are many
furnace-bots,

and you don’t know how
many generations there are

nor what the family tree looks like.

But you don’t need to,

because Hedge can just keep repeating
the same sequence of actions

until he gets to the original.

How? With a loop.

Hedge can pick any bot at random,
look inside its furnace,

and store that serial
number as a variable.

Then he’ll begin the following
loop that will repeat

until the stored variable equals 0,

the furnace number of the original bot:

  1. Find the bot whose shell serial number
    matches the stored number.

  2. Look inside its furnace.

  3. Store that new number,
    overwriting the old one.

Once the loop ends, we’ll know
that Hedge has found the 0 bot,

so he should upload the control program.

So here’s what happens:

Hedge only takes 5 repetitions
to find the original:

robot 733 has the 0 in its furnace.

In a blink of a mechanical eye,

the program spreads through the entire
army, and Adila takes control.

She has the furnace-bots
give off theatrical bouts of flame

to hide the fact that they’re now secretly
safe-guarding

all of that artistic output.

Now that Ethic’s delivered
the furnace-bots,

Adila honors her end of the deal.

She leads Ethic and Hedge
to the location of the first artifact,

the Node of Power.

There, one thing is immediately clear:

they’ll have to steal it.

Ethic 和她的机器人 Hedge
同意帮助抵抗领袖 Adila

破坏艺术焚烧
炉机器人。

作为交换,

阿迪拉承诺将带领他们
前往 Ethic 追求的第一个目标,

一件名为“权力节点”的神器。

多年前,只有
一个熔炉机器人。

它的熔炉里有一个 0
和一个未知的

随机生成的序列号。

随着时间的推移,最初的自我
复制生产出更多相同的熔炉机器人。

每个孩子都继承
了熔炉内原件未知的序列号,

并在其外壳上刻有一个随机的、唯一的序列
号。

第二代熔炉
机器人也以同样的方式自我复制,

总是将自己的序列
号传递给后代的熔炉。

这种情况持续了好几代人。

今天,每个熔炉机器人都
从其父级接收订单。

因此,如果 Ethic 能够找到最初的 0 机器人
并以某种方式更改其指令,

她就可以立即
接管整个军队。

阿迪拉有一个完美的解决方案:

一个她
多年来一直携带的数据水晶,

等待合适的
时机激活它。

它包含一个
旨在控制机器人

并为其提供新指令的程序。

但是,如果它被上传到任何一个熔炉
机器人而不是原始的

,0 机器人将
覆盖指令


在此过程中破坏数据晶体。

喂食
距离酒店只有几分钟的路程,

而且只有一次
机会可以做到这一点。

幸运的是,Hedge
存储数据的能力可以提供帮助。

在编程中,

一条信息被
存储在一个叫做变量的东西中。

变量基本上是
保存数字、单词或其他值的容器。

Ethic 如何对 Hedge 进行编程以
尽快找到原始 0 机器人?

现在停下来自己弄清楚。

这是一个提示。

程序可以
写成你需要多少变量,

但你可以只用一个变量来解决这个问题

Hedge 可以使用它来
存储序列号,


根据需要随时更换新序列号。

现在停下来自己弄清楚。

这里的一个关键见解是,Hedge
不需要绘制整个

关系集来
找到原始熔炉机器人。

例如,如果他很幸运并立即选择
了原来的那个,

他就完成了。

但是,如果他从任何其他机器人开始,

他仍然可以

通过遵循一组简单的指令找到一条直接回到 0 机器人的路径。

为了帮助制作它们,让我们首先
简化问题。

假设只有
三个熔炉机器人;

一个父母和两个孩子,但你不
知道哪个是哪个。

您可以让 Hedge
随机挑选一个并查看其熔炉内部。

现在,你知道
家谱是这样的。

如果熔炉内的数字是 0,
则您找到了父级。

如果没有,那么无论
你选择哪个孩子,

它的炉子里都必须有父母的序列
号。

因此,在这种情况下,您可以保证
在一两步内找到父级。

实际上,熔炉机器人有很多

,你不知道
有多少代,

也不知道家谱是什么样的。

但你不需要这样做,

因为 Hedge 可以一直
重复相同的动作序列,

直到他到达原来的位置。

如何? 带一个循环。

Hedge 可以随机挑选任何机器人,
查看其熔炉内部,

并将该序列
号存储为变量。

然后他将开始以下
循环,该循环将重复

直到存储的变量等于 0,

即原始机器人的炉号:

  1. 找到外壳序列号
    与存储的编号匹配的机器人。

  2. 看看它的炉子里面。

  3. 存储新号码,
    覆盖旧号码。

一旦循环结束,我们就会
知道 Hedge 找到了 0 机器人,

所以他应该上传控制程序。

所以这就是发生的事情:

Hedge 只需要重复 5 次
就可以找到原件:

机器人 733 的熔炉里有 0。

眨眼间

,程序传遍了
全军,阿迪拉掌握了控制权。

她让熔炉机器人
散发出戏剧性的火焰

来掩盖他们现在秘密
保护

所有艺术作品的事实。

现在 Ethic 已经交付
了熔炉机器人,

阿迪拉很荣幸她完成了交易。

她带领 Ethic 和 Hedge
前往第一件神器

——权力节点的位置。

在那里,一件事立刻就清楚了:

他们必须偷走它。