<?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: Summing up</title>
	<atom:link href="http://bit-player.org/2006/summing-up/feed" rel="self" type="application/rss+xml" />
	<link>http://bit-player.org/2006/summing-up</link>
	<description>An amateur's outlook on computation and mathematics.</description>
	<pubDate>Wed, 10 Mar 2010 19:40:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: R.W.</title>
		<link>http://bit-player.org/2006/summing-up#comment-119</link>
		<dc:creator>R.W.</dc:creator>
		<pubDate>Fri, 12 May 2006 16:14:51 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=38#comment-119</guid>
		<description>To follow up on Arvind's comment: that is to say, the gauss program runs in O((log n)^2) steps, and the brute program runs in AT LEAST n^2 steps. An exponential difference...</description>
		<content:encoded><![CDATA[<p>To follow up on Arvind&#8217;s comment: that is to say, the gauss program runs in O((log n)^2) steps, and the brute program runs in AT LEAST n^2 steps. An exponential difference&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arvind Narayanan</title>
		<link>http://bit-player.org/2006/summing-up#comment-116</link>
		<dc:creator>Arvind Narayanan</dc:creator>
		<pubDate>Thu, 11 May 2006 21:00:52 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=38#comment-116</guid>
		<description>To the previous commenter: please get a clue. The standard, grade school multiplication algorithm is quadratic in the number of digits, not in n.

With that out of the way:

"For all we know, sum could implement the n(n+1)/2 algorithm"

That's not possible, because python doesn't have lazy evaluation and therefore sum cannot realize that it is being called on a range. All it sees is a list. I'm just picking nits here, but also wondering if you wrote that because of your Lisp background :)

Also, isn't "reduce(lambda x, y: x+y, [f(x) for x in range(1,n+1)])" more pythonic than a for loop?

Anways, nice article.</description>
		<content:encoded><![CDATA[<p>To the previous commenter: please get a clue. The standard, grade school multiplication algorithm is quadratic in the number of digits, not in n.</p>
<p>With that out of the way:</p>
<p>&#8220;For all we know, sum could implement the n(n+1)/2 algorithm&#8221;</p>
<p>That&#8217;s not possible, because python doesn&#8217;t have lazy evaluation and therefore sum cannot realize that it is being called on a range. All it sees is a list. I&#8217;m just picking nits here, but also wondering if you wrote that because of your Lisp background :)</p>
<p>Also, isn&#8217;t &#8220;reduce(lambda x, y: x+y, [f(x) for x in range(1,n+1)])&#8221; more pythonic than a for loop?</p>
<p>Anways, nice article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandre MuÃ±iz</title>
		<link>http://bit-player.org/2006/summing-up#comment-115</link>
		<dc:creator>Alexandre MuÃ±iz</dc:creator>
		<pubDate>Thu, 11 May 2006 05:38:01 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=38#comment-115</guid>
		<description>Whoa there. The Gauss program is not O(1), because multiplication isn't. The standard, grade school multiplication algorithm is O(n^2), and so is your brute force algorithm. Which doesn't mean the former wont run a lot more quickly in practice.

But there are other multiplication algorithms that are better than O(n^2). Karatsuba multiplication is O(n^(ln3/ln2)). (About O(n^1.58)) And the great thing is, Python uses Karatsuba multiplication automatically for large enough numbers. (When there are less than about 100 digits in the numbers multiplied, the grade school algorithm is faster.)</description>
		<content:encoded><![CDATA[<p>Whoa there. The Gauss program is not O(1), because multiplication isn&#8217;t. The standard, grade school multiplication algorithm is O(n^2), and so is your brute force algorithm. Which doesn&#8217;t mean the former wont run a lot more quickly in practice.</p>
<p>But there are other multiplication algorithms that are better than O(n^2). Karatsuba multiplication is O(n^(ln3/ln2)). (About O(n^1.58)) And the great thing is, Python uses Karatsuba multiplication automatically for large enough numbers. (When there are less than about 100 digits in the numbers multiplied, the grade school algorithm is faster.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
