You are given access to a 100-storey building and an infinite number of eggs. The eggs are identical.
The aim is to find out the highest floor from which an egg will not break when dropped out of a window from that floor. If an egg is dropped and does not break, it is undamaged and can be dropped again. However, once an egg is broken, that’s it for that egg.
If an egg breaks when dropped from floor n, then it would also have broken from any floor above that. If an egg survives a fall, then it will survive any fall shorter than that.
Adopting the best strategy, what is the absolute minimum number of egg drops that you need to reach the solution given any scenario (Including worst case)?
Details and Assumptions : - Issues related to terminal velocity, potential energy or wind resistance are immaterial.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
First we go to floor 5 0 and drop an egg. It either breaks, or it does not. The result of this drop reduces our problem in half.
If it breaks, we know the solution lies in the bottom half of the building viz floor 1 − 4 9 . If it survives, we know the solution is in the top half of the building viz floor 5 1 − 1 0 0 ) . On each drop, we keep dividing the problem in half and half again until we get to our solution.
Number of drops required for this solution is l o g 2 n , where n is the number of floors of the building.
Because this building does not have a number of floors equal to a round number power of two, we need to round up to number of drops to get seven ( l o g 2 1 0 0 = 6 . 6 4 4 ) .