Help me talk about dynamic programming, the solution to the problem of dynamic programming

Updated on technology 2024-03-11
6 answers
  1. Anonymous users2024-02-06

    There are n items and a backpack with a volume of m. The volume of the ith article is w[i] and the value is d[i]. Solve which items to pack in your backpack to maximize the sum of your values.

    There is only one item of each type, which can be placed or left (n<=3500, m <=13000).

    Let's let v[i][j] denote the maximum value achieved for the first i items, the volume does not exceed j. So:

    However, if we open a two-dimensional array in this way, we will have to think of a more memory-saving way.

    That is, to consider: for these items, the maximum value that does not exceed j is maxv[j]. Dynamic programming requires no after-effect, and the trade-off of the first I kind of items, and the trade-off of the I kind of later items, whether there is after-effect (contrast, the rolling array of triangles).

    Magical Pocket (Bailian 2755).

    There is a magical pocket with a total volume of 40, and some items can be conjured up with this pocket, and the total volume of these items must be 40.

    John now has n (1 n 20) items he wants to get, each with a volume of A1, A2, etcSome of these items can be selected, and if the total volume of the selected object is 40, then using this magic pocket, John can get these items. The question now is, how many different ways John chooses items.

    There are two solutions to this problem, one is the traditional recursive solution, and the other is the reachable dynamic programming, which is more ingeniously designed and used as a practice problem. [tips: one-dimensional dynamic gauge].

    Let's let ways[i][j] denote the number of ways to make up the volume of i from j items before Gaodan, and the question asks us to find ways[40][n], then:

  2. Anonymous users2024-02-05

    1. Definitions. Dynamic programming is called DP and is used to solve overlapping subproblems.

    Second, the steps to solve the problem.

    1. Determine the dp array and the meaning of the subscript.

    2. Determine the state transition equation.

    3. Initialization of dp array.

    There are two possibilities for the problem, one is to require the backpack to be exactly full, and the other is to not be full (as long as it does not exceed the capacity).

    Just full. You only need to initialize dp[0] to 0, and the others to be negative.

    Can not be filled. All you need to do is initialize it all to 0.

    4. Determine the order of traversal.

    The outer layer traverses the item, and the vertical infiltration Kai or the outer layer traverses the capacity;

    and whether the capacity traverses from large to small, or from small to large.

    5. Example inspection.

    3. Summary. The most essential difference between recursive and dynamic programming is that the original problem is broken down into multiple subproblems and then solved, and the most essential difference between them is that dynamic programming preserves the solution of the subproblems and avoids double computation.

    There's a lot to do with dynamic programming, and you'll learn from the following aspects:

    Fibonacci sequence.

    Backpack (0-1 backpack, complete backpack). Shouting.

  3. Anonymous users2024-02-04

    Dynamic programming, a branch of operations research, is a mathematical method for solving the optimal decision process. In the early 50s of the 20th century, American mathematicians and others put forward the famous principle of optimality when studying the optimization problem of multi-stage decision process, transforming the multi-stage process into a series of single-stage problems, using the relationship between the stages, solving them one by one, and creating a new method to solve this kind of process optimization problem - dynamic programming. In 1957 he published his famous book, Dynamic Programming, the first book in the field.

    Dynamic programming is a way and a method to solve optimization problems, rather than a special algorithm. It does not have a standard mathematical expression and a clear and unambiguous way to solve the problem, as in the search or numerical calculations described above. Dynamic programming program design is often aimed at a kind of optimization problem, due to the different nature of various problems, the conditions for determining the optimal solution are also different from each other, so the design method of dynamic programming has its own unique solution methods for different problems, and there is no universal dynamic programming algorithm, which can solve all kinds of optimization problems.

    Therefore, in addition to a correct understanding of the basic concepts and methods, readers must analyze and deal with specific problems, build models with rich imagination, and solve them with creative skills. We can also gradually learn and master this design method by analyzing and discussing the dynamic programming algorithms for several representative problems.

  4. Anonymous users2024-02-03

    Brother, what does an encyclopedia do?

    Search it yourself, what are you wasting your life by sending questions, why did you run into my message by yourself when you say that the problem came to my message??

  5. Anonymous users2024-02-02

    Dynamic programming is a branch of operations research, which is to solve decisions

    Mathematical methods for decision process optimization. DAO dynamic programming program.

    Internal calculation is a way and a method to solve the optimization problem, rather than a special algorithm.

  6. Anonymous users2024-02-01

    I've written a piece of dynamic programming that I've experienced here, and it will definitely be helpful to understand it from a simple perspective.

    Follow Computing Advertising Ecology Reply to DP to get the most thorough explanation of dynamic planning.

Related questions
4 answers2024-03-11

I would like to point out that you should not confuse the two meanings of document management. The first level of cultural management is the abbreviation of cultural management, and I am not very optimistic about this major. The second meaning is that cultural management is all film and television arts, art and culture majors. >>>More

11 answers2024-03-11

Fortune telling? Or is it nothing.

12 answers2024-03-11

In terms of reasoning alone, I prefer Kanedaichi, which is absolutely wonderful. >>>More

13 answers2024-03-11

To apply for business, the GMAT applies to all majors, but the specific requirements of each business school are different, and some business schools may agree to the GRE instead of the GMAT, which needs to be verified by the school you want to apply to**. However, for students who are looking for business schools, taking the GMAT is the best choice. You can take one of the GMAT and GRE tests, and you don't need to take both tests. >>>More

12 answers2024-03-11

She was shy. Show that she has feelings for you. Chase.