You are given 2 Easter eggs. You have access to a 100-storey building. These eggs are either hard or very fragile, meaning you may or may not break them when they fall. Both eggs, are however, identical. You now are tasked with figuring out the highest floor you can drop the egg from without it breaking, you are only able to break 2 eggs in the process. How many drops will be needed?

Respuesta :

You must begin at storey 2.

If you begin at storey 3, the first egg may crack, and then you must go to either storey 1 or storey 2 to check the next egg.  If the egg doesn't crack on storey 1, you don't know if it can survive at storey 2.  If the egg does crack on storey 2, you don't know if it can't survive storey 1.  This is the same for any higher storeys.

If you begin at storey 1 and the egg does not crack, you must check storey 2.  If it cracks on storey 2, you should have started there to save a drop.  If it doesn't crack on storey 2, there was no point to starting on storey 1.

To guarantee success, you must start on storey 2 or 1.  If the egg lasts until floor 100, you have dropped the eggs 99 times if you started on storey 1, and 98 times if you started on storey 2.

Moral of the story: start on storey 2; guarantee success; drop eggs a maximum of 98 times.