Doubt from mock beta LR

A building has 50 floors. There is some unknown floor, possibly none, at or above which an egg breaks when dropped, and below which it never breaks. You have two identical eggs. An unbroken egg can be dropped again, but a broken one cannot.

You use a strategy that guarantees finding the lowest floor from which an egg breaks, or showing that none does, in the least possible number of drops in the worst case.

From which one of the following floors could your first drop be made?

11

7

4

14

Can anyone please help me with this question?

1

Please log in to comment and participate in discussions.

Comments (1)

Every time your first egg survives a drop, you have used up 1 drop from your total budget.

For example, lets say you have a budget of 4 drops to see how this works in act:

Drop 1 (Floor 4): You jump 4 floors.

If it breaks: You have 3 drops left to check floors 1, 2, and 3 one by one. (1 + 3 = 4 drops total).

If it survives: You have 3 drops left, so your next jump can only be 3 floors.

Drop 2 (Floor 7, which is 4 + 3):

If it breaks: You have 2 drops left to check floors 5 and 6 one by one. (2 + 2 = 4 drops total).

If it survives: You have 2 drops left, so your next jump can only be 2 floors.

Drop 3 (Floor 9, which is 7 + 2):

If it breaks: You have 1 drop left to check floor 8. (3 + 1 = 4 drops total).

If it survives: You have 1 drop left, so your final jump can only be 1 floor.

Drop 4 (Floor 10, which is 9 + 1): You check floor 10. (4 drops total).

Look at the floors we covered with a 4-drop budget: 4 + 3 + 2 + 1 = 10 floors

The goal is to guarantee finding the breaking floor in a 50-story building with two eggs in the worst-case minimum number of drops.

So, 9 drops can cover at most 45 floors (9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1), while 10 drops can cover up to 55 floors (10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1). Since the building has 50 floors, you need a worst-case budget of 10 drops.

Now check the first-drop options:

First dropWhat could go wrong?
11If it breaks, checking floors 1–10 could take 10 more drops: 11 total.
7If it breaks, checking floors 1–6 takes at most 6 more drops. If it survives, 43 floors remain, and the remaining 9 drops can handle up to 45 floors. Works.
4If it survives, 46 floors remain, but the remaining 9 drops can handle only 45.
14If it breaks, checking floors 1–13 could take 13 more drops: 14 total.

Hence, the first drop could be made from floor 7.

2