Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Talk:Dynamic programming

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is thetalk page for discussing improvements to theDynamic programming article.
This isnot a forum for general discussion of the subject of the article.
Find sources: Google (books ·news ·scholar ·free images ·WP refs·FENS ·JSTOR ·TWL
Archives:1Auto-archiving period:12 months 
This level-5 vital article is ratedB-class on Wikipedia'scontent assessment scale.
It is of interest to the followingWikiProjects:
WikiProject iconComputer scienceTop‑importance
WikiProject iconThis article is within the scope ofWikiProject Computer science, a collaborative effort to improve the coverage ofComputer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can jointhe discussion and see a list of open tasks.Computer scienceWikipedia:WikiProject Computer scienceTemplate:WikiProject Computer scienceComputer science
TopThis article has been rated asTop-importance on theproject's importance scale.
Things you can helpWikiProject Computer science with:

WikiProject iconMolecular Biology:COMPBIO
WikiProject iconThis article is within the scope ofWikiProject Molecular Biology, a collaborative effort to improve the coverage ofmolecular biology on Wikipedia. If you would like to participate, please visit the project page, where you can jointhe discussion and see a list of open tasks.Molecular BiologyWikipedia:WikiProject Molecular BiologyTemplate:WikiProject Molecular BiologyMolecular Biology
???This article has not yet received a rating on theproject's importance scale.
Taskforce icon
This article is supported bythe Computational Biology task force (assessed asTop-importance).
WikiProject iconSystems: Control theoryHigh‑importance
WikiProject iconThis article is within the scope ofWikiProject Systems, which collaborates on articles related tosystems andsystems science.SystemsWikipedia:WikiProject SystemsTemplate:WikiProject SystemsSystems
HighThis article has been rated asHigh-importance on theproject's importance scale.
Taskforce icon
This article is within the field ofControl theory.
WikiProject iconMathematicsMid‑priority
WikiProject iconThis article is within the scope ofWikiProject Mathematics, a collaborative effort to improve the coverage ofmathematics on Wikipedia. If you would like to participate, please visit the project page, where you can jointhe discussion and see a list of open tasks.MathematicsWikipedia:WikiProject MathematicsTemplate:WikiProject Mathematicsmathematics
MidThis article has been rated asMid-priority on theproject's priority scale.


Archives
1


This page has archives. Topics inactive for365 days are automatically archived1 or more at a time byLowercase sigmabot III if there are more than5.

Confusion

[edit]

The first paragraph of the second part and the article onalgorithms states that dynamic programming is abottom-up approach, but later this article says dynamic programming may use bottom-up or top-down approaches.--zeno 11:46, 9 Feb 2004 (UTC)

I've revised that section. It was very vague and somewhat incorrect. I hope there's less confusion now.Derrick Coetzee 20:18, 5 Oct 2004 (UTC)

Weirdness

[edit]

The page says "i dont know" in those terms, which is not only weirdly misplaced, but also improperly formatted. Someone check.

Misplaced section

[edit]

The part following "The steps for using dynamic program goes as follows:" is out of place. Out of nowhere the article starts using terms like 'gap penalties' and 'sequence alignment.' Seems like this was copied from some article on a specific application, such as protien sequencing. Anon, Wed Jul 11 14:11:43 EDT 2007

Too many examples

[edit]

This is not a textbook. One good example would suffice. Even worse, many of them are just too long (and boring). Put them in wikibooks. Unfortunately, any attempt to fix this article would be blocked as "vandalism". Way to go,Wikipedia!

Why ALGOL

[edit]

Hello , in

function fib(n)

   if n <= 1 return n   return fib(n − 1) + fib(n − 2)

I doubt that the return function would return a false if, so maybe you make a if n larger or equal to 1 out of it ?That also has the nice side effect that the Fibonacci numbers would become larger than -1, like the original series is larger than +1, I guess that is what you intended ...

Call-by-need is not memoization

[edit]

Someprogramming languages can automaticallymemoize the result of a function call with a particular set of arguments, in order to speed upcall-by-name evaluation (this mechanism is referred to ascall-by-need).

This is technically correct but quite misleadingly worded. In call-by-need, the value at aparticular call site may be (but need not be) memoized. If I call the same function with the same arguments but from a different call site, the result will be computed again. That is, rather than a memo table, call-by-need at most provides a cached value for a particular function call.

For example, in Haskell, a "lazy" language with call-by-need, we can define factorial recursively as

factn=ifn==0then1elsen*fact(n-1)

If we then call it from a single call site

sum(map(\_->fact5)[1..3])

the call tofact 5 and its child calls will each be evaluated but once, even though the lambda appears to be evaluated three times.

However, in

fact5+fact5+fact5

each call tofact 5 and children will be evaluated separately: no memoization will occur.

This distinction makes call-by-need useless for memoization when decomposing a typical recursion: the subproblems are all called from separate call sites, and thus no memoization will occur.

Some languages make it possible portably (e.g.Scheme,Common Lisp,Perl orD).

Citations needed, at the least. Futures / promises are not a memoization mechanism, but a manual implementation of the call-by-need caching described above. In general Scheme and Perl, at least, are strict languages as far as I am aware.Bart Massey (talk)20:03, 19 February 2025 (UTC)[reply]

A type of balanced 0–1 matrix

[edit]

This section describes a dynamic programming approach, in which the state of a partially-filled matrix specifies, for each column, the number of 0's and 1's to be placed in that column. This simplifies the problem, but not nearly enough to compute all of the terms included in the OEIS. In the case of an 18 by 18 matrix, this approach requires 44,926,130,009,521,017 different states. For example, after filling one row there are 48,620 different states. Each of these states has (9, 8) nine times and (8, 9) nine times, and there is one way to reach each of these states.

A better approach is to realize that these states are essentially all the same. We can count matrices without knowing which columns are (9, 8) and which columns are (8, 9). I would describe all of these as a single state (9, 9, 0, 0, 0, 0, 0, 0, 0, 0), indicating 9 columns with 0 ones, 9 columns with 1 one, and 0 columns with 2, 3, 4, 5, 6, 7, 8, or 9 ones. There are 48,620 ways to reach this state.

After filling the second row, there are 10 different states: (0, 18, 0, 0, 0, 0, 0, 0, 0, 0), (1, 16, 1, 0, 0, 0, 0, 0, 0, 0), (2, 14, 2, 0, 0, 0, 0, 0, 0, 0), ..., (9, 0, 9, 0, 0, 0, 0, 0, 0, 0). This approach uses a total of 194,182 states to count about 2.2*1072 matrices.David.wasserman (talk)01:06, 19 May 2025 (UTC)[reply]

External links

[edit]
Some things just grow during incremental edits and sometimes get out of hand. The "External links" section, one of the optional appendices, has grown to 12 entries. Three seems to be an acceptable number, and of course, everyone has their favorite to try to add for a fourth.Consensus needs to determine this. A tag indicates concerns.
However, none is needed for article promotion.
Some links may be included inWP:ELNO, various points inWhat Wikipedia is not likeWP:NOTREPOSITORY orWP:NOTGUIDE,WP:ELDEAD, Others, listed below:
  • ELpoints #3) states:Links in the "External links" section should be kept to a minimum. A lack of external links or a small number of external links is not a reason to add external links.
  • LINKFARM states:There is nothing wrong with adding one or more useful content-relevant links to the external links section of an article; however, excessive lists can dwarf articles and detract from the purpose of Wikipedia. On articles about topics with many fansites, for example, including a link to one major fansite may be appropriate.
  • ELMIN:Minimize the number of links. --
  • ELCITE:Do not use{{cite web}} or other citation templates in the External links section. Citation templates are permitted in the Further reading section.
External linksThis page in a nutshell:External links in an article can be helpful to the reader, but they should be kept minimal, meritable, and directly relevant to the article. With rare exceptions, external links should not be used in the body of an article.
Second paragraph,acceptable external links include those that contain further research that is accurate and on-topic, information that could not be added to the article for reasons such as copyright or amount of detail, or other meaningful, relevant content that is not suitable for inclusion in an article for reasons unrelated to its accuracy.
    • Please also note:
  • WP:ELBURDEN:Disputed links should be excluded by default unless and until there is a consensus to include them. Please do not add back more links without consensus. Simple solution to facilitate career maintenance tag. Move links here for discussion.
Moved links:
Retrieved from "https://en.wikipedia.org/w/index.php?title=Talk:Dynamic_programming&oldid=1322211247"
Categories:
Hidden category:

[8]ページ先頭

©2009-2026 Movatter.jp