<?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: Recursion &amp; bad examples</title>
	<atom:link href="http://www.diovo.com/2009/11/recursion-bad-examples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.diovo.com/2009/11/recursion-bad-examples/</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 16:08:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sabithpocker</title>
		<link>http://www.diovo.com/2009/11/recursion-bad-examples/comment-page-1/#comment-2340</link>
		<dc:creator>sabithpocker</dc:creator>
		<pubDate>Thu, 18 Feb 2010 22:07:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=978#comment-2340</guid>
		<description>We are not trying to &#039;calculate&#039; Fibonacci numbers using computer.. are we?
We are instead studying a concept called &#039;recursion&#039;.</description>
		<content:encoded><![CDATA[<p>We are not trying to &#8216;calculate&#8217; Fibonacci numbers using computer.. are we?<br />
We are instead studying a concept called &#8216;recursion&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Wong</title>
		<link>http://www.diovo.com/2009/11/recursion-bad-examples/comment-page-1/#comment-2058</link>
		<dc:creator>Jamie Wong</dc:creator>
		<pubDate>Sat, 12 Dec 2009 08:45:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=978#comment-2058</guid>
		<description>While the best algorithm for the generation of the fibonacci sequence is not a recursive algorithm, the fibonacci sequence is still a very useful example of explaining recursion. For people who are seeing recursion for the first time, it&#039;s something very easy to visualize and has a low enough number of recursive calls as to make drawing the recursion tree feasible.

The way I&#039;ve seen it taught in various places normally will use the fibonacci sequence as a segue into dynamic programming and memoization. Because the recursive algorithm is so terrible, it makes an excellent example of how performance can be drastically improved by preventing duplicate calls.

Factorial and addition do not lend themselves to such a segue, and are therefore less commonly used. Also, when doing introductory programming courses - doing factorial will be limited far sooner by the capacity of integers than it will be by computational complexity.</description>
		<content:encoded><![CDATA[<p>While the best algorithm for the generation of the fibonacci sequence is not a recursive algorithm, the fibonacci sequence is still a very useful example of explaining recursion. For people who are seeing recursion for the first time, it&#8217;s something very easy to visualize and has a low enough number of recursive calls as to make drawing the recursion tree feasible.</p>
<p>The way I&#8217;ve seen it taught in various places normally will use the fibonacci sequence as a segue into dynamic programming and memoization. Because the recursive algorithm is so terrible, it makes an excellent example of how performance can be drastically improved by preventing duplicate calls.</p>
<p>Factorial and addition do not lend themselves to such a segue, and are therefore less commonly used. Also, when doing introductory programming courses &#8211; doing factorial will be limited far sooner by the capacity of integers than it will be by computational complexity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niyaz PK</title>
		<link>http://www.diovo.com/2009/11/recursion-bad-examples/comment-page-1/#comment-2056</link>
		<dc:creator>Niyaz PK</dc:creator>
		<pubDate>Sat, 12 Dec 2009 03:28:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=978#comment-2056</guid>
		<description>sabithpocker,

Even though the definition of Fibonacci is recursive, it does not mean that you can compute Fibonacci numbers using recursion.</description>
		<content:encoded><![CDATA[<p>sabithpocker,</p>
<p>Even though the definition of Fibonacci is recursive, it does not mean that you can compute Fibonacci numbers using recursion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sabithpocker</title>
		<link>http://www.diovo.com/2009/11/recursion-bad-examples/comment-page-1/#comment-2053</link>
		<dc:creator>sabithpocker</dc:creator>
		<pubDate>Fri, 11 Dec 2009 17:10:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=978#comment-2053</guid>
		<description>First thing : stop thinking that those who make syllabus/curriculum are fools or outdated, they know more than you in programming(i refer to those who make syllabus and curriculum not your lecturer at coll)

Second thing : Before appreciating think not even once, but before criticizing think a thousand times.

Third thing :  Search Google, Refer Wikipedia and then post what you feel ,ie. when you do tech blog.

Fourth point : Fibonacci is inherently recursive, find what is recursion in mathematics, recurrence relations and recursive functions.

Fifth point : I have made all of the above mentioned mistakes myself. Keep rocking dude!!</description>
		<content:encoded><![CDATA[<p>First thing : stop thinking that those who make syllabus/curriculum are fools or outdated, they know more than you in programming(i refer to those who make syllabus and curriculum not your lecturer at coll)</p>
<p>Second thing : Before appreciating think not even once, but before criticizing think a thousand times.</p>
<p>Third thing :  Search Google, Refer Wikipedia and then post what you feel ,ie. when you do tech blog.</p>
<p>Fourth point : Fibonacci is inherently recursive, find what is recursion in mathematics, recurrence relations and recursive functions.</p>
<p>Fifth point : I have made all of the above mentioned mistakes myself. Keep rocking dude!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niyaz PK</title>
		<link>http://www.diovo.com/2009/11/recursion-bad-examples/comment-page-1/#comment-1994</link>
		<dc:creator>Niyaz PK</dc:creator>
		<pubDate>Sat, 07 Nov 2009 18:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=978#comment-1994</guid>
		<description>Binny,
As Amarghosh pointed out, factorial is a good example.

Another very simple example is addition:

&lt;code&gt;add(0, x) = x,
add(n, x) = add(n-1, x) + 1&lt;/code&gt;

As far as I know this example is often used in computer science courses in many good universities around the world.

I think Fibonacci should be taught as an example for bad use of recursion. Of course the point is that there is a huge time-space trade-off in using recursion and that should be taught correctly.</description>
		<content:encoded><![CDATA[<p>Binny,<br />
As Amarghosh pointed out, factorial is a good example.</p>
<p>Another very simple example is addition:</p>
<p><code>add(0, x) = x,<br />
add(n, x) = add(n-1, x) + 1</code></p>
<p>As far as I know this example is often used in computer science courses in many good universities around the world.</p>
<p>I think Fibonacci should be taught as an example for bad use of recursion. Of course the point is that there is a huge time-space trade-off in using recursion and that should be taught correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binny V A</title>
		<link>http://www.diovo.com/2009/11/recursion-bad-examples/comment-page-1/#comment-1993</link>
		<dc:creator>Binny V A</dc:creator>
		<pubDate>Sat, 07 Nov 2009 17:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=978#comment-1993</guid>
		<description>Even though I agree that recursion is not the right way to find a Fibonacci number, I have to say using it to teach recursion is a good idea. Because its simple. Easy to get the concept thru this example.

The most common real world application for recursion is to walk thru a tree structure. That example will be complicated. Also you will have to have an understanding of trees and stuff before hand.

Then again, there may be a simple, but real world example that I&#039;m not yet aware of. If someone knows of one, let me know.</description>
		<content:encoded><![CDATA[<p>Even though I agree that recursion is not the right way to find a Fibonacci number, I have to say using it to teach recursion is a good idea. Because its simple. Easy to get the concept thru this example.</p>
<p>The most common real world application for recursion is to walk thru a tree structure. That example will be complicated. Also you will have to have an understanding of trees and stuff before hand.</p>
<p>Then again, there may be a simple, but real world example that I&#8217;m not yet aware of. If someone knows of one, let me know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amarghosh</title>
		<link>http://www.diovo.com/2009/11/recursion-bad-examples/comment-page-1/#comment-1991</link>
		<dc:creator>Amarghosh</dc:creator>
		<pubDate>Sat, 07 Nov 2009 09:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.diovo.com/?p=978#comment-1991</guid>
		<description>Well said. I don&#039;t remember how I was taught recursion - but I guess it was factorials. Even though it can be done with a simple loop, factorial is a good example to introduce recursion to a student I believe.

Btw, reached here from SO - where is the upvote button?</description>
		<content:encoded><![CDATA[<p>Well said. I don&#8217;t remember how I was taught recursion &#8211; but I guess it was factorials. Even though it can be done with a simple loop, factorial is a good example to introduce recursion to a student I believe.</p>
<p>Btw, reached here from SO &#8211; where is the upvote button?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
