<?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/"
	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>Comments on: Summing Subsets</title>
	<atom:link href="http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/feed/" rel="self" type="application/rss+xml" />
	<link>http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/</link>
	<description>I Never Metaop I Didn&#039;t Like</description>
	<lastBuildDate>Thu, 07 Mar 2013 12:58:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: roy_hu</title>
		<link>http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/#comment-2452</link>
		<dc:creator><![CDATA[roy_hu]]></dc:creator>
		<pubDate>Thu, 14 Oct 2010 05:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://justrakudoit.wordpress.com/?p=210#comment-2452</guid>
		<description><![CDATA[I uploaded my Haskell code to http://gist.github.com/625639  I know no perl.]]></description>
		<content:encoded><![CDATA[<p>I uploaded my Haskell code to <a href="http://gist.github.com/625639" rel="nofollow">http://gist.github.com/625639</a>  I know no perl.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Bollman</title>
		<link>http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/#comment-2451</link>
		<dc:creator><![CDATA[Tim Bollman]]></dc:creator>
		<pubDate>Tue, 12 Oct 2010 17:43:25 +0000</pubDate>
		<guid isPermaLink="false">http://justrakudoit.wordpress.com/?p=210#comment-2451</guid>
		<description><![CDATA[Shorter version that doesn&#039;t reuse the count array but would theoretically have multi-threading.  There&#039;s no requirement that @a be presorted:
my @a = ...
my $biggest = @a.max
my @counts = (1, 0 xx $biggest)
@counts = @counts &gt;&gt;+&lt;&lt; (0 xx $_, @counts[0 .. $biggest - $_]) for @a
[+] (-@a.elems, @counts[@a])]]></description>
		<content:encoded><![CDATA[<p>Shorter version that doesn&#8217;t reuse the count array but would theoretically have multi-threading.  There&#8217;s no requirement that @a be presorted:<br />
my @a = &#8230;<br />
my $biggest = @a.max<br />
my @counts = (1, 0 xx $biggest)<br />
@counts = @counts &gt;&gt;+&lt;&lt; (0 xx $_, @counts[0 .. $biggest - $_]) for @a<br />
[+] (-@a.elems, @counts[@a])</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Bollman</title>
		<link>http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/#comment-2449</link>
		<dc:creator><![CDATA[Tim Bollman]]></dc:creator>
		<pubDate>Tue, 12 Oct 2010 03:30:56 +0000</pubDate>
		<guid isPermaLink="false">http://justrakudoit.wordpress.com/?p=210#comment-2449</guid>
		<description><![CDATA[For the explanation of how that works in more abstract terms than what I do:
1. We start with an array of how many ways we can get to a particular number given all the numbers smaller than the current one.
2. We add the current number to all numbers that could previously be reached to get the list of all numbers that can be reached using the current number and any of the previous numbers.
3. Pairwise add the list of previous counts to the ways we can get to numbers using the current number.
4. Step to the next number in our master set until exhausted.
5. sum up all the counts.  Subtract out the number of elements in the master set because our count set contains the 1 element subsets which aren&#039;t allowed in the problem.
My program merges steps 2 and 3 because as long as you go from the big numbers to the small numbers, you don&#039;t need to keep track of the old counts. And messes up step 2 a little because I should have initialized @count as (1, 0 xx 99) so I could remove the @counts[$a]++.  Also the .. 100 should be .. 99.]]></description>
		<content:encoded><![CDATA[<p>For the explanation of how that works in more abstract terms than what I do:<br />
1. We start with an array of how many ways we can get to a particular number given all the numbers smaller than the current one.<br />
2. We add the current number to all numbers that could previously be reached to get the list of all numbers that can be reached using the current number and any of the previous numbers.<br />
3. Pairwise add the list of previous counts to the ways we can get to numbers using the current number.<br />
4. Step to the next number in our master set until exhausted.<br />
5. sum up all the counts.  Subtract out the number of elements in the master set because our count set contains the 1 element subsets which aren&#8217;t allowed in the problem.<br />
My program merges steps 2 and 3 because as long as you go from the big numbers to the small numbers, you don&#8217;t need to keep track of the old counts. And messes up step 2 a little because I should have initialized @count as (1, 0 xx 99) so I could remove the @counts[$a]++.  Also the .. 100 should be .. 99.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Bollman</title>
		<link>http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/#comment-2448</link>
		<dc:creator><![CDATA[Tim Bollman]]></dc:creator>
		<pubDate>Tue, 12 Oct 2010 03:14:51 +0000</pubDate>
		<guid isPermaLink="false">http://justrakudoit.wordpress.com/?p=210#comment-2448</guid>
		<description><![CDATA[This should do the trick:
my @a = 3, 4, 9, 14, 15, 19, 28, 37, 47, 50, 54, 56, 59, 61, 70, 73, 78, 81, 92, 95, 97, 99;
my @counts = 0 xx 100;
for @a -&gt; $a
{
 for reverse $a .. 100 -&gt; $b
 {
  if @counts[$b - $a] != 0
  {
   @counts[$b] += @counts[$b - $a];
  }
 }
 @counts[$a]++;
}
say [+] (-@a.elems, @counts[@a]);]]></description>
		<content:encoded><![CDATA[<p>This should do the trick:<br />
my @a = 3, 4, 9, 14, 15, 19, 28, 37, 47, 50, 54, 56, 59, 61, 70, 73, 78, 81, 92, 95, 97, 99;<br />
my @counts = 0 xx 100;<br />
for @a -&gt; $a<br />
{<br />
 for reverse $a .. 100 -&gt; $b<br />
 {<br />
  if @counts[$b - $a] != 0<br />
  {<br />
   @counts[$b] += @counts[$b - $a];<br />
  }<br />
 }<br />
 @counts[$a]++;<br />
}<br />
say [+] (-@a.elems, @counts[@a]);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: colomon</title>
		<link>http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/#comment-2447</link>
		<dc:creator><![CDATA[colomon]]></dc:creator>
		<pubDate>Mon, 11 Oct 2010 18:19:47 +0000</pubDate>
		<guid isPermaLink="false">http://justrakudoit.wordpress.com/?p=210#comment-2447</guid>
		<description><![CDATA[Would you care to provide an implementation?  This sounds like an interesting and useful way of solving the problem.]]></description>
		<content:encoded><![CDATA[<p>Would you care to provide an implementation?  This sounds like an interesting and useful way of solving the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roy_hu</title>
		<link>http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/#comment-2446</link>
		<dc:creator><![CDATA[roy_hu]]></dc:creator>
		<pubDate>Mon, 11 Oct 2010 18:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://justrakudoit.wordpress.com/?p=210#comment-2446</guid>
		<description><![CDATA[You could use dynamic programming to solve this problem instantly. To start, build a 2D-table in which the rows represent the source set, and the columns represent sum targets between 3 and 99.]]></description>
		<content:encoded><![CDATA[<p>You could use dynamic programming to solve this problem instantly. To start, build a 2D-table in which the rows represent the source set, and the columns represent sum targets between 3 and 99.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
