<?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: Here be the Code Monkeys</title>
	<atom:link href="http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/feed/" rel="self" type="application/rss+xml" />
	<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/</link>
	<description>{ on programming and the internets, every monday }</description>
	<lastBuildDate>Tue, 09 Mar 2010 07:51:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: La caída de las lámparas &#171; Spin Foam</title>
		<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/comment-page-1/#comment-25760</link>
		<dc:creator>La caída de las lámparas &#171; Spin Foam</dc:creator>
		<pubDate>Mon, 02 Nov 2009 16:46:57 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=98#comment-25760</guid>
		<description>[...] (Extraído del blog de Louis Brandy.) [...]</description>
		<content:encoded><![CDATA[<p>[...] (Extraído del blog de Louis Brandy.) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Algunas respuestas y un problema simple &#171; Spin Foam</title>
		<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/comment-page-1/#comment-25759</link>
		<dc:creator>Algunas respuestas y un problema simple &#171; Spin Foam</dc:creator>
		<pubDate>Sun, 01 Nov 2009 20:19:09 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=98#comment-25759</guid>
		<description>[...] (Extraído del blog de Louis Brandy.) [...]</description>
		<content:encoded><![CDATA[<p>[...] (Extraído del blog de Louis Brandy.) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chalks</title>
		<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/comment-page-1/#comment-549</link>
		<dc:creator>chalks</dc:creator>
		<pubDate>Mon, 03 Nov 2008 02:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=98#comment-549</guid>
		<description>I&#039;ve read your entire blog over the past few days, and really enjoyed it.  The lightbulb question got me thinking, and I came up with an answer I like.  Here it is:

drop the first light bulb once every 10 floors (at 10, 20, 30, etc).  Once it breaks, drop the second bulb from the previous unbroken floor one floor at a time till it breaks (at 11, 12, 13, ... 18).  Worst case you drop the first bulb 10 times, and the second bulb 8 times.  Best case you drop both bulbs once.

Furthermore, to generalize this for N floors:
take x=ceiling(sqrt(N))
drop the first egg once every x floors.  Second egg drops maximum of x-2 times.  Which means that worst case scenario for N floors is 2*(x-1) drops.  I think.  I had a lot of fun thinking about this.  :D</description>
		<content:encoded><![CDATA[<p>I&#8217;ve read your entire blog over the past few days, and really enjoyed it.  The lightbulb question got me thinking, and I came up with an answer I like.  Here it is:</p>
<p>drop the first light bulb once every 10 floors (at 10, 20, 30, etc).  Once it breaks, drop the second bulb from the previous unbroken floor one floor at a time till it breaks (at 11, 12, 13, &#8230; 18).  Worst case you drop the first bulb 10 times, and the second bulb 8 times.  Best case you drop both bulbs once.</p>
<p>Furthermore, to generalize this for N floors:<br />
take x=ceiling(sqrt(N))<br />
drop the first egg once every x floors.  Second egg drops maximum of x-2 times.  Which means that worst case scenario for N floors is 2*(x-1) drops.  I think.  I had a lot of fun thinking about this.  <img src='http://lbrandy.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Igo</title>
		<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/comment-page-1/#comment-482</link>
		<dc:creator>Bob Igo</dc:creator>
		<pubDate>Wed, 29 Oct 2008 22:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=98#comment-482</guid>
		<description>Interesting binary search variant, but I think the challenge with these is coming up with scenarios in which candidates could imagine these being realistic constraints.  My first reaction to this was that it&#039;s clever as a puzzle, but horrible as a QA plan :)  If I were being interviewed to conduct any kind of testing, I&#039;d be a bit worried that the puzzle was a metaphor for my testing resources.</description>
		<content:encoded><![CDATA[<p>Interesting binary search variant, but I think the challenge with these is coming up with scenarios in which candidates could imagine these being realistic constraints.  My first reaction to this was that it&#8217;s clever as a puzzle, but horrible as a QA plan <img src='http://lbrandy.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   If I were being interviewed to conduct any kind of testing, I&#8217;d be a bit worried that the puzzle was a metaphor for my testing resources.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Light Bulb Drop &#171; Iced Penguin</title>
		<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/comment-page-1/#comment-346</link>
		<dc:creator>Light Bulb Drop &#171; Iced Penguin</dc:creator>
		<pubDate>Wed, 22 Oct 2008 01:44:22 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=98#comment-346</guid>
		<description>[...] Light Bulb&#160;Drop  We want to figure out how strong our new super-strong light bulbs are. We know that they will be break when dropped from the top floor of this building (the 101st). We want to know the exact minimum floor from which a fall will cause the light bulb to break. You’ll be given two light bulbs for this task and we want you to do it with the minimum number of trials. - Louis Brandy [...]</description>
		<content:encoded><![CDATA[<p>[...] Light Bulb&nbsp;Drop  We want to figure out how strong our new super-strong light bulbs are. We know that they will be break when dropped from the top floor of this building (the 101st). We want to know the exact minimum floor from which a fall will cause the light bulb to break. You’ll be given two light bulbs for this task and we want you to do it with the minimum number of trials. &#8211; Louis Brandy [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IcedPenguin</title>
		<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/comment-page-1/#comment-344</link>
		<dc:creator>IcedPenguin</dc:creator>
		<pubDate>Tue, 21 Oct 2008 14:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=98#comment-344</guid>
		<description>The light bulb question in a really interesting brain teaser. For an optimum search, one immediately things binary search. Except we have a &quot;fixed&quot; number of failed trials (defined as the bulbs breaking). The standard search would drop from five and then three. The problem is if both drops break the bulb, then we still don&#039;t know if the first or second floor is the maximum height.

My solution to the problem involves a binary tree like kuratkkull suggested. Drop the light bulb at each node. If it breaks, follow the left leg, if it does not break follow the right leg.

  __3__
 /     \
1      _6_
 \    /   \
  2  4     8
      \   / \
       5 7   9

Solution: once you test the leaf node you have your answer. If the bulb breaks, the leaf is the minimum floor the bulb will break at. If the bulb survives, the minimum floor is the value of the node +1.</description>
		<content:encoded><![CDATA[<p>The light bulb question in a really interesting brain teaser. For an optimum search, one immediately things binary search. Except we have a &#8220;fixed&#8221; number of failed trials (defined as the bulbs breaking). The standard search would drop from five and then three. The problem is if both drops break the bulb, then we still don&#8217;t know if the first or second floor is the maximum height.</p>
<p>My solution to the problem involves a binary tree like kuratkkull suggested. Drop the light bulb at each node. If it breaks, follow the left leg, if it does not break follow the right leg.</p>
<p>  __3__<br />
 /     \<br />
1      _6_<br />
 \    /   \<br />
  2  4     8<br />
      \   / \<br />
       5 7   9</p>
<p>Solution: once you test the leaf node you have your answer. If the bulb breaks, the leaf is the minimum floor the bulb will break at. If the bulb survives, the minimum floor is the value of the node +1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: louis</title>
		<link>http://lbrandy.com/blog/2008/09/here-be-the-code-monkeys/comment-page-1/#comment-130</link>
		<dc:creator>louis</dc:creator>
		<pubDate>Mon, 22 Sep 2008 22:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=98#comment-130</guid>
		<description>I&#039;m not sure what you mean, kuratkull, about not being able to get more specific than that. It seems to me that the concept of a binary-search can be modified sufficiently with the given information to get an &quot;optimal&quot; algorithm for finding the answer.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure what you mean, kuratkull, about not being able to get more specific than that. It seems to me that the concept of a binary-search can be modified sufficiently with the given information to get an &#8220;optimal&#8221; algorithm for finding the answer.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
