Can you solve the egg drop riddle Yossi Elran

The city has just opened its
one-of-a-kind Fabergé Egg Museum

with a single egg displayed on each floor
of a 100-story building.

And the world’s most notorious jewel thief
already has her eyes on the prize.

Because security is tight
and the eggs are so large,

she’ll only get the chance to steal one

by dropping it out the window
into her waiting truck

and repelling down
before the police can arrive.

All eggs are identical in weight
and construction,

but each floor’s egg is more rare
and valuable than the one below it.

While the thief would naturally like
to take the priceless egg at the top,

she suspects it won’t survive
a 100-story drop.

Being pragmatic, she decides to settle
for the most expensive egg she can get.

In the museum’s gift shop,
she finds two souvenir eggs,

perfect replicas
that are perfectly worthless.

The plan is to test drop them

to find the highest floor
at which an egg will survive the fall

without breaking.

Of course, the experiment
can only be repeated

until both replica eggs are smashed.

And throwing souvenirs out the window
too many times

is probably going to draw
the guards' attention.

What’s the least number of tries
it would take

to guarantee that
she find the right floor?

Pause here if you want
to figure it out for yourself!

Answer in: 3

Answer in: 2

Answer in: 1

If you’re having trouble getting started
on the solution,

it might help to start
with a simpler scenario.

Imagine our thief only
had one replica egg.

She’d have a single option:

To start by dropping it
from the first floor

and go up one by one until it breaks.

Then she’d know that the floor below that

is the one she needs
to target for the real heist.

But this could require
as many as 100 tries.

Having an additional replica egg
gives the thief a better option.

She can drop the first egg from different
floors at larger intervals

in order to narrow down the range
where the critical floor can be found.

And once the first breaks,

she can use the second egg to explore
that interval floor by floor.

Large floor intervals don’t work great.

In the worst case scenario, they require
many tests with the second egg.

Smaller intervals work much better.

For example, if she starts by dropping
the first egg from every 10th floor,

once it breaks, she’ll only have to test
the nine floors below.

That means it’ll take at most
19 tries to find the right floor.

But can she do even better?

After all, there’s no reason
every interval has to be the same size.

Let’s say there were only ten floors.

The thief could test this whole building
with just four total throws

by dropping the first egg
at floors four,

seven,

and nine.

If it broke at floor four, it would take
up to three throws of the second egg

to find the exact floor.

If it broke at seven,

it would take up to two throws
with the second egg.

And if it broke at floor nine,

it would take just one more
throw of the second egg.

Intuitively, what we’re trying to do here
is divide the building into sections

where no matter which floor is correct,

it takes up to the same number
of throws to find it.

We want each interval to be one floor
smaller than the last.

This equation can help us solve
for the first floor we need to start with

in the 100 floor building.

There are several ways
to solve this equation,

including trial and error.

If we plug in two for n,
that equation would look like this.

If we plug in three, we get this.

So we can find the first n to pass 100

by adding more terms
until we get to our answer,

which is 14.

And so our thief starts on the 14th floor,

moving up to the 27th,

the 39th,

and so on,

for a maximum of 14 drops.

Like the old saying goes, you can’t
pull a heist without breaking a few eggs.

该市刚刚开设
了独一无二的法贝热彩蛋博物馆

,一栋 100 层建筑的每一层都展示了一个彩蛋

世界上最臭名昭著的珠宝窃贼
已经盯上了这个奖品。

由于安保措施严密
,而且鸡蛋又大又大,

她只有通过将

鸡蛋从窗外
扔到等候的卡车中


在警察到达之前将其击退,才有机会偷走一个。

所有鸡蛋的重量
和结构都相同,

但每一层的鸡蛋都比它下面的鸡蛋更稀有
和有价值。

虽然小偷很自然地
想从顶部拿走这颗无价之宝,

但她怀疑它无法在
100 层楼的跌落中幸存下来。

务实,她决定
满足于她能得到的最昂贵的鸡蛋。

在博物馆的礼品店里,
她发现了两个纪念品鸡蛋,

完美的复制品
,一文不值。

计划是测试掉落它们,

以找到鸡蛋在坠落中幸存而

不会破裂的最高楼层。

当然,只能重复实验,

直到两个复制蛋都被打碎。

把纪念品扔出窗外

多次可能会
引起警卫的注意。

保证她找到正确楼层的最少尝试次数是

多少?

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

回答:3

回答:2

回答:1

如果您在开始
使用解决方案

时遇到困难,从更简单的方案开始可能会有所帮助

想象一下,我们的小偷
只有一个复制蛋。

她只有一个选择

:先从

一楼放下它,然后一个接一个地往上走,直到它坏掉。

然后她就会知道下面的地板

是她
真正抢劫的目标。

但这可能需要
多达 100 次尝试。

拥有一个额外的复制蛋
给了小偷一个更好的选择。

她可以以更大的间隔从不同楼层掉落第一个鸡蛋

,以缩小
可以找到关键楼层的范围。

而一旦第一个破门,

她就可以用第二个蛋逐层探索
那个区间。

大的楼层间隔效果不佳。

在最坏的情况下,他们需要
对第二个鸡蛋进行多次测试。

较小的间隔工作得更好。

例如,如果她开始
从每 10 层掉落第一个鸡蛋,

一旦鸡蛋破裂,她只需测试
下面的 9 层。

这意味着最多需要
19 次尝试才能找到合适的楼层。

但她还能做得更好吗?

毕竟,没有理由
每个间隔都必须是相同的大小。

假设只有十层。

小偷

在四楼、七楼

和九楼丢下第一个鸡蛋,总共只扔了四次就可以测试整栋楼。

如果它在四楼破裂,则
需要投掷第二个鸡蛋三遍

才能找到确切的楼层。

如果它在七点破,第二个鸡蛋

最多需要两次投掷

如果它在九楼摔坏了,

它只需要再
扔第二个鸡蛋。

直观地说,我们在这里试图做的
是将建筑物分成几个部分

,无论哪一层是正确的,

都需要相同
的投掷次数才能找到它。

我们希望每个间隔
都比上一个小一层。

这个方程可以帮助我们
求解我们需要从 100 层楼开始的第一层

有几种方法
可以解决这个等式,

包括反复试验。

如果我们为 n 代入两个,则
该等式将如下所示。

如果我们插入三个,我们就会得到这个。

因此,我们可以通过添加更多项来找到第一个超过 100 的 n,

直到我们得到答案,

14。所以我们的小偷从 14 楼开始,

向上移动到 27 楼

、39 楼,

依此类推

, 最多 14 滴。

就像那句老话,你
不能不打碎几个鸡蛋就抢劫。