<?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: Generating multi-subsets using arithmetic</title>
	<atom:link href="http://eli.thegreenplace.net/2009/07/11/generating-multi-subsets-using-arithmetic/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2009/07/11/generating-multi-subsets-using-arithmetic/</link>
	<description>Eli Bendersky's personal website</description>
	<lastBuildDate>Wed, 10 Mar 2010 17:32:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mark</title>
		<link>http://eli.thegreenplace.net/2009/07/11/generating-multi-subsets-using-arithmetic/comment-page-1/#comment-182256</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Mon, 13 Jul 2009 13:36:34 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1784#comment-182256</guid>
		<description>You can also use itertools.product for this, at least in Python 2.6 and later:

`&lt;code&gt;for x in itertools__abENT__#46;product(range(3), repeat=3): print x&lt;/code&gt;`

I&#039;m not sure multi-subset is a good name, since it suggests that order shouldn&#039;t matter:  that is, that {1, 1, 2} should be considered the same as {1, 2, 1}.</description>
		<content:encoded><![CDATA[<p>You can also use itertools.product for this, at least in Python 2.6 and later:</p>
<div class="backtick"><pre><code>for x in itertools&#46;product(range(3), repeat=3): print x</code></pre></div>
<p>I&#8217;m not sure multi-subset is a good name, since it suggests that order shouldn&#8217;t matter:  that is, that {1, 1, 2} should be considered the same as {1, 2, 1}.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2009/07/11/generating-multi-subsets-using-arithmetic/comment-page-1/#comment-182075</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Sun, 12 Jul 2009 17:06:36 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1784#comment-182075</guid>
		<description>@Steve,

Yep, project Euler would be hard without DP, which was what I used for problem 77 (with a similar algorithm to 76 and 31)</description>
		<content:encoded><![CDATA[<p>@Steve,</p>
<p>Yep, project Euler would be hard without DP, which was what I used for problem 77 (with a similar algorithm to 76 and 31)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://eli.thegreenplace.net/2009/07/11/generating-multi-subsets-using-arithmetic/comment-page-1/#comment-182041</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Sun, 12 Jul 2009 12:33:48 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1784#comment-182041</guid>
		<description>For Euler problem 77 (and many other &#039;counting&#039; problems) Dynamic Programming is very useful.
http://en.wikipedia.org/wiki/Dynamic_programming
Its worth looking into if you are not already familiar with it.</description>
		<content:encoded><![CDATA[<p>For Euler problem 77 (and many other &#8216;counting&#8217; problems) Dynamic Programming is very useful.<br />
<a href="http://en.wikipedia.org/wiki/Dynamic_programming" rel="nofollow">http://en.wikipedia.org/wiki/Dynamic_programming</a><br />
Its worth looking into if you are not already familiar with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2009/07/11/generating-multi-subsets-using-arithmetic/comment-page-1/#comment-181940</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Sat, 11 Jul 2009 17:38:14 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1784#comment-181940</guid>
		<description>@Larry,

This is by design, because an empty subset isn&#039;t interesting. If you need it, just change the initalization of &lt;code&gt;ar&lt;/code&gt; in the function to:


ar = [0] + [0] * (length - 1)
</description>
		<content:encoded><![CDATA[<p>@Larry,</p>
<p>This is by design, because an empty subset isn&#8217;t interesting. If you need it, just change the initalization of <code>ar</code> in the function to:</p>
<p>ar = [0] + [0] * (length &#8211; 1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry Hastings</title>
		<link>http://eli.thegreenplace.net/2009/07/11/generating-multi-subsets-using-arithmetic/comment-page-1/#comment-181939</link>
		<dc:creator>Larry Hastings</dc:creator>
		<pubDate>Sat, 11 Jul 2009 17:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1784#comment-181939</guid>
		<description>Your call to multiselects(2, 3) didn&#039;t generate [0, 0, 0].   Back to the drawing board!</description>
		<content:encoded><![CDATA[<p>Your call to multiselects(2, 3) didn&#8217;t generate [0, 0, 0].   Back to the drawing board!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
