title: Three egg proble​m
body: <p>I was just reading <a href="http://www.datagenetics.com/blog/july22012/index.html" rel="noreferrer">The Two Egg Problem</a>:</p>
  <blockquote>
  <p><strong>The Two Egg Problem</strong></p>
  <p>You are given two eggs, and access to a 100-storey 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.</p>
  <p>If an egg breaks when dropped from floor <code>n</code>, 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.</p>
  <p>The question is: <em>What strategy should you adopt to minimize the number egg drops it takes to find the solution?</em>. (And what is the worst case for the number of drops it will take?)</p>
  </blockquote>
  <p>I was following along until the &quot;Look see I can do three&quot; section. The author states that after the first egg breaks it degrades into the 2-egg problem and can be solved recursively.</p>
  <p>That's great, but wouldn't we want to choose larger step-sizes when using 3 eggs instead of 2 (for the first egg)? From which floor do we throw the first egg?</p>
  <p>With 1 egg, we have to start at floor 1.<br />
  With 2 eggs, we solve for <code>n(n+1)/2=k</code> and round up, where <code>n</code> is the starting floor, and <code>k</code> is the number of floors.<br />
  With 3... I'm having trouble coming up with a formula.</p>
  <hr />
  <p>Thinking about this a bit more, with 2 eggs, the maximum number of drops is equal to the floor number that we drop our first egg from. For example, with 2 eggs and 100 floors, the solution is 14, which means we drop the first egg from floor 14, and if it breaks, we have to drop up to 13 more times, for floors 1-13.</p>
  <p>With 3 eggs, the solution is 9 (as shown in the chart). But we wouldn't want to throw the first egg at floor 9, we can throw it higher, because we don't have to iterate by 1s in-between.</p>
  <p>If we throw from floor 14 again, and it breaks, then we recurse. <code>n(n+1)/2=k</code> where <code>k</code> is now 13... but that gives us 4.815, if we ceil and that and add our previous drop we get 6, which is lower than the actual solution, so something here is wrong...</p>
  <hr />