tag:blogger.com,1999:blog-7955003209126272036.post2994298627509629560..comments2020-05-25T19:58:55.433+05:30Comments on Geek Explains: Java, J2EE, Oracle, Puzzles, and Problem Solving!: Puzzle: 2 crystal balls, 100 storey building, find no. of drops required?Geekhttp://www.blogger.com/profile/00648920090539126396noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-7955003209126272036.post-7872082126660844362012-02-07T00:58:16.099+05:302012-02-07T00:58:16.099+05:30Very similar problem:
http://pratikpoddarcse.blog...Very similar problem: <br /><a href="http://pratikpoddarcse.blogspot.in/2012/02/original-problem-atm-money-withdrawal.html" rel="nofollow">http://pratikpoddarcse.blogspot.in/2012/02/original-problem-atm-money-withdrawal.html</a>Pratik Poddarhttps://www.blogger.com/profile/11577606981573330954noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-88374466704357032542009-10-28T23:43:38.883+05:302009-10-28T23:43:38.883+05:30An effort from you to elaborate your solution li&#...An effort from you to elaborate your solution li'l more will be highly appreciated. Thanks for your participation.Geekhttps://www.blogger.com/profile/00648920090539126396noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-41643356060737002512009-10-28T13:31:19.046+05:302009-10-28T13:31:19.046+05:30Lets say that I would drop at f(m) when I am dropp...Lets say that I would drop at f(m) when I am dropping for the m_th time without breaking.<br /><br />So, we know m + f(m) - f(m-1) - 1 = 1 + f(1) -1 for all m<br /><br />So, when going to 100, we would see that its the last number..<br />So, for m = f(1), f(m) >= 100 {or nfloors in general case}<br /><br />f(2) = 2f(1)-1<br />f(3) = f(2) + f(1) -2<br />f(4) = f(3) + f(1) -3<br />...<br /><br /Pratik Poddarhttps://www.blogger.com/profile/11577606981573330954noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-17053140262736971732009-10-09T20:38:50.660+05:302009-10-09T20:38:50.660+05:30I guess you probably misinterpreted the puzzle. Le...I guess you probably misinterpreted the puzzle. Let me put it differently, it asks you to use the most efficient way to find the maximum number of drops you would need even in the worst case i.e., it asks you to devise a strategy in which you would need the least (that's because you got to find the 'most efficient' app) number of drops to find the correct floor in any possible Geekhttps://www.blogger.com/profile/00648920090539126396noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-77305322017924723902009-09-21T09:38:32.274+05:302009-09-21T09:38:32.274+05:30I think it is worst case 50, best case 7. Here i...I think it is worst case 50, best case 7. Here is why... Think of it as an array I would want to divide each time as long as the ball did not break. So if I divide (100 / 2 = 50) and the ball breaks, bummer I have to go all the way down to up up to 50 to see if it breaks again and I may have to go all the way to 49 (that's 50 worst case). But if it does not break at 50 I would divide Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-10131202063464567142008-09-07T17:08:00.000+05:302008-09-07T17:08:00.000+05:30The formula certainly fits in this case. But, it'l...The formula certainly fits in this case. But, it'll be great if you can share how actually did you reach to this formula. Keep visiting/posting!Geekhttps://www.blogger.com/profile/00648920090539126396noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-38032537486130474512008-08-29T21:47:00.000+05:302008-08-29T21:47:00.000+05:30There is an easy formula. With 2 crystal balls and...There is an easy formula. With 2 crystal balls and 'n' floors, root(2*n) is the max no. of attempts.Anonymousnoreply@blogger.com