title: Generalised Two-Egg Puzzle
body: <p>Here is the Problem Description :</p>
  
  <p>Suppose that we wish to know which stories in a N-story building are safe to drop eggs from, and which will cause the eggs to break on landing. We make a few assumptions:
  An egg that survives a fall can be used again.</p>
  
  <ul>
  <li>A broken egg must be discarded.</li>
  <li>The effect of a fall is the same for all eggs.</li>
  <li>If an egg breaks when dropped, then it would break if dropped from a higher window.</li>
  <li>If an egg survives a fall then it would survive a shorter fall.</li>
  <li>It is not ruled out that the first-floor windows break eggs, nor is it ruled out that the  Nth-floor windows do not cause an egg to break.</li>
  </ul>
  
  <p>Given an N story building and a supply of d eggs, ﬁnd the strategy which minimizes (in the worst case) the number of experimental drops required to determine the breakﬂoor.</p>
  
  <hr>
  
  <p>I have seen and solved this problem for 2 eggs where answer comes out to be 14 for N=100.
  I tried to understand the generalized solution from wiki using DP but couldn't Understand what are they trying to do. Please tell how they arrived at the DP and how it is working ?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>The Recurrence given in <a href="http://www.scribd.com/api_user_11797_WebGuru/d/7217370-Egg-Puzzle-Generalized-Solution-for-Any-Number-of-Eggs">this</a> Article for the The highest ﬂoor that can be tested with d drops and e eggs is as follows :</p>
  
  <pre><code>f[d,e] = f[d-1,e] + f[d-1,e-1] + 1
  </code></pre>
  
  <p>The recurrence is fine but i not able to understand how it is derived ?</p>
  
  <p>The explanation is not clear to me....i just want someone to explain this recurrence to me in more clear words.</p>