Suppose u start from x floor. Two cases arise...the egg breaks or it does not. If it does....then u have to move linearly from first floor. till x-1 floor..................Max attempts reqd. = x
If it does not break.....take a jump of x-1 because ur number of attempts has already increased by1. .........................Max. attempts reqd. =x . . . . . . . so taking jumps u have..... 1+2+.......x-1 + x>=100 or x(x+1)/2 >100 ................now find min value of x. Aseem On Wed, Jul 6, 2011 at 11:18 PM, TIRU REDDY <[email protected]> wrote: > s(s+1)/2 must be close to 100. > The best possible number is 14. > > try from 14th floor. > next from 14+13th floor. > next from 14+13+12th floor. > .... > > Worest case number of attempts = 14. > Best Regards, > T V Thirumala Reddy > Engineer, Qualcomm India Private Ltd. > 1540C30, 15th Floor, Building #9, Mindspace, Hitech city, Madhapur, > Hyderabad-81. > > > > On Wed, Jul 6, 2011 at 11:14 PM, Sriganesh Krishnan <[email protected]>wrote: > >> @tiru and @aseem: explanation pls...! >> >> >> On Wed, Jul 6, 2011 at 11:11 PM, TIRU REDDY <[email protected]> wrote: >> >>> 14 >>> >>> On 6 Jul 2011 22:35, "shiv narayan" <[email protected]> wrote: >>> >>> >>> * You are given 2 eggs. >>> * You have access to a 100-storey building. >>> * Eggs can be very hard or very fragile means it may break if dropped >>> from the first >>> floor or may not even break if dropped from 100 th floor.Both eggs are >>> identical. >>> >>> * You need to figure out the highest floor of a 100-storey building an >>> egg can be >>> dropped without breaking. >>> * Now the question is how many drops you need to make. You are allowed >>> to break 2 >>> eggs in the process >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
