Jump to content

Welcome to BrainDen.com - Brain Teasers Forum

Welcome to BrainDen.com - Brain Teasers Forum. Like most online communities you must register to post in our community, but don't worry this is a simple free process. To be a part of BrainDen Forums you may create a new account or sign in if you already have an account.
As a member you could start new topics, reply to others, subscribe to topics/forums to get automatic updates, get your own profile and make new friends.

Of course, you can also enjoy our collection of amazing optical illusions and cool math games.

If you like our site, you may support us by simply clicking Google "+1" or Facebook "Like" buttons at the top.
If you have a website, we would appreciate a little link to BrainDen.

Thanks and enjoy the Den :-)
Guest Message by DevFuse


Member Since 21 Jun 2012
Offline Last Active Sep 08 2012 10:14 PM

#321699 Classic eggs problem

Posted by jim on 09 July 2012 - 09:07 PM

Correction. Let h(k,m) be the height that can be handled with k eggs and up to m drops. Above I used a recursion of h(k,n) = h(k,n-1) + h(k-1,m) when I should have used a slightly different formula. Let the base at any time be the highest known safe floor. With k eggs and m drops left we can afford to skip h(k-1,m-1) floors and do our next drop at base + h(k-1,m-1) + 1. When an egg breaks the base remains the same and both k and m decrease by 1. If the egg doesn't break, increase the base by h(k-1,m-1) + 1 and then decrease just m by 1.

h(1,m) = m where start dropping at the lowest floor and work upwards one at a time.

h(2,m) = (m-1)+1 + (m-2)+1 + ... + (m-m)+1 = SUM of m, m-1, m-2, ...1 = m(m+1) / 2

h(3,m) = (m-1)m/2 +1 + (m-2)(m-1)/2+1 + ... = SUM (1/2)j^2 - (1/2)j +1 for j from 1 to m and we get
(1/12)m(m+1)(2m+1) - (1/4)m(m+1) + m = (1/6)(m^3 -m) + m = (1/6)(m-1)m(m+1) + m. so 8 is not enough bu 9 drops would let us go as high as 120 + 9 which is enough.
  • 1