<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>20bits - Latest Comments in Introduction to Dynamic Programming | 20bits</title><link>http://20bits.disqus.com/</link><description></description><language>en</language><lastBuildDate>Thu, 16 Jul 2009 16:48:28 -0000</lastBuildDate><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-12765879</link><description>great post,</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">coderoger</dc:creator><pubDate>Thu, 16 Jul 2009 16:48:28 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-11726448</link><description>Nice work. Keep it up.....</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pickatutorial</dc:creator><pubDate>Thu, 25 Jun 2009 11:14:11 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-11610028</link><description>Superb tutorial..........nice one!!!!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">biker</dc:creator><pubDate>Tue, 23 Jun 2009 03:49:53 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-9485784</link><description>Excellent..</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nilavalagan</dc:creator><pubDate>Mon, 18 May 2009 00:39:21 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3798163</link><description>you should make a function that returns the nth fibonacci number without using recursion.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">james</dc:creator><pubDate>Sun, 16 Nov 2008 02:55:45 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3794181</link><description>Come to think of it, I think this might be cleaner:&lt;br&gt;&lt;br&gt;def fib2(n):&lt;br&gt;	n2, n1 = 0, 1&lt;br&gt;	for i in range(n):&lt;br&gt;		n2, n1 = n1, n1 + n2&lt;br&gt;	return n2</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SimonTewbi</dc:creator><pubDate>Sat, 15 Nov 2008 17:33:00 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3794022</link><description>Great article, thanks Jesse.&lt;br&gt;&lt;br&gt;By the way, I believe your fib2 function is missing a line.  It is incorrect for n=0.  I think it should read:&lt;br&gt;&lt;br&gt;def fib2(n):&lt;br&gt;	if n == 0: return 0&lt;br&gt;	n2, n1 = 0, 1&lt;br&gt;	for i in range(n-2):&lt;br&gt;		n2, n1 = n1, n1 + n2&lt;br&gt;	return n2 + n1&lt;br&gt;&lt;br&gt;Cheers&lt;br&gt;Simon</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SimonTewbi</dc:creator><pubDate>Sat, 15 Nov 2008 17:10:22 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793298</link><description>offo,&lt;br&gt;&lt;br&gt;Sorry for making you work so hard.  Do you have any examples of good graphs?&lt;br&gt;&lt;br&gt;Help me learn &amp;mdash; don't just berate me.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse</dc:creator><pubDate>Sat, 15 Nov 2008 16:53:52 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793297</link><description>Ok if I want to a view an image I don't want to see some stupid transition. Show me the goddamn image.&lt;br&gt;&lt;br&gt;Second, your graphs are hard to read. Why does your graph use a gradient background? The change in contrast makes it difficult to read and gives really no benefit.&lt;br&gt;&lt;br&gt;Also your graphs go against the norm, the label of the y axis is upside down. I don't care if it is your software or some designer jerk being a douchebag suggesting this is better...&lt;br&gt;&lt;br&gt;IT ISN'T. I have to parse through 100s of chart a day in my day job and this kind of shit just pisses me off. I shouldn't have to fight with your eye-candy.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">offo foffo</dc:creator><pubDate>Sat, 15 Nov 2008 16:25:04 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793301</link><description>Great post - simple introduction to a complex algorithmic concept.&lt;br&gt;&lt;br&gt;Regarding the knapsack problem, once the table is ready, the complexity is indeed only O(nW)&lt;br&gt;But building the table itself is of exponential cost in terms of running time, correct?&lt;br&gt;We go through every single possibility using recursion to build the table, and I think running time to build the table is n^m. It would be great if you could clarify.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Metta</dc:creator><pubDate>Sat, 18 Oct 2008 19:27:20 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793295</link><description>Horst,&lt;br&gt;&lt;br&gt;Thanks.  I wrote this like a year and a half ago &amp;mdash; I'm surprised nobody has caught that yet.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse</dc:creator><pubDate>Sun, 12 Oct 2008 13:13:06 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793294</link><description>Jack,&lt;br&gt;&lt;br&gt;I'm using a Ruby graphing library called Gruff.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse</dc:creator><pubDate>Sun, 12 Oct 2008 13:12:29 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793293</link><description>re: Memoization&lt;br&gt;&lt;br&gt;Perl also has a module called &lt;a href="http://search.cpan.org/dist/Memoize" rel="nofollow"&gt;Memoize&lt;/a&gt; and its been part of the core Perl library for some years now.&lt;br&gt;&lt;br&gt;Here's an article about &lt;a href="http://search.cpan.org/src/MJD/Memoize-1.01/article.html" rel="nofollow"&gt;Memoization&lt;/a&gt; by the author of the above module.&lt;br&gt;&lt;br&gt;/I3az/&lt;br&gt;&lt;br&gt;PS. Nice article.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">draegtun</dc:creator><pubDate>Sun, 12 Oct 2008 08:57:59 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793292</link><description>What tool did you used to create this figures (&lt;a href="http://20bits.com/include/images/fib_performance.png%29?" rel="nofollow"&gt;http://20bits.com/include/images/fib_performanc...&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jack</dc:creator><pubDate>Sun, 12 Oct 2008 07:19:53 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793291</link><description>Great article, I would like to read more of these!&lt;br&gt;&lt;br&gt;But it seems I'm the first one to actually try your function A(..), as it doesn't work:&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; A([10, 20], [30, 40], 2, 10000)&lt;br&gt;Traceback (most recent call last):&lt;br&gt;  File "", line 1, in &lt;br&gt;  File "", line 3, in A&lt;br&gt;IndexError: list index out of range&lt;br&gt;&lt;br&gt;You're mixing zero-based arrays (Python) and one-based arrays (your text), so the correct function A would look like this:&lt;br&gt;&lt;br&gt;def A(w, v, i,j):&lt;br&gt;	if i == 0 or j == 0: return 0&lt;br&gt;	if w[i-1] &amp;gt; j:  return A(w, v, i-1, j)&lt;br&gt;	else: return max(A(w,v, i-1, j), v[i-1] + A(w,v, i-1, j - w[i-1]))&lt;br&gt;&lt;br&gt;Cheers&lt;br&gt;Horst</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Horst</dc:creator><pubDate>Sun, 12 Oct 2008 04:35:08 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793296</link><description>Nice introduction to dynamic programming.  Some of your readers might enjoy the small article on the doing arithmetic using dynamic programming and how you can use it to bet on the world series: &lt;a href="http://www.win-vector.com/dfiles/BestOf.pdf" rel="nofollow"&gt;http://www.win-vector.com/dfiles/BestOf.pdf&lt;/a&gt; .</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Mount</dc:creator><pubDate>Sat, 11 Oct 2008 20:18:43 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793290</link><description>thank you, i enjoyed your article, but i do think you could clarify part of the maximal sum section.  i had the same problem as EK because it's not made explicit in the description that when you change j, you don't change the bounds or s.  (it's clear from the code, though).&lt;br&gt;&lt;br&gt;specifically the phrase "if t+a[i] is negative set t = 0 and set the left-hand bound of the optimal subarray to i+1" should be revised, since actually the optimal subarray does not change; only the starting point of further consideration changes. (consider [1,2,-5,1,1,-2]: t goes negative but the optimal subarray remains at the front.)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John</dc:creator><pubDate>Wed, 24 Sep 2008 03:29:02 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793289</link><description>Really very nicely written. So easy was this to understand. Thank you.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Pratyush</dc:creator><pubDate>Thu, 26 Jun 2008 14:48:30 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793300</link><description>Typo: overlappling</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Trevor</dc:creator><pubDate>Fri, 16 May 2008 18:44:37 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793299</link><description>Nice explaination! Check out some more dynamic programming puzzles on fudge.&lt;br&gt;&lt;a href="http://fudge.fit.edu/Problems/Archive" rel="nofollow"&gt;http://fudge.fit.edu/Problems/Archive&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David</dc:creator><pubDate>Fri, 16 May 2008 01:10:31 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793286</link><description>please send me some characteristic of dynamic programming, multi stage decision process, max-min and min-max route all in dynamic programming to &lt;a href="mailto:miriamudele4real@yahoo.co.uk" rel="nofollow"&gt;miriamudele4real@yahoo.co.uk&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">miriaim</dc:creator><pubDate>Mon, 17 Mar 2008 10:26:13 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793287</link><description>good work man...[:)]&lt;br&gt;give some code implementation also...</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">eatesh</dc:creator><pubDate>Fri, 22 Feb 2008 15:04:42 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793288</link><description>CT,&lt;br&gt;&lt;br&gt;It's called Dean's Code Highlighter.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse</dc:creator><pubDate>Tue, 22 Jan 2008 19:09:29 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793285</link><description>Hey Jesse,&lt;br&gt;&lt;br&gt;Great post.  What wordpress plugin do you use to embed code in your posts?&lt;br&gt;&lt;br&gt;Thanks</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">CT</dc:creator><pubDate>Mon, 21 Jan 2008 15:08:42 -0000</pubDate></item><item><title>Re: Introduction to Dynamic Programming | 20bits</title><link>http://20bits.com/articles/introduction-to-dynamic-programming/#comment-3793279</link><description>&amp;gt; If t + a[i] is negative, however, the contiguity constraint&lt;br&gt;&amp;gt; means that we cannot include a[j:i+1] in our subarray since&lt;br&gt;&amp;gt; any such subarray will have a smaller sum than a subarray without it.&lt;br&gt;&lt;br&gt;What if all the numbers in the array are negative?  I guess this is okay if the Maximum Subarray can be zero length.&lt;br&gt;&lt;br&gt;If the subarray can't be zero length, do we have to go to a O(N^2) solution?  Would it suffice to keep track of the largest single number?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mike</dc:creator><pubDate>Sat, 23 Jun 2007 19:54:06 -0000</pubDate></item></channel></rss>