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

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) =” src=”https://files.transtutors.com/cdn/qimg/f96cb815d8cd4b918057ba0f32f25e3f.jpg” aria-describedby=”iqf”>

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) =



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *