r/programming • • Apr 24 '10

Why "dynamic programming"?

http://arcanesentiment.blogspot.com/2010/04/why-dynamic-programming.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ArcaneSentiment+%28Arcane+Sentiment%29
90 Upvotes

66 comments sorted by

View all comments

1

u/travis_of_the_cosmos Apr 24 '10

I don't know what the shit memoization is but I'm tempted to believe that the anonymous commentor on this article got it right and that the author is just confused.

Dynamic programming on the other hand I know well. It's the discretized analogue of doing hamiltonians - constrained optimization under a sum rather than an integral. Bellman proved that this can be reduced to a recursive relationship (V = f(x,V')) with a bunch of nice properties. DP problems are often solvable numerically, for example, even nasty ones.

The name has always bugged me, though. I'd definitely buy the story that Bellman made it up to fool congressmen.

2

u/Raynes Apr 24 '10

(fib 3123452233462645324534243126314334) ... result is printed 30 years later

(fib 3123452233462645324534243126314334) ... result is printed instantly

Memoized.

1

u/travis_of_the_cosmos Apr 24 '10

Okay, so I still don't know what memoization is, but since you seem to understand it what does it have to do with optimal control theory?

1

u/andreasvc Apr 24 '10

Memoization of a function means storing every result that has been computed so that it is never computed twice. Ie., you trade storage for speed. Memoization stores tuples of arguments and results in a mapping, whereas Dynamic Programming can use a more sophisticated/efficient storage method.