TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Dynamic Progamming: First Principles

300 pointsby foxh0undover 7 years ago

14 comments

psykoticover 7 years ago
I&#x27;m fond of this old RAND report from Dreyfus, which is worth skimming if you&#x27;re mathematically inclined: Dynamic Programming and the Calculus of Variations, <a href="https:&#x2F;&#x2F;www.rand.org&#x2F;content&#x2F;dam&#x2F;rand&#x2F;pubs&#x2F;reports&#x2F;2006&#x2F;R441.pdf" rel="nofollow">https:&#x2F;&#x2F;www.rand.org&#x2F;content&#x2F;dam&#x2F;rand&#x2F;pubs&#x2F;reports&#x2F;2006&#x2F;R441...</a><p>One important takeaway is that dynamic programming in the Bellman formulation is a discrete analogue of Hamilton-Jacobi theory in how it writes down an equation for the optimal value as a function of a given endpoint rather than writing down an equation for the path as with the Euler-Lagrange equations. (You can reconstruct the path from the value function after the fact by gradient descent.) The relationship between Hamilton-Jacobi and Euler-Lagrange is the classical version of wave-particle duality. A concrete example in geometrical optics is the eikonal equation, a Hamilton-Jacobi type PDE, versus the geodesic equation, an Euler-Lagrange type ODE. Not coincidentally, one common numerical method for the eikonal equation called the fast marching method is a dynamic programming algorithm, very similar to Dijkstra&#x27;s algorithm for shortest paths.<p>It should be mentioned that any &quot;local&quot; equation like a PDE or ODE cannot describe a globally optimal solution without strong assumptions such as convexity. In fact, satisfying the Euler-Lagrange equation isn&#x27;t even sufficient for local optimality without further qualifications (Weierstrass conditions). But the Bellman dynamic programming equation, being recursive, can describe globally optimal solutions.
评论 #15552925 未加载
santaclausover 7 years ago
&gt; Memorisation<p>It is memoization, not memorisation! Although for two weeks in algorithms class I did in fact think our prof was just pronouncing memorize in a cutesy manner.
评论 #15547047 未加载
评论 #15546783 未加载
评论 #15546500 未加载
评论 #15546381 未加载
评论 #15546575 未加载
krat0sprakharover 7 years ago
While dynamic programming is taught in almost all algorithms classes, I think I finally grokked it after implementing it in a few practice problems. Would strongly recommend giving a few exercises listed here a shot: <a href="https:&#x2F;&#x2F;leetcode.com&#x2F;tag&#x2F;dynamic-programming&#x2F;" rel="nofollow">https:&#x2F;&#x2F;leetcode.com&#x2F;tag&#x2F;dynamic-programming&#x2F;</a>
评论 #15546175 未加载
评论 #15549761 未加载
评论 #15546313 未加载
评论 #15546499 未加载
et2oover 7 years ago
Favorite examples for applications of dynamic programming? Mine are sequence alignment&#x2F;BLAST in bioinformatics, but I&#x27;m sure there are many of which I am not aware in other fields.
评论 #15548275 未加载
评论 #15546146 未加载
评论 #15546243 未加载
评论 #15546166 未加载
评论 #15546445 未加载
评论 #15546104 未加载
评论 #15548586 未加载
评论 #15546418 未加载
评论 #15546083 未加载
评论 #15546125 未加载
whtover 7 years ago
In O.R. graduate School, Professor Gene Woolsey told us that he&#x27;d rise from the grave and stand on our desks screaming &#x27;No!No!No!&#x27; if we ever actually used it to solve a practical problem.<p>IIRC, his complaints were about the speed of formulation, difficulty to understand and communicate the model to others, and the processing required to regenerate answers when the model changed.<p>I believe Optiant used Dynamic Programming for supply chain optimization.. So people do or did use it for practical problem solving. ..I think.
评论 #15546495 未加载
评论 #15546187 未加载
评论 #15546439 未加载
评论 #15547015 未加载
mratsimover 7 years ago
For the last part about economic optimization, I would not approach it with Dynamic Programming. As evidenced by go and many games, doing the &quot;local&quot; best move does not guarantee the best result in the end. If brute-forcing is untractable, the state-of-the-art is using Monte-Carlo Tree Search as evidenced by its dominance in board games, Magic the Gathering, Poker, robots competitions, RTS, etc ...
评论 #15549933 未加载
charlyslover 7 years ago
I learned it as part of speech processing, first for Dynamic Time Warping and then as the Viterbi and Baum Welch algorithms. Together with Hidden Markov Models it&#x27;s a thing of beauty how it is used to model speech.<p>All of this is explained very intuitively in speech.zone<p>In the wikipedia entry there is a fun (really) explanation of why its creator called it like this.
评论 #15548227 未加载
HHestover 7 years ago
Please note, the last name of the author referenced in the article is &quot;Trick&quot;, not Tick.<p><a href="http:&#x2F;&#x2F;mat.gsia.cmu.edu&#x2F;classes&#x2F;dynamic&#x2F;dynamic.html" rel="nofollow">http:&#x2F;&#x2F;mat.gsia.cmu.edu&#x2F;classes&#x2F;dynamic&#x2F;dynamic.html</a>
评论 #15549881 未加载
tommsy64over 7 years ago
There appears to be a missing return statement in the Fibonacci Number example in the if block. Should look like this: <a href="https:&#x2F;&#x2F;repl.it&#x2F;NLIf&#x2F;1" rel="nofollow">https:&#x2F;&#x2F;repl.it&#x2F;NLIf&#x2F;1</a>
moliktoover 7 years ago
Why use monospace font?????
评论 #15548976 未加载
评论 #15548859 未加载
评论 #15547436 未加载
misja111over 7 years ago
&gt; Tail recursion [3], a variant of traditional recursion implements memoisation, which uses memoisation very economically.<p>I don&#x27;t understand this part, can anybody explain?
评论 #15548261 未加载
fmihailaover 7 years ago
Glaring typo in the title: it should say progRamming.
BucketSortover 7 years ago
Obligatory Demaine lectures - <a href="https:&#x2F;&#x2F;youtu.be&#x2F;OQ5jsbhAv_M" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;OQ5jsbhAv_M</a>
评论 #15547259 未加载
yipopovover 7 years ago
Would it have killed him to use a proportional font? We have the technology to accomplish that now.