<?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"
	>
<channel>
	<title>Comments on: SICP sections 1.2.4 - 1.2.5</title>
	<atom:link href="http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/</link>
	<description>Eli Bendersky's personal website</description>
	<pubDate>Thu, 04 Dec 2008 00:34:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Samad</title>
		<link>http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/#comment-138592</link>
		<dc:creator>Samad</dc:creator>
		<pubDate>Thu, 13 Nov 2008 23:13:38 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/#comment-138592</guid>
		<description>One thing I'd like to note that there is a very simple trick to Exercise 1.16, although not explicitly stated by Eli. From the hint, it's obvious that a and n can change in each iteration. It is not quite so obvious that b can change too. It is this simple insight that produces a clean, elegant solution.

Also, why does the T_{p'q'} transformation produce a double-Fibonacci? While I could arrive at the solution for computing p' and q' without much difficulty, but it's not so obvious &lt;i&gt;why&lt;/i&gt; this works.</description>
		<content:encoded><![CDATA[<p>One thing I&#8217;d like to note that there is a very simple trick to Exercise 1.16, although not explicitly stated by Eli. From the hint, it&#8217;s obvious that a and n can change in each iteration. It is not quite so obvious that b can change too. It is this simple insight that produces a clean, elegant solution.</p>
<p>Also, why does the T_{p&#8217;q'} transformation produce a double-Fibonacci? While I could arrive at the solution for computing p&#8217; and q&#8217; without much difficulty, but it&#8217;s not so obvious <i>why</i> this works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/#comment-114471</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Fri, 07 Mar 2008 14:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/#comment-114471</guid>
		<description>Brit,

Well, it looks exactly like the code I've posted, only translated to Scheme. The only difference would perhaps be in the function &lt;code&gt;double&lt;/code&gt;. But that doesn't affect the complexity of the code.</description>
		<content:encoded><![CDATA[<p>Brit,</p>
<p>Well, it looks exactly like the code I&#8217;ve posted, only translated to Scheme. The only difference would perhaps be in the function <code>double</code>. But that doesn&#8217;t affect the complexity of the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brit Butler</title>
		<link>http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/#comment-114015</link>
		<dc:creator>Brit Butler</dc:creator>
		<pubDate>Tue, 04 Mar 2008 19:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/04/sicp-sections-124-125/#comment-114015</guid>
		<description>Eli,

Is this code for example 1.17 equivalent in complexity?

(define (* a b)
  (define (double x)
    (+ x x))
  (define (halve x)
    (/ x 2)
  (cond ((= b 0) 0)
	((= a 0) 0)
	((= b 1) a)
	((even? b) (* (double a) (halve b)))
	(else (+ a (* a (- b 1))))))</description>
		<content:encoded><![CDATA[<p>Eli,</p>
<p>Is this code for example 1.17 equivalent in complexity?</p>
<p>(define (* a b)<br />
  (define (double x)<br />
    (+ x x))<br />
  (define (halve x)<br />
    (/ x 2)<br />
  (cond ((= b 0) 0)<br />
	((= a 0) 0)<br />
	((= b 1) a)<br />
	((even? b) (* (double a) (halve b)))<br />
	(else (+ a (* a (- b 1))))))</p>
]]></content:encoded>
	</item>
</channel>
</rss>
