<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Programming Praxis</title>
	<atom:link href="http://programmingpraxis.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingpraxis.com</link>
	<description>A collection of etudes, updated weekly, for the education and enjoyment of the savvy programmer</description>
	<lastBuildDate>Sat, 19 May 2012 01:34:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='programmingpraxis.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Programming Praxis</title>
		<link>http://programmingpraxis.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://programmingpraxis.com/osd.xml" title="Programming Praxis" />
	<atom:link rel='hub' href='http://programmingpraxis.com/?pushpress=hub'/>
		<item>
		<title>Formatted Numeric Output</title>
		<link>http://programmingpraxis.com/2012/05/18/formatted-numeric-output/</link>
		<comments>http://programmingpraxis.com/2012/05/18/formatted-numeric-output/#comments</comments>
		<pubDate>Fri, 18 May 2012 09:00:42 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=6039</guid>
		<description><![CDATA[It is often necessary for programs to produce numeric output in various formats, and most languages provide libraries for this purpose; for instance, C provides the printf function, which includes the d and f format specifications for decimal numbers (integers) and floating point numbers, respectively. Your task is to write library functions that format integers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6039&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is often necessary for programs to produce numeric output in various formats, and most languages provide libraries for this purpose; for instance, C provides the <code>printf</code> function, which includes the <code>d</code> and <code>f</code> format specifications for decimal numbers (integers) and floating point numbers, respectively.</p>
<p>Your task is to write library functions that format integers and floating point numbers; you may follow the formatting conventions of C, or those of some other language, or invent your own. When you are finished, you are welcome to <a href="/2012/05/18/formatted-numeric-output/2/">read</a> or <a href="http://programmingpraxis.codepad.org/yZiaS4Jl">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/6039/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/6039/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/6039/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/6039/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/6039/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/6039/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/6039/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/6039/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/6039/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/6039/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/6039/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/6039/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/6039/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/6039/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6039&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/05/18/formatted-numeric-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Streaming Knapsack</title>
		<link>http://programmingpraxis.com/2012/05/15/streaming-knapsack/</link>
		<comments>http://programmingpraxis.com/2012/05/15/streaming-knapsack/#comments</comments>
		<pubDate>Tue, 15 May 2012 09:00:17 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=6033</guid>
		<description><![CDATA[A famous problem of computer science is the knapsack problem, in which you are to find a combination of items from a population that sums to a given target, often with some kind of constraint such as maximizing the value of the items. In today&#8217;s problem we want to find the first possible combination of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6033&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A famous problem of computer science is the knapsack problem, in which you are to find a combination of items from a population that sums to a given target, often with some kind of constraint such as maximizing the value of the items. In today&#8217;s problem we want to find the first possible combination of <em>k</em> integers from a stream of positive integers that sum to <em>n</em>. For instance, given the input stream 4, 8, 9, 2, 10, 2, 17, 2, 12, 4, 5, &hellip;, we want to find the knapsack containing 4, 2, 10, 2, 2 immediately after reading the third 2, without reading the 12, 4, 5 that follow it.</p>
<p>Your task is to write a program that takes parameters <em>k</em> and <em>n</em> and an input stream and returns the first possible knapsack. When you are finished, you are welcome to <a href="/2012/05/15/streaming-knapsack/2/">read</a> or <a href="http://programmingpraxis.codepad.org/WHdBXcyr">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/6033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/6033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/6033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/6033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/6033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/6033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/6033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/6033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/6033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/6033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/6033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/6033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/6033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/6033/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6033&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/05/15/streaming-knapsack/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Partitions</title>
		<link>http://programmingpraxis.com/2012/05/11/partitions/</link>
		<comments>http://programmingpraxis.com/2012/05/11/partitions/#comments</comments>
		<pubDate>Fri, 11 May 2012 09:00:30 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=6024</guid>
		<description><![CDATA[The partitions of an integer is the set of all sets of integers that sum to the given integer. For instance, the partitions of 4 is the set of sets ((1 1 1 1) (1 1 2) (1 3) (2 2) (4)). We computed the number of partitions of an integer in a previous exercise. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6024&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The partitions of an integer is the set of all sets of integers that sum to the given integer. For instance, the partitions of 4 is the set of sets ((1 1 1 1) (1 1 2) (1 3) (2 2) (4)). We computed the number of partitions of an integer in a <a href="/2011/04/15/partition-numbers/">previous exercise</a>. In today&#8217;s exercise, we will make a list of the partitions.</p>
<p>The process is recursive. There is a single partition of 0, the empty set (). There is a single partition of 1, the set (1). There are two partitions of 2, the sets (1 1) and (2). There are three partitions of 3, the sets (1 1 1), (1 2) and (3). There are five partitions of 4, the sets (1 1 1 1), (1 1 2), (1 3), (2 2), and (4). There are seven partitions of 5, the sets (1 1 1 1 1), (1 1 1 2), (1 2 2), (1 1 3), (1 4), (2 3) and (5). And so on. In each case, the next-larger set of partitions is determined by adding each integer <em>x</em> less than or equal to the desired integer <em>n</em> to all the sets formed by the partition of <em>n</em> &minus; <em>x</em>, eliminating any duplicates.</p>
<p>Your task is to write a function that generates the set of all partitions of a given integer. When you are finished, you are welcome to <a href="/2012/05/11/partitions/2/">read</a> or <a href="http://programmingpraxis.codepad.org/TaCSCQAW">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/6024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/6024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/6024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/6024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/6024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/6024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/6024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/6024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/6024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/6024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/6024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/6024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/6024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/6024/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6024&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/05/11/partitions/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Factor Tables</title>
		<link>http://programmingpraxis.com/2012/05/08/factor-tables/</link>
		<comments>http://programmingpraxis.com/2012/05/08/factor-tables/#comments</comments>
		<pubDate>Tue, 08 May 2012 09:00:42 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=6018</guid>
		<description><![CDATA[Before the dawn of computers, most computations were done with the aid of tables: logarithm tables, sine tables, and so on. These tables were ubiquitous, indispensable, and riddled with errors. Number theorists who needed to factor numbers used tables of the least prime factor of a number. The oldest such table dates to 1603 (it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6018&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Before the dawn of computers, most computations were done with the aid of tables: logarithm tables, sine tables, and so on. These tables were ubiquitous, indispensable, and riddled with errors. Number theorists who needed to factor numbers used tables of the least prime factor of a number. The oldest such table dates to 1603 (it contained the least prime factor of all numbers to 750), and new tables were being constructed as late as Derrick N. Lehmer&#8217;s table of least prime factors to ten million in 1909 (he was the father of Derrick H. Lehmer); Maarten Bullynck gives the <a href="http://www.kuttaka.org/FactorTables.pdf">history</a>. Here&#8217;s a sample page from a large table, showing the least prime factors of all numbers less than a thousand; numbers divisible by 2 and 5 are omitted, and primes are skipped:</p>
<p><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nb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p;--&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;--<br />
93&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;17&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;13&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;3<br />
97&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;17&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;--<br />
99&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;13&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;17&nbsp;&nbsp;&nbsp;29&nbsp;&nbsp;&nbsp;&nbsp;3</code></p>
<p>For example the table shows that the least prime factor of 923, in the column headed 9 and row headed 23, is 13, and 997 is the greatest prime less than a thousand. To factor a number, find its least prime factor in the table, compute the remaining cofactor by division, and repeat until the cofactor is prime.</p>
<p>When building the table, the least prime factor is computed by sieving, not by trial division. The setup is the same as the Sieve of Eratosthenes, except that integers are used instead of booleans, and each item in the sieve is initialized to 1. Then each successively-smallest prime <em>p</em> is sieved, but instead of changing <code>true</code> to <code>false</code>, each 1 in the chain of multiples of <em>p</em> is changed to <em>p</em> (other values are ignored). The same optimizations as the normal sieve &mdash; odd numbers only, start at the square of <em>p</em>, and stop when <em>p</em><sup><small>2</small></sup> is greater than <em>n</em> &mdash; apply here.</p>
<p>Your task is to write a function that sieves for least prime factors, and to use that function to write a program that builds factor tables as illustrated above. When you are finished, you are welcome to <a href="/2012/05/08/factor-tables/2/">read</a> or <a href="http://programmingpraxis.codepad.org/a9eDAmhr">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/6018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/6018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/6018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/6018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/6018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/6018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/6018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/6018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/6018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/6018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/6018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/6018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/6018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/6018/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=6018&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/05/08/factor-tables/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Even-Odd Partition</title>
		<link>http://programmingpraxis.com/2012/05/04/even-odd-partition/</link>
		<comments>http://programmingpraxis.com/2012/05/04/even-odd-partition/#comments</comments>
		<pubDate>Fri, 04 May 2012 09:00:13 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=5961</guid>
		<description><![CDATA[I&#8217;m not sure where this problem comes from; it&#8217;s either homework or an interview question. Nonetheless, it is simple and fun: Take an array of integers and partition it so that all the even integers in the array precede all the odd integers in the array. Your solution must take linear time in the size [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5961&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure where this problem comes from; it&#8217;s either homework or an interview question. Nonetheless, it is simple and fun:</p>
<blockquote><p>Take an array of integers and partition it so that all the even integers in the array precede all the odd integers in the array. Your solution must take linear time in the size of the array and operate in-place with only a constant amount of extra space.</p></blockquote>
<p>Your task is to write the indicated function. When you are finished, you are welcome to <a href="/2012/05/04/even-odd-partition/2/">read</a> or <a href="http://programmingpraxis.codepad.org/6JoM2tNp">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/5961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/5961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/5961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/5961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/5961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/5961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/5961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/5961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/5961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/5961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/5961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/5961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/5961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/5961/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5961&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/05/04/even-odd-partition/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Legendre&#8217;s Symbol</title>
		<link>http://programmingpraxis.com/2012/05/01/legendres-symbol/</link>
		<comments>http://programmingpraxis.com/2012/05/01/legendres-symbol/#comments</comments>
		<pubDate>Tue, 01 May 2012 09:00:34 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=5995</guid>
		<description><![CDATA[The Legendre Symbol and its cousin the Jacobi Symbol are used in modular arithmetic to determine if a number a is a quadratic residue to the modulus m. A number a is a quadratic residue if there exists a number x such that x2 &#8801; a (mod m) and is defined only when a and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5995&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The Legendre Symbol and its cousin the Jacobi Symbol are used in modular arithmetic to determine if a number <em>a</em> is a quadratic residue to the modulus <em>m</em>. A number <em>a</em> is a quadratic residue if there exists a number <em>x</em> such that <em>x</em><sup><small>2</small></sup> &equiv; <em>a</em> (mod <em>m</em>) and is defined only when <em>a</em> and <em>m</em> are co-prime. For instance, <em>a</em><sup><small>2</small></sup> (mod 7) for <em>a</em> from 0 to 6 is the list 0<sup><small>2</small></sup> (mod 7) = 0, 1<sup><small>2</small></sup> (mod 7) = 1, 2<sup><small>2</small></sup> (mod 7) = 4, 3<sup><small>2</small></sup> (mod 7) = 2, 4<sup><small>2</small></sup> (mod 7) = 2, 5<sup><small>2</small></sup> (mod 7) = 4, and 6<sup><small>2</small></sup> (mod 7) = 1, so the quadratic residues of 7 are 1, 2 and 4 (0 is excluded because it isn&#8217;t co-prime to 7). The jacobi symbol considers any odd modulus; the legendre symbol is limited to odd prime moduli. The symbols are usually written in parentheses with <em>a</em> over <em>m</em>, like this: <img src='http://s0.wp.com/latex.php?latex=%5Cleft%28+a+%5Catop+m+%5Cright%29&amp;bg=ffffff&amp;fg=555555&amp;s=0' alt='&#92;left( a &#92;atop m &#92;right)' title='&#92;left( a &#92;atop m &#92;right)' class='latex' />. Sometimes the symbol is written with a horizontal rule between the <em>a</em> and <em>m</em>, and sometimes it is written on a single line as (<em>a</em> / <em>m</em>).</p>
<p><!--http://en.literateprograms.org/Jacobi_Symbol_(Python)--></p>
<p>The legendre/jacobi symbol can be calculated according to the following three termination rules:</p>
<blockquote><p>1. (0 / <em>m</em>) = 0</p>
<p>2. (1 / <em>m</em>) = 1</p>
<p>3. (2 / <em>m</em>) = &minus;1 if <em>m</em> mod 8 &isin; {3, 5} or 1 if <em>m</em> mod 8 &isin; {1, 7}</p></blockquote>
<p>and the following three reduction rules:</p>
<blockquote><p>4. [reducing factors of 2] (2<em>a</em> / <em>m</em>) = (2 / <em>m</em>) &times; (<em>a</em> / <em>m</em>)</p>
<p>5. [reducing modulo <em>m</em>] (<em>a</em> / <em>m</em>) = (<em>a</em> (mod <em>m</em>) / <em>m</em>) if <em>a</em> &ge; <em>m</em> or <em>a</em> &lt; 0</p>
<p>6. [reducing odd co-primes <em>a</em> and <em>m</em>] (<em>a</em> /<em>m</em>) = &minus;(<em>m</em> / <em>a</em>) if <em>a</em> &equiv; <em>m</em> &equiv; 3 (mod 4), or (<em>m</em> / <em>a</em>) otherwise</p></blockquote>
<p>Thus, the legendre/jacobi symbol is 1 if <em>a</em> is a quadratic residue, -1 if <em>a</em> is not a quadratic residue, and 0 if <em>a</em> and <em>m</em> are not co-prime.</p>
<p>Our various prime-number programs have used a definition of the legendre/jacobi symbol that doesn&#8217;t work; for some values of <em>a</em> and <em>m</em> it returned wrong results, and for other values of <em>a</em> and <em>m</em> it entered an infinite loop. This exercise fixes the problem.</p>
<p>Your task is to write a function that calculates the legendre/jacobi symbol using the rules given above. When you are finished, you are welcome to <a href="/2012/05/01/legendres-symbol/2/">read</a> or <a href="http://programmingpraxis.codepad.org/6uVnD0RR">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/5995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/5995/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/5995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/5995/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/5995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/5995/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/5995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/5995/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/5995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/5995/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/5995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/5995/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/5995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/5995/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5995&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/05/01/legendres-symbol/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Trabb Pardo Knuth Algorithm</title>
		<link>http://programmingpraxis.com/2012/04/27/trabb-pardo-knuth-algorithm/</link>
		<comments>http://programmingpraxis.com/2012/04/27/trabb-pardo-knuth-algorithm/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 09:00:49 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=5975</guid>
		<description><![CDATA[In their 1973 paper &#8220;The Early Development of Programming Languages,&#8221; Luis Trabb Pardo and Donald Knuth give the following algorithm as a means of assessing programming languages: ask for 11 numbers to be read into a sequence S reverse sequence S for each item in sequence S &#160;&#160;&#160;&#160;call a function to do an operation &#160;&#160;&#160;&#160;if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5975&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In their 1973 paper &#8220;The Early Development of Programming Languages,&#8221; Luis Trabb Pardo and Donald Knuth give the following algorithm as a means of assessing programming languages:</p>
<blockquote><p><code>ask for 11 numbers to be read into a sequence S<br />
reverse sequence S<br />
for each item in sequence S<br />
&nbsp;&nbsp;&nbsp;&nbsp;call a function to do an operation<br />
&nbsp;&nbsp;&nbsp;&nbsp;if result overflows<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert user<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print result</code></p></blockquote>
<p>Though it is trivial, the algorithm involves arrays, indexing, mathematical functions, subroutines, I/O, conditionals and iteration, and thus exposes many basic operations of a programming language.</p>
<p>Your task is to write a program that implements the Trabb Pardo Knuth algorithm. When you are finished, you are welcome to <a href="/2012/04/27/trabb-pardo-knuth-algorithm/2/">read</a> or <a href="http://programmingpraxis.codepad.org/8OFS3rH7">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/5975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/5975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/5975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/5975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/5975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/5975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/5975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/5975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/5975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/5975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/5975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/5975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/5975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/5975/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5975&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/04/27/trabb-pardo-knuth-algorithm/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Rhyming Dictionary</title>
		<link>http://programmingpraxis.com/2012/04/24/rhyming-dictionary/</link>
		<comments>http://programmingpraxis.com/2012/04/24/rhyming-dictionary/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 09:00:35 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=5954</guid>
		<description><![CDATA[One of the sites that I visit regularly is Reddit, and one of my favorite forums there is learnprogramming, which is often a source of ideas for the exercises that I write here. A recent question on learnprogramming came from a poet who wanted a rhyming dictionary. The poet says the dictionary must be the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5954&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the sites that I visit regularly is Reddit, and one of my favorite forums there is learnprogramming, which is often a source of ideas for the exercises that I write here. A recent <a href="http://www.reddit.com/r/learnprogramming/comments/sik0f/i_want_to_build_a_rhyming_dictionarysearch_engine/">question</a> on learnprogramming came from a poet who wanted a rhyming dictionary. The poet says the dictionary must be the OED (won&#8217;t accept the CMU dictionary), isn&#8217;t a programmer but has a little bit of experience with HTML but expects to be able to write a rhyming dictionary program in a couple of days, doesn&#8217;t know that Java and JavaScript are two different languages, has already decided to use Python or Ruby, expects to be able to copy all the pronunciations from the OED without license, and seems to not have a clue what he really wants (&#8220;Basically I want to have multiple inputs (somewhere around a dozen) in different categories that when pooled together can give you what you&#8217;re looking for.&#8221; &mdash; whatever that means). The poet also has a foul mouth. Still, building a rhyming dictionary is a good exercise, and we can have some fun with it.</p>
<p>First we need a pronunciation dictionary. <a href="ftp://ftp.cs.cmu.edu/project/speech/dict/">CMU has one</a>, which we will use even though the poet found it &#8220;too choppy.&#8221; You&#8217;ll want the c06d.gz file, which after a brief commentary provides one word per line in the form PROGRAMMING  P R OW1 G R AE2 M IH0 NG. The dictionary uses <a href="/2012/04/24/rhyming-dictionary/2/">39 phonemes</a>, 15 vowels and 24 consonants, with three possible stresses for each vowel, indicated by a trailing number, 1 for primary stress, 2 for secondary stress, and 0 for unstressed; thus, there are 69 unique pronunciation symbols. We&#8217;ll say that two words rhyme if their final vowel (including stress) and any trailing consonants are identical.</p>
<p>Your task is to write a function that determines if two words rhyme and a function that takes one word and returns all the words that rhyme with it. When you are finished, you are welcome to <a href="/2012/04/24/rhyming-dictionary/3/">read</a> or <a href="http://programmingpraxis.codepad.org/GijwSqhR">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/5954/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/5954/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/5954/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/5954/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/5954/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/5954/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/5954/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/5954/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/5954/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/5954/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/5954/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/5954/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/5954/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/5954/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5954&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/04/24/rhyming-dictionary/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>John Horton Conway&#8217;s Game Of Life</title>
		<link>http://programmingpraxis.com/2012/04/20/john-horton-conways-game-of-life/</link>
		<comments>http://programmingpraxis.com/2012/04/20/john-horton-conways-game-of-life/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 09:00:56 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=5928</guid>
		<description><![CDATA[We studied one-dimensional cellular automata in a previous exercise. In today&#8217;s exercise, we will implement the famous two-dimensional cellular automaton by the British mathematician John Horton Conway, the Game of Life. Life was introduced by Martin Gardner in the October 1970 issue of Scientific American; I can remember coming home from the library and tracing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5928&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We studied one-dimensional cellular automata in a <a href="/2009/05/15/cellular-automata/">previous exercise</a>. In today&#8217;s exercise, we will implement the famous two-dimensional cellular automaton by the British mathematician John Horton Conway, the Game of Life. Life was introduced by Martin Gardner in the October 1970 issue of <em>Scientific American</em>; I can remember coming home from the library and tracing a glider as it moved across my checkerboard.</p>
<p>The automaton exists on an infinite two-dimensional grid of cells, each either alive or dead. Each cell has a neighborhood of the eight cells horizontally, vertically or diagonally adjacent to it. A cell that is alive in one generation dies if it has less than two live neighbors or more than three live neighbors, otherwise is survives to the next generation; a cell that is dead becomes alive at the next generation if it has exactly three living neighbors. All births and deaths occur simultaneously from one generation to the next.</p>
<p>Mathematicians have shown that these simple rules evoke immense variety, and have built general-purpose computing structures from particular configurations of living cells. Forty-two years on, there are articles in scholarly journals, doctoral dissertations, and jillions of web sites that serve Life enthusiasts.</p>
<p>Your task is to write a program that computes and displays the history of a Life population. When you are finished, you are welcome to <a href="/2012/04/20/john-horton-conways-game-of-life/2/">read</a> or <a href="http://programmingpraxis.codepad.org/l6ExmA3j">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/5928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/5928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/5928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/5928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/5928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/5928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/5928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/5928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/5928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/5928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/5928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/5928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/5928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/5928/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5928&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/04/20/john-horton-conways-game-of-life/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
		<item>
		<title>Twin Primes</title>
		<link>http://programmingpraxis.com/2012/04/17/twin-primes/</link>
		<comments>http://programmingpraxis.com/2012/04/17/twin-primes/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 09:00:59 +0000</pubDate>
		<dc:creator>programmingpraxis</dc:creator>
				<category><![CDATA[Exercises]]></category>

		<guid isPermaLink="false">http://programmingpraxis.com/?p=5940</guid>
		<description><![CDATA[Pairs of prime numbers that differ by two are known as twin primes: (3,5), (5,7), (11,13), (17,19), (29,31), (41,43), (59,61), (71,73), &#8230;. Sometimes the list is given by the lowest number in the pair (A001359: 3, 5, 11, 17, 29, 41, 59, 71, &#8230;), sometimes by the highest number in the pair (A006512: 5, 7, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5940&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Pairs of prime numbers that differ by two are known as <em>twin primes</em>: (3,5), (5,7), (11,13), (17,19), (29,31), (41,43), (59,61), (71,73), &#8230;. Sometimes the list is given by the lowest number in the pair (<a href="http://oeis.org/A001359">A001359</a>: 3, 5, 11, 17, 29, 41, 59, 71, &#8230;), sometimes by the highest number in the pair (<a href="http://oeis.org/A006512">A006512</a>: 5, 7, 13, 19, 31, 43, 61, 73, &#8230;), sometimes by the number in between (<a href="http://oeis.org/A014574">A014574</a>: 4, 6, 12, 18, 30, 42, 60, 72, &#8230;), and sometimes just as a list of primes (<a href="http://oeis.org/A001097">A001097</a>: 3, 5, 7, 11, 13, 17, 19, 29, 31, 41, 43, 59, 61, 71, 73, &#8230;). All twin primes have the form 6<em>k</em>&plusmn;1.</p>
<p>It is simple and fast to compute the twin primes less than <em>n</em> by a variant of the Sieve of Eratosthenes. The sieving primes are the primes less than the square root of <em>n</em>, excluding 2 and 3 which are not of the form 6<em>k</em>&plusmn;1. In the first step, the primes of the form 6<em>k</em>&minus;1 are sieved; first make a bitarray for the numbers 5, 11, 17, 23, 29, &#8230;, then, for each sieving prime <em>p</em>, find the smallest multiple of the prime in the list, strike it off the list, and strike each <em>p</em>th number off the list as well. In the second step, the primes of the form 6<em>k</em>+1 are sieved; first make a bitarray for the numbers 7, 13, 19, 25, 31, &#8230;, then, for each sieving prime <em>p</em>, find the smallest multiple of the prime in the list, strike it off the list, and strike each <em>p</em>th number off the list as well. In the third step, sweep through the pair of bitarrays and collect twin primes for each remaining pair of corresponding bitarray elements.</p>
<p>The smallest multiple of a prime <em>p</em> of the form 6<em>k</em>&minus;1 is the modular inverse of 6 mod <em>p</em>; the smallest multiple of a prime <em>p</em> of the form 6<em>k</em>+1 is the modular inverse of &minus;6 mod <em>p</em>. Be sure not to strike the prime <em>p</em>. We discussed the modular inverse in a <a href="/2009/07/07/modular-arithmetic/">previous exercise</a>.</p>
<p>An alternative method to compute twin primes is to use the normal Sieve of Eratosthenes to compute the primes less than <em>n</em>, then sweep through the list comparing each prime to its successor. But the algorithm given above is faster, about twice as fast, because the two bitarrays are shorter than the single bitarray of the normal Sieve of Eratosthenes.</p>
<p>Your task is to write a function that finds the twin primes less than a given input <em>n</em>. When you are finished, you are welcome to <a href="/2012/04/17/twin-primes/2/">read</a> or <a href="http://programmingpraxis.codepad.org/68zEdHFA">run</a> a suggested solution, or to post your own solution or discuss the exercise in the comments below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programmingpraxis.wordpress.com/5940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programmingpraxis.wordpress.com/5940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/programmingpraxis.wordpress.com/5940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/programmingpraxis.wordpress.com/5940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/programmingpraxis.wordpress.com/5940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/programmingpraxis.wordpress.com/5940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/programmingpraxis.wordpress.com/5940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/programmingpraxis.wordpress.com/5940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/programmingpraxis.wordpress.com/5940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/programmingpraxis.wordpress.com/5940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/programmingpraxis.wordpress.com/5940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/programmingpraxis.wordpress.com/5940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/programmingpraxis.wordpress.com/5940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/programmingpraxis.wordpress.com/5940/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programmingpraxis.com&#038;blog=6649073&#038;post=5940&#038;subd=programmingpraxis&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programmingpraxis.com/2012/04/17/twin-primes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">programmingpraxis</media:title>
		</media:content>
	</item>
	</channel>
</rss>
