<?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: Facebook job puzzles: Prime bits</title>
	<atom:link href="http://20bits.com/articles/facebook-job-puzzles-prime-bits/feed/" rel="self" type="application/rss+xml" />
	<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/</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: Ankur</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-3412</link>
		<dc:creator>Ankur</dc:creator>
		<pubDate>Mon, 14 Jul 2008 22:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-3412</guid>
		<description>There is solution to PrimeBits + Super Pattern on site wwww.nerant.com</description>
		<content:encoded><![CDATA[<p>There is solution to PrimeBits + Super Pattern on site wwww.nerant.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-1893</link>
		<dc:creator>Jesse</dc:creator>
		<pubDate>Tue, 29 Apr 2008 17:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-1893</guid>
		<description>Andres,

For powers other than 2 you need to break it down into several contiguous ranges.  You have one range more than there are ones in the binary representation of the original number.

For example, if the number you&#039;re looking at is 10110 then the ranges are 00000-01111, 10000-10011, 10100-10101, and 10110.  There are three ones and four ranges.

Each range corresponds to fixing one of the bits, starting from the left-most (most significant) bit.  So the first range has no fixed bits, the second has one, the third has two, etc.

We subtract from our calculation the number of fixed bits.  So, if the range we&#039;re looking at is 10000-10011 we&#039;re interested in numbers of the form 100xx.  The only prime numbers that are suitable here are 2 and 3.  That is, we can have at most three 1-bits.

But there&#039;s already a fixed bit (that one on the far left side), so if there are three 1-bits then that means there must be two 1-bits in the xx section.  Thus we get 2C(3-1), because we&#039;re choosing the number of combinations in the xx section such that there are three 1-bits for the &lt;em&gt;whole&lt;/em&gt; string.

Hope that helps,
Jesse</description>
		<content:encoded><![CDATA[<p>Andres,</p>
<p>For powers other than 2 you need to break it down into several contiguous ranges.  You have one range more than there are ones in the binary representation of the original number.</p>
<p>For example, if the number you&#8217;re looking at is 10110 then the ranges are 00000-01111, 10000-10011, 10100-10101, and 10110.  There are three ones and four ranges.</p>
<p>Each range corresponds to fixing one of the bits, starting from the left-most (most significant) bit.  So the first range has no fixed bits, the second has one, the third has two, etc.</p>
<p>We subtract from our calculation the number of fixed bits.  So, if the range we&#8217;re looking at is 10000-10011 we&#8217;re interested in numbers of the form 100xx.  The only prime numbers that are suitable here are 2 and 3.  That is, we can have at most three 1-bits.</p>
<p>But there&#8217;s already a fixed bit (that one on the far left side), so if there are three 1-bits then that means there must be two 1-bits in the xx section.  Thus we get 2C(3-1), because we&#8217;re choosing the number of combinations in the xx section such that there are three 1-bits for the <em>whole</em> string.</p>
<p>Hope that helps,<br />
Jesse</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andres</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-1882</link>
		<dc:creator>Andres</dc:creator>
		<pubDate>Tue, 29 Apr 2008 14:34:36 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-1882</guid>
		<description>Jesse, great job! It&#039;s an interested puzzle..
I got lost in the part of solving the problem for other numbers rather than powers of 2. Could you explain it better? Can you give me other examples? why &quot;-1&quot;? why starting from 2C(3-1)?
Thanks</description>
		<content:encoded><![CDATA[<p>Jesse, great job! It&#8217;s an interested puzzle..<br />
I got lost in the part of solving the problem for other numbers rather than powers of 2. Could you explain it better? Can you give me other examples? why &#8220;-1&#8243;? why starting from 2C(3-1)?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-890</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 19 Dec 2007 22:05:13 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-890</guid>
		<description>I have posted a solver, give it a try and see if our answers match: http://www.ctmouton.com/projects/facebook/optimus/prime.php</description>
		<content:encoded><![CDATA[<p>I have posted a solver, give it a try and see if our answers match: <a href="http://www.ctmouton.com/projects/facebook/optimus/prime.php" rel="nofollow">http://www.ctmouton.com/projects/facebook/optimus/prime.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-504</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 14 Aug 2007 16:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-504</guid>
		<description>I couldn&#039;t understand some parts of this article , but I guess I just need to check some more resources regarding this, because it sounds interesting.</description>
		<content:encoded><![CDATA[<p>I couldn&#8217;t understand some parts of this article , but I guess I just need to check some more resources regarding this, because it sounds interesting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-263</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 31 May 2007 21:26:14 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-263</guid>
		<description>You wrote: &quot;e.g., 5 is written as 101 = 1*2^2 + 0*10^1 + 1*10^0.&quot; Did you mean &quot;e.g., 5 is written as 101 = 1*2^2 + 0*2^1 + 1*2^0.&quot;?</description>
		<content:encoded><![CDATA[<p>You wrote: &#8220;e.g., 5 is written as 101 = 1*2^2 + 0*10^1 + 1*10^0.&#8221; Did you mean &#8220;e.g., 5 is written as 101 = 1*2^2 + 0*2^1 + 1*2^0.&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-157</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Fri, 11 May 2007 14:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-157</guid>
		<description>Jesse.. my implementation was very similar.

It took me awhile to figure out the pascal&#039;s triangle caveat, but once I figured it out it was pretty simple.

My implementation generates the pascal array to the number of rows needed [number of significant bits].  I then &#039;condense&#039; that array to create an array[x][y] that reads:

For all numbers equal to and less than 2^[x], there are  occurances of [y] bits set on.

From there it was as simple as adding arrays, then cross referencing them against the &#039;arePrimes&#039; array.

This was a very enjoyable problem!</description>
		<content:encoded><![CDATA[<p>Jesse.. my implementation was very similar.</p>
<p>It took me awhile to figure out the pascal&#8217;s triangle caveat, but once I figured it out it was pretty simple.</p>
<p>My implementation generates the pascal array to the number of rows needed [number of significant bits].  I then &#8216;condense&#8217; that array to create an array[x][y] that reads:</p>
<p>For all numbers equal to and less than 2^[x], there are  occurances of [y] bits set on.</p>
<p>From there it was as simple as adding arrays, then cross referencing them against the &#8216;arePrimes&#8217; array.</p>
<p>This was a very enjoyable problem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-123</link>
		<dc:creator>Jesse</dc:creator>
		<pubDate>Tue, 01 May 2007 06:02:59 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-123</guid>
		<description>Formally the binomial coefficient, nCk, is the number of k-subsets of a set of size n.  Put in laymans terms this means nCk is the number of ways you can select k balls from a bucket filled with n balls, assuming you don&#039;t care about order, i.e., you don&#039;t care if you pick the first, third, and fifth balls in that order, or the third, first, and then the fifth.

Applying it to this problem, then, there are 6C2 6-bit numbers which have two bits set to one, 6C3 with three bits set to one, and 6C5 with five bits set to one.  Since 1, 3, and 5 are the only primes less than 6 there are 6C2 + 6C3 + 6C5 6-bit numbers with a prime number of bits set to one.</description>
		<content:encoded><![CDATA[<p>Formally the binomial coefficient, nCk, is the number of k-subsets of a set of size n.  Put in laymans terms this means nCk is the number of ways you can select k balls from a bucket filled with n balls, assuming you don&#8217;t care about order, i.e., you don&#8217;t care if you pick the first, third, and fifth balls in that order, or the third, first, and then the fifth.</p>
<p>Applying it to this problem, then, there are 6C2 6-bit numbers which have two bits set to one, 6C3 with three bits set to one, and 6C5 with five bits set to one.  Since 1, 3, and 5 are the only primes less than 6 there are 6C2 + 6C3 + 6C5 6-bit numbers with a prime number of bits set to one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Watch Live TV</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-122</link>
		<dc:creator>Watch Live TV</dc:creator>
		<pubDate>Tue, 01 May 2007 05:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-122</guid>
		<description>Lost me on &quot;binomial coefficients&quot;.</description>
		<content:encoded><![CDATA[<p>Lost me on &#8220;binomial coefficients&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cassie</title>
		<link>http://20bits.com/articles/facebook-job-puzzles-prime-bits/comment-page-1/#comment-117</link>
		<dc:creator>Cassie</dc:creator>
		<pubDate>Mon, 30 Apr 2007 16:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/#comment-117</guid>
		<description>Well, someone looking to solve the puzzle on their own would hopefully look over this post.  If they are reading beyond the title and perhaps first paragraph, it suggests that the &quot;fun of figuring it out for ones&#039; self&quot; has worn out.  ^_^</description>
		<content:encoded><![CDATA[<p>Well, someone looking to solve the puzzle on their own would hopefully look over this post.  If they are reading beyond the title and perhaps first paragraph, it suggests that the &#8220;fun of figuring it out for ones&#8217; self&#8221; has worn out.  ^_^</p>
]]></content:encoded>
	</item>
</channel>
</rss>
