1

Hey guys so there is this famous problem, about a building and eggs I'm going to copy the question from the other thread:

You are given two eggs, and access to a 100-story building. Both 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.

However I am much more interested in how to solve this problem with the concept of entropy. I can kind of get my head around that at every point in time you need to drop the egg so that the binary signal "break/don't break" gives maximum information. So my question is, how can we formalize this basic intuition and solve the problem using entropy.

Dio
  • 323
  • 1
  • 9
  • Your conditions and terms in the context of the problem are not defined well enough for any meaningful answer. – fleablood May 09 '18 at 05:03

1 Answers1

2

I have noticed your question not so long ago while looking for an answer to a question similar to yours. I was interested in how to devise an optimal strategy for picking floors for dropping eggs by maximizing the entropy. Funny how a similar thought crystallized in separate places at almost the same time. I did not find the answer though and see that there were no responses here, so let me share my thoughts on this for a lack of anything better.

I found a way of computing the entropy, which can be seen as a useful test for a proper solution if it ever comes by. It also shows that there a solution for the entropy exists, but possibly in terms of special functions. This solution also showed me that the problem is far from trivial and will require more thought than I can invest for now.

In this problem, the entropy can be thought of as the smallest number of yes/no questions that reveal the number of the first floor where the egg doesn't break if we are given $N$ eggs. The problem can be solved by recursion in the spirit of this post.

Lets denote the distance we can explore with the said number of eggs in $t$ trials as $d_N(t)$. If we have $F$ floors, then the ceiling integer of the positive root of $d_N(t_H) = F$ is the answer. It is not evident that there will be only one of those, but lets roll with it. I have also added an index $H$ in the last expression to indicate that this $t_H$ is the entropy for given $N$ and $F$.

For the case of $N=1$, all is pretty simple. We have 1 egg, so we have to test 1 floor at a time and $d_1(t) = t$, which is one of terminating relations to the recursion I am about to introduce. The second one is $d_N(t) = d_t(t)$ when $N > t$, i.e. a situation occurs that we have more eggs than we could possibly need.

For $N$ eggs, we have $d_N(t) = 1 + d_{N-1}(t-1) + d_{N}(t-1)$. Please read the blog post referenced above for the intuition behind it.

Let me say as a small digression that in the $N > t$ case, one naturally gets the logarithmic search: $$d_N(t) = d_t(t) =\\ 1 + d_{t-1}(t-1) + d_{t}(t-1) =\\ 1 + d_{t-1}(t-1) + d_{t-1}(t-1) =\\ 1 + 2d_{t-1}(t-1) =\\ 1 + 2(1 + 2d_{t-2}(t-2)) = ...= 2^t -1.$$ Solving $2^{t_H} -1 = F$ for $t_H$, we get $t_H = \log_2{(F-1)}$.

Getting back to $N < t$, the best thing I came up with now was unpack the recursion relations for a few more eggs until a pattern emerged. Being very slow to catch on, I had to go up until 5... I will not test your patience and will just give the final answer. It is expressed as $$d_N(t) = \frac{1}{N!}(t)_N + \sum_{i=1}^{N-1}\frac{2^{i-1}}{(N-i)!}(t-i)_{N-i} + 2^{N-1} - 1,$$ where $(t)_N$ is the falling factorial. Solving $d_N(t_H) = F$ gives the entropy for arbitrary $N$ and $F$. The resulting polynomial can be expressed in terms of Bernoulli polynomials or Hurwitz zeta functions. I tested this numerically and the answers match the tabulated answers in this post.

I realize that I got very wordy and did not answer your question precisely. I hope though that I showed that the entropy can be found for this problem in terms of special functions and that it will be a hairy expression.

J.K.
  • 270