Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
courses:cs211:winter2012:journals:ian:chapter6 [2012/03/28 04:11] – 6.2 sturdyi | courses:cs211:winter2012:journals:ian:chapter6 [2012/03/28 04:27] (current) – sturdyi | ||
---|---|---|---|
Line 12: | Line 12: | ||
* A note, at least, on the polynomial number of subproblems (and why the iterative setup is not always equivalent to the | * A note, at least, on the polynomial number of subproblems (and why the iterative setup is not always equivalent to the | ||
recursive): in Abstract Algebra we recently got an extra-credit problem implementing a dynamic algorithm finding the number of three-free permutations of the first n natural numbers (rather convenient timing, really). The algorithm determined, given a set of numbers yet to be placed, whether each one of them could be placed next; for each one that could, the algorithm was recursively applied to determine the number of valid solutions that placed that number next. There are really 2^n subproblems, | recursive): in Abstract Algebra we recently got an extra-credit problem implementing a dynamic algorithm finding the number of three-free permutations of the first n natural numbers (rather convenient timing, really). The algorithm determined, given a set of numbers yet to be placed, whether each one of them could be placed next; for each one that could, the algorithm was recursively applied to determine the number of valid solutions that placed that number next. There are really 2^n subproblems, | ||
- | * No complaints). | + | * No complaints. |
+ | |||
+ | ====== 6.3 Segmented Least Squares ======= | ||
+ | |||
+ | * Dynamic programming does not require binary choice. Segmented least squares attempts to determine the natural number of kinks in a set of points, minimizing the sum of deviations from the solution and a penalty for each break. One can thus make a pass through recursively determining the best way to fit a line to subsets of the point. OLS takes O(n^3) and the rest O(n^2). | ||
+ | * No questions. | ||
+ | * No comments. | ||
+ | * No complaints. | ||
+ | |||
+ | ====== 6.4 Subset Sums and Knapsacks ====== | ||
+ | |||
+ | * The knapsack problem is the selection of a subset (without replacement) of values that has sum as close as possible to a target. Here one cannot recurse merely over items, since unlike in weighted interval schedule the subproblems for a given choice are not independent of the choices already made (they affect the target). Therefore, one needs to define subproblems in two variables, the set of goods to be considered and the weight still to fill (but one can still make the choice sequentially, | ||
+ | * No questions. | ||
+ | * No insights. | ||
+ | * Again with the introduction of the false starts first? I can see their reasons, but still do not much like it. | ||
+ |