10

1

This is exercise problem 1.4.24 from Robert Sedgewick's Algorithms 4th Edition.

```
Suppose that you have an N-story building and plenty of eggs. Suppose also that
an egg is broken if it is thrown off floor F or higher, and unhurt otherwise.
First, devise a strategy to determine the value of F such that the number of
broken eggs is ~lgN when using ~lgN throws, then find a way to reduce the cost to
~2lgF.
```

While the `lgN`

solution is easy to think up, I totally have no idea about the `2lgF`

solution. Anyway, we are not given the value of `F`

, so where the ground of `2lgF`

solution is?

Can anyone give some light on this question? Thanks.

it's a search problem given an ordered set. maybe that helps :). – Randy – 2013-07-01T12:38:08.553

Hay Randy, any links or further reading? – Guibao Wang – 2013-07-01T12:39:39.103

Do binary search on the building, drop from n/2 floor, if it is broken, then go down which is n/4 and so one. So u may break at most lgN eggs and will get to that point in lgN steps – Elbek – 2013-07-01T12:41:40.287

possible duplicate of Generalised Two-Egg Puzzle

– David Eisenstat – 2013-08-03T00:39:11.277