For example if the property of the eggs is that n equals 15 those eggs will always break on any floor higher than or equal to the 15th floor but those eggs will never break on any floor below floor 15.
Check which floors to break eggs from.
Ensure the nest boxes are designed correctly.
If egg breaks on 27 th floor we try floors form 15 to 26.
If egg breaks we one by one try remaining 13 floors.
The optimal number of trials is 14 in worst case.
Raising a nest box slightly can make a distinction between that and the floor.
Consider the size but also the height of the box.
Then you should start at the x th x text th x th floor because if the egg breaks you will have to check floors 1 2 3 x 2 1 2 3 ldots x 2 1 2 3 x 2 and x 1 x 1 x 1 so the total number of drops will be x x x.
In either case we have to do the job from downward to upwards.
An egg eating vice is also easily started in the flock when eggs are laid on the floor so laying on the floor needs to be avoided.
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.
See below for programming solution for general k eggs and n floors.
We can notice that if we choose 4th floor as first floor 7 th as next floor and 9 as next of next floor we never exceed more than 4 trials.
What this means is that the egg will not break when dropped from any floor below floor n but the egg will definitely break from any floor above floor n including floor n itself.
2 if egg does not break we try next from 7 th floor.
If egg doesn t break we go to 27th floor.
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.
I think we should start from 50the floor if the first egg breaks we have to check lower 50 floors otherwise upper 50 floors.
If it is dropped from that.
If egg doesn t break on 27 th floor we go to 39 th floor.
A building has 100 floors.
Again two cases arise.
If it doesn t break you will have to check the x x 1 th big x x 1 big text th x x 1 th floor.