Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1: https://www.chegg.com/homework-help/questions-and-answers/6-dynamic-programming-suppose-array-w-m-positive-integers-integers-represent-weights-vario-q32456102 7. Dynamic Programming II (1) Now suppose we want to answer the question of whether we can have a weight of exactly

Part 1: https://www.chegg.com/homework-help/questions-and-answers/6-dynamic-programming-suppose-array-w-m-positive-integers-integers-represent-weights-vario-q32456102

image text in transcribed

7. Dynamic Programming II (1) Now suppose we want to answer the question of whether we can have a weight of exactly n using exactly k weights. (a) For the objects and weights given on the previous page, can you choose k- 3 objects whose total weight is exactly 85 (if so, list the 3 objects you would choose)? (b) For the objects and weights given on the previous page, can you choose k-4 objects whose total weight is exactly 85 (if so, list the 4 objects you would choose)? (c) Let V(m, n,k) denote your true/false value for any given n, m, k and w. Give a recursive definition of V (i) Base case (Hint: your base cases will occur when n = 0, m = 0, or k = 0) V(m,0,0) V(0, n, k)- (wheren >0 or k > 0) (ii) Recursive case (Hint: consider whether the problem is solvable by taking or not taking the rnth object. If either of the two cases works you have found a solution V(m, n, k) = 7. Dynamic Programming II (1) Now suppose we want to answer the question of whether we can have a weight of exactly n using exactly k weights. (a) For the objects and weights given on the previous page, can you choose k- 3 objects whose total weight is exactly 85 (if so, list the 3 objects you would choose)? (b) For the objects and weights given on the previous page, can you choose k-4 objects whose total weight is exactly 85 (if so, list the 4 objects you would choose)? (c) Let V(m, n,k) denote your true/false value for any given n, m, k and w. Give a recursive definition of V (i) Base case (Hint: your base cases will occur when n = 0, m = 0, or k = 0) V(m,0,0) V(0, n, k)- (wheren >0 or k > 0) (ii) Recursive case (Hint: consider whether the problem is solvable by taking or not taking the rnth object. If either of the two cases works you have found a solution V(m, n, k) =

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago