The following is a description of the instance of this famous puzzle involving 2 eggs and a building with 100 floors.
1 egg 100 floors.
A building has 100 floors.
Second thought is to try xth floor then 2xth floor till 100th in this case worst case time will be 100 x x 1.
2 eggs 100 floors worst case solution.
What strategy should be used to drop eggs such that total number of drops in worst.
In 100 x x 1 equation with increase in x 100 x decreases while x 1 increases thus we can minimize it when 100.
It occurs when the egg survives 98 floors.
If an egg is dropped from above that floor it will break.
If it is dropped from that.
The solution for the worst case in this scenario occurs when the threshold floor is floor number 14 because we will drop the first egg on floor 14 and it will break.
One of the floors is the highest floor an egg can be dropped from without breaking.
Instead of taking equal intervals we can decrease the.
Now for the ultimate method.
Then we have to test floors 1 13 with the 2nd egg to see where the egg breaks again and the egg will not break on any of those floors.
That leaves us with just floor n 1 to try with the second egg.
Worst case will be when egg 1 breaks at 100th floor then we have to try egg 2 from 100 x th to 99th floors.