<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Interview Questions: Two Bowling Balls</title>
	<atom:link href="http://20bits.com/articles/interview-questions-two-bowling-balls/feed/" rel="self" type="application/rss+xml" />
	<link>http://20bits.com/articles/interview-questions-two-bowling-balls/</link>
	<description>Driven by Data</description>
	<lastBuildDate>Wed, 28 Jul 2010 21:50:46 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Varvaroushka</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-4843</link>
		<dc:creator>Varvaroushka</dc:creator>
		<pubDate>Tue, 09 Feb 2010 03:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-4843</guid>
		<description>Oh no worries, hamburger flipping positions screen more against physical limitations...you know, as opposed to intellectual? (felt the need to clarify just in case)</description>
		<content:encoded><![CDATA[<p>Oh no worries, hamburger flipping positions screen more against physical limitations&#8230;you know, as opposed to intellectual? (felt the need to clarify just in case)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David B</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-4153</link>
		<dc:creator>David B</dc:creator>
		<pubDate>Thu, 12 Mar 2009 22:38:40 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-4153</guid>
		<description>Well, the biggest problem I have with the entire problem is that you&#039;re missing a very pressing point. You only have two balls. If you drop even one ball one floor, you&#039;re fracturing the structure of the ball, and as such, weakening it. My biggest concern wouldn&#039;t be how many tries it takes, but to test the resilience of the ball and find the maximum height at which you could drop it and have it still maintain its integrity, then convert that to &#039;floors high&#039; - Great question though!</description>
		<content:encoded><![CDATA[<p>Well, the biggest problem I have with the entire problem is that you&#39;re missing a very pressing point. You only have two balls. If you drop even one ball one floor, you&#39;re fracturing the structure of the ball, and as such, weakening it. My biggest concern wouldn&#39;t be how many tries it takes, but to test the resilience of the ball and find the maximum height at which you could drop it and have it still maintain its integrity, then convert that to &#39;floors high&#39; &#8211; Great question though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sarafoster</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-4152</link>
		<dc:creator>sarafoster</dc:creator>
		<pubDate>Thu, 12 Mar 2009 19:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-4152</guid>
		<description>ohh Math .. I think its so much puzzling Question</description>
		<content:encoded><![CDATA[<p>ohh Math .. I think its so much puzzling Question</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-3985</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Tue, 02 Dec 2008 21:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-3985</guid>
		<description>anyone take into account the acceleration of the ball.&lt;br&gt;&lt;br&gt;The speed of the ball is the key to when it breaks, and it goes as sqrt(h).&lt;br&gt;So one should take that into account when sampling (i.e. sample not every S floors,&lt;br&gt;but make it a uniform stride in impact velocity).&lt;br&gt;&lt;br&gt;from a physics point of view, questions are not asked to see the result, but&lt;br&gt;how one thinks about things.  Including discussions of important factors &lt;br&gt;like:&lt;br&gt;&lt;br&gt;climbing up stairs, terminal velocity, the quick solution, the optimal solution,&lt;br&gt;accumulated wear on the ball, insuring zero initial velocity, using non-integer floors&lt;br&gt;by allowing a small initial downward velocity, or tossing the ball up halfway between floors, &lt;br&gt;repeatability of the experiment, are the balls identical, why aren&#039;t the windows locked, measuring&lt;br&gt;the temperature while doing the experiment, effect of Coriolis force on the ball, etc</description>
		<content:encoded><![CDATA[<p>anyone take into account the acceleration of the ball.</p>
<p>The speed of the ball is the key to when it breaks, and it goes as sqrt(h).<br />So one should take that into account when sampling (i.e. sample not every S floors,<br />but make it a uniform stride in impact velocity).</p>
<p>from a physics point of view, questions are not asked to see the result, but<br />how one thinks about things.  Including discussions of important factors <br />like:</p>
<p>climbing up stairs, terminal velocity, the quick solution, the optimal solution,<br />accumulated wear on the ball, insuring zero initial velocity, using non-integer floors<br />by allowing a small initial downward velocity, or tossing the ball up halfway between floors, <br />repeatability of the experiment, are the balls identical, why aren&#39;t the windows locked, measuring<br />the temperature while doing the experiment, effect of Coriolis force on the ball, etc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hotball</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-3982</link>
		<dc:creator>Hotball</dc:creator>
		<pubDate>Thu, 27 Nov 2008 09:32:04 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-3982</guid>
		<description>This problem is recursive in nature. Basically, if you drop a ball at floor k, and it breaks, then you reduce the problem to one less ball with floor k -1. On the other hand, if it does not break, the problem becomes the same number of balls but with floor n - k.&lt;br&gt;&lt;br&gt;So, basically this problem can be solved with dynamic programming, by optimizing this:&lt;br&gt;&lt;br&gt;F(m, n) = 1 + max(F(m-1, k-1), F(m, n-k)) for k = 1.. n&lt;br&gt;&lt;br&gt;Running this on F(2, 100) can show that 14 is indeed the optimal solution. This should be able to changed to optimize for the average case, not the worst case.&lt;br&gt;&lt;br&gt;What&#039;s interesting is that (if my program is correct) it only takes 5 balls to achieve 7 steps (which is the best possible number of steps, since 2^6 &lt; 100 and 2^7 &gt; 100).</description>
		<content:encoded><![CDATA[<p>This problem is recursive in nature. Basically, if you drop a ball at floor k, and it breaks, then you reduce the problem to one less ball with floor k -1. On the other hand, if it does not break, the problem becomes the same number of balls but with floor n &#8211; k.</p>
<p>So, basically this problem can be solved with dynamic programming, by optimizing this:</p>
<p>F(m, n) = 1 + max(F(m-1, k-1), F(m, n-k)) for k = 1.. n</p>
<p>Running this on F(2, 100) can show that 14 is indeed the optimal solution. This should be able to changed to optimize for the average case, not the worst case.</p>
<p>What&#39;s interesting is that (if my program is correct) it only takes 5 balls to achieve 7 steps (which is the best possible number of steps, since 2^6 &lt; 100 and 2^7 &gt; 100).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Dunlop</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-3981</link>
		<dc:creator>Jim Dunlop</dc:creator>
		<pubDate>Thu, 27 Nov 2008 00:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-3981</guid>
		<description>I&#039;m not an engineer or a mathematician, but I am a logical sort of person with some kind of college science degree -- I&#039;ve forgotten what it&#039;s in because I&#039;ve never worked in the industry. &lt;br&gt;&lt;br&gt;Anyway, that aside, the problem is fundamentally flawed and I&#039;d refuse to answer the question on those grounds (and obviously not get the job).  At any rate, I like to think out of the box, so here&#039;s some out-of-the box considerations for this problem.&lt;br&gt;&lt;br&gt;The problem must first be re-defined to make it into a legitimate problem.  Why? Any time you drop the bowling ball from any floor, you are subjecting it to forces that have the potential of breaking the ball.  Now, even though a single drop from, say, the 10th floor may not break the ball, it may cause certain internal stress on the ball (or micro-fractures) that are not visible to the naked eye, which will cause the ball to break on the next drop above 10 (let&#039;s say 14 for the sake of argument).  Thus, if you took a brand new, never-been-dropped ball and let it go from 14, not having suffered previous trauma, may stay intact, thus skewing your results.&lt;br&gt;&lt;br&gt;In order for this problem to become valid, you go over to company stores, and social-engineer them into requisitioning a box of bowling balls to be FedExed to you.  Then you can start with a baseline of 50 floors, examine the results, and whether the ball breaks or not, add or subtract floors accordingly, but ensuring to drop a fresh ball each time.  If you were to multiply or divide by a factor of 2 (or so): 50; (25 is not further divisible by 2 so let&#039;s just go ahead and descend one more floor)... 24; 12; 6; 3; 2; 1, your worst case scenario would look like this: &lt;br&gt;(B=break; I=intact). &lt;br&gt; 50(B); 24(I); 36(B); 30(I); 33(B); 32(B); 31(B).  &lt;br&gt;&lt;br&gt;If, however you are an unlucky bugger and the breaking point just happens to be 49, you might get this:&lt;br&gt;&lt;br&gt;50(B); 24(I); 36(I); 43(I); 46(I); 48(I); 49(B).  &lt;br&gt;&lt;br&gt;Either way, the answer will be 7.&lt;br&gt;&lt;br&gt;Thus, make sure your purchasing department orders 25 bowling balls.  That way you can run the experiment 3 times for consistency and to get accurate numbers.  This will use 21 of the 25 balls.  Then, you can take the remaining 4 balls, one for yourself, and 3 for the guys down in purchasing so you can take them out bowling as a &quot;thank you&quot; when all the BS is done!</description>
		<content:encoded><![CDATA[<p>I&#39;m not an engineer or a mathematician, but I am a logical sort of person with some kind of college science degree &#8212; I&#39;ve forgotten what it&#39;s in because I&#39;ve never worked in the industry. </p>
<p>Anyway, that aside, the problem is fundamentally flawed and I&#39;d refuse to answer the question on those grounds (and obviously not get the job).  At any rate, I like to think out of the box, so here&#39;s some out-of-the box considerations for this problem.</p>
<p>The problem must first be re-defined to make it into a legitimate problem.  Why? Any time you drop the bowling ball from any floor, you are subjecting it to forces that have the potential of breaking the ball.  Now, even though a single drop from, say, the 10th floor may not break the ball, it may cause certain internal stress on the ball (or micro-fractures) that are not visible to the naked eye, which will cause the ball to break on the next drop above 10 (let&#39;s say 14 for the sake of argument).  Thus, if you took a brand new, never-been-dropped ball and let it go from 14, not having suffered previous trauma, may stay intact, thus skewing your results.</p>
<p>In order for this problem to become valid, you go over to company stores, and social-engineer them into requisitioning a box of bowling balls to be FedExed to you.  Then you can start with a baseline of 50 floors, examine the results, and whether the ball breaks or not, add or subtract floors accordingly, but ensuring to drop a fresh ball each time.  If you were to multiply or divide by a factor of 2 (or so): 50; (25 is not further divisible by 2 so let&#39;s just go ahead and descend one more floor)&#8230; 24; 12; 6; 3; 2; 1, your worst case scenario would look like this: <br />(B=break; I=intact). <br /> 50(B); 24(I); 36(B); 30(I); 33(B); 32(B); 31(B).  </p>
<p>If, however you are an unlucky bugger and the breaking point just happens to be 49, you might get this:</p>
<p>50(B); 24(I); 36(I); 43(I); 46(I); 48(I); 49(B).  </p>
<p>Either way, the answer will be 7.</p>
<p>Thus, make sure your purchasing department orders 25 bowling balls.  That way you can run the experiment 3 times for consistency and to get accurate numbers.  This will use 21 of the 25 balls.  Then, you can take the remaining 4 balls, one for yourself, and 3 for the guys down in purchasing so you can take them out bowling as a &#8220;thank you&#8221; when all the BS is done!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Farmer</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-3980</link>
		<dc:creator>Jesse Farmer</dc:creator>
		<pubDate>Wed, 26 Nov 2008 23:15:11 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-3980</guid>
		<description>Lee,&lt;br&gt;&lt;br&gt;That&#039;s not true.  What happens if the bad floor is the 10th floor?  Once the ball breaks on the 25th floor you&#039;re done.</description>
		<content:encoded><![CDATA[<p>Lee,</p>
<p>That&#39;s not true.  What happens if the bad floor is the 10th floor?  Once the ball breaks on the 25th floor you&#39;re done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-3979</link>
		<dc:creator>Lee</dc:creator>
		<pubDate>Wed, 26 Nov 2008 22:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-3979</guid>
		<description>You were on the right track at the start of &quot;Solution 2&quot;.  The solution to this problem is obviously an application of the binsearch or binary search algorithim.  You divide each remaining half of the floors and seach in the middle of the remaining segment of floors.  As an example, if the ball breaks at the 50th floor, you go to the 25th floor for the next trial.  If it doesn&#039;t break, you go to the 75th floor.  The worst-case solution is seven bowling ball drops.</description>
		<content:encoded><![CDATA[<p>You were on the right track at the start of &#8220;Solution 2&#8243;.  The solution to this problem is obviously an application of the binsearch or binary search algorithim.  You divide each remaining half of the floors and seach in the middle of the remaining segment of floors.  As an example, if the ball breaks at the 50th floor, you go to the 25th floor for the next trial.  If it doesn&#39;t break, you go to the 75th floor.  The worst-case solution is seven bowling ball drops.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alcari</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-3978</link>
		<dc:creator>Alcari</dc:creator>
		<pubDate>Wed, 26 Nov 2008 17:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-3978</guid>
		<description>You missed something potentially usefull.&lt;br&gt;Setting the upper limit where you can stop testing.&lt;br&gt;&lt;br&gt;Step 1 -- Calculate terminal velocity, using size and weight (for example, say thanks to wikipedia, example uses maximum weight), guesstimating drag coefficient at .47 for a smooth sphere.&lt;br&gt;&lt;br&gt;-1/2 (rho) * v^2 * A * Cd = m * g&lt;br&gt;-1/2 1.3 * v^2 * pi*(0.108)^2 * 0.47  =  7.2 * 9.81&lt;br&gt;0.0112 * v^2 = 70.6&lt;br&gt;v ~ 79.40 m/s&lt;br&gt;&lt;br&gt;Step 2 -- Determine fall distance at which terminal velocity is achieved&lt;br&gt;79.4 m/s is reached after 79.4 / 9.8 = 8.1 seconds&lt;br&gt;&lt;br&gt;d = 1/2 * g * t^2&lt;br&gt;d = 1/2 * 9.8 * 8.1^2&lt;br&gt;d = 321.65 meters&lt;br&gt;&lt;br&gt;So, depending on the dimensions of the building (and of course, the weight of the bowling ball), you can skip the top few floors. If it&#039;s a children&#039;s ball (weight 6 pounds or 2.72 kg), the max required test height is only 121 meters, or roughly 40 floors. Depending on your ball, a little physics will do wonders for the number of tests.&lt;br&gt;&lt;br&gt;With a light ball, even your Method 1 will solve the problem in 10 steps, if only you used some physics first.&lt;br&gt;You can do even better by calculating at which height the ball will break. That way, assuming you have reasonably accurate figures, you can do it in 3 or 4 tests.</description>
		<content:encoded><![CDATA[<p>You missed something potentially usefull.<br />Setting the upper limit where you can stop testing.</p>
<p>Step 1 &#8212; Calculate terminal velocity, using size and weight (for example, say thanks to wikipedia, example uses maximum weight), guesstimating drag coefficient at .47 for a smooth sphere.</p>
<p>-1/2 (rho) * v^2 * A * Cd = m * g<br />-1/2 1.3 * v^2 * pi*(0.108)^2 * 0.47  =  7.2 * 9.81<br />0.0112 * v^2 = 70.6<br />v ~ 79.40 m/s</p>
<p>Step 2 &#8212; Determine fall distance at which terminal velocity is achieved<br />79.4 m/s is reached after 79.4 / 9.8 = 8.1 seconds</p>
<p>d = 1/2 * g * t^2<br />d = 1/2 * 9.8 * 8.1^2<br />d = 321.65 meters</p>
<p>So, depending on the dimensions of the building (and of course, the weight of the bowling ball), you can skip the top few floors. If it&#39;s a children&#39;s ball (weight 6 pounds or 2.72 kg), the max required test height is only 121 meters, or roughly 40 floors. Depending on your ball, a little physics will do wonders for the number of tests.</p>
<p>With a light ball, even your Method 1 will solve the problem in 10 steps, if only you used some physics first.<br />You can do even better by calculating at which height the ball will break. That way, assuming you have reasonably accurate figures, you can do it in 3 or 4 tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Farmer</title>
		<link>http://20bits.com/articles/interview-questions-two-bowling-balls/comment-page-2/#comment-3977</link>
		<dc:creator>Jesse Farmer</dc:creator>
		<pubDate>Mon, 24 Nov 2008 20:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/?p=79#comment-3977</guid>
		<description>Zing.</description>
		<content:encoded><![CDATA[<p>Zing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
