If egg breaks we one by one try remaining 13 floors.
Egg drop floor puzzle.
The reason being if it breaks at 32nd floor we can try all the floors from 17 to 31 in 14 drops total of 16 drops.
If the egg breaks the nth floor is between 49 and 2 if not we know the nth floor is between 51 and 99 we know the egg will not break if dropped from the first floor because it is the minimum distance you can drop the egg and we know that the egg will break at floor 100 the maximum distance you can drop the egg.
If the floor is in the 1 10 range we could discover it in 2 10 drops.
Suppose that we wish to know which stories in a 36 story building are safe to drop eggs from and which will cause the eggs to break on landing.
This problem has many applications in the real world such as avoiding a call out to the slow hdd or attempting to minimize cache misses.
The physical properties of the ideal egg is such that it will shatter if it is dropped from floor n n n or above and will have no damage whatsoever if it is dropped from floor n 1 n 1 n 1 or below.
Start from the 10th floor and go up to floors in multiples of 10 if first egg breaks say at 20th floor.
In this case the worst case number of drops is 19.
If the first trial breaks the first egg there will be 2 remaining eggs with 3 trials which according to the above.
What strategy should be taken in order to minimize the number of egg drops used to find floor n the threshold floor for the egg.
Attempt 2 assume the egg broke when dropped from the 50th floor drop the egg from the 3rd.
For example if the floor were 83 again we would drop the first egg at floor 10 20 30 40 50 60 70 80 and then 90 where it would break.
The problem is to find a strategy such that the egg dropper can determine the floor n n n in as few egg drops as possible.
If egg doesn t break we go to 27th floor.
If it breaks by dropping from the 7th floor we will follow the strategy for testing a 6 floor building with 2 eggs in 3.
Egg dropping puzzle dp 11 last updated.
But once an egg is dropped from a floor above it s threshold floor here is the puzzle.
You want to classify each floor as either an egg breaking floor or a non egg breaking.
Each floor of a 100 story building has a balcony over which you can drop an egg and watch it hit the ground.
X x 1 x 2 x 3.
The egg either breaks or survives the fall and if it survives it can be used again for another drop.
1 100 x x 1 2 100 x 13 651 therefore we start trying from 14 th floor.
If the threshold was 99th floor then you would have to drop th.
Also what is the minimum number of drops for the worst case using this strategy.
Then you can check all the floors between 11th and 19th with the second egg to see which floor it will not break.
12 06 2020 the following is a description of the instance of this famous puzzle involving n 2 eggs and a building with k 36 floors.
How about egg dropping puzzle with 3 eggs.
If an egg.
Here s a classic puzzle.
We would then use the second egg in the new range 81 90 finding floor 83 in 3 more drops.
If egg breaks on 27 th floor we try floors form 15 to 26.
First we drop from height 16 and if it breaks we try all floors from 1 to 15 if the egg don t break then we have left 15 drops so we will drop it from 16 15 1 32nd floor.