Question

Modify the item weights to be [2, 1, 2, 3, 5] and keep the item values the same [25, 20, 15, 40, 50].

How many different optimal subsets does the instance of part (a) have?

item weight value $25 $20 $15 $40 $50 capacity W-6 4 4

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer is as follows :

As per given scenario we get the following table :

Item Weight Value
1 2 $25
2 1 $20
3 2 $15
4 3 $40
5 5 $50

And we have maximum capacity of wight W = 6.

So we get following optimal subsets that can set for maximum weight capacity. with items

1) {1} with Total weight 2 i.e. less than 6

2) {2} with Total weight 1 i.e. less than 6

3) {3} with Total weight 2 i.e. less than 6

4) {4} with Total weight 3 i.e. less than 6

5) {5} with Total weight 5 i.e. less than 6

6) {1,2} with Total weight 2+1 = 3 i.e. less than 6

7) {1,3} with Total weight 2+2 = 4 i.e. less than 6

8) {1,4} with Total weight 2+3 = 5 i.e. less than 6

9) {1,2,3} with Total weight 2+1+2 = 5 i.e. less than 6

10) {2,3} with Total weight 1+2 = 3 i.e. less than 6

11) {2,4} with Total weight 1+3 = 4 i.e. less than 6

12) {3,4} with Total weight 2+3 = 5 i.e. less than 6

13) {2,3,4} with Total weight 2+1+3 = 6 i.e. equal to 6

14) {2,5} with Total weight 1+5 = 6 i.e. equal to 6

So we get approximate 14 optimal subsets of given table where capacity W is 6. other calculations gave result more than 6.

if you can get more than you can do.

if there is any query please ask in comments...

Add a comment
Know the answer?
Add Answer to:
Modify the item weights to be [2, 1, 2, 3, 5] and keep the item values the same [25, 20, 15, 40, ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • a) Implement the bottom-up dynamic programming algorithm for the knapsack problem in python. The program should...

    a) Implement the bottom-up dynamic programming algorithm for the knapsack problem in python. The program should read inputs from a file called “data.txt”, and the output will be written to screen, indicating the optimal subset(s). b) For the bottom-up dynamic programming algorithm, prove that its time efficiency is in Θ(nW), its space efficiency is in Θ(nW) and the time needed to find the composition of an optimal subset from a filled dynamic programming table is in O(n). Consider the following...

  • You want to put your valuable items into a box. The maximum capacity of the box is 4. The table below shows the values and weights for items 1, 2, 3 and 4 respectively. Item i Value Vi Weight...

    You want to put your valuable items into a box. The maximum capacity of the box is 4. The table below shows the values and weights for items 1, 2, 3 and 4 respectively. Item i Value Vi Weight Wi 1 15 1 2 10 5 3 9 3 4 5 2         (i) Use recursion strategy to put the items into the box such that it holds the highest value         (ii) Repeat (i) above using backtracking approach.

  • Question 1. There are 6 gifts with weights 5, 3, 2, 1, 6 and 4; and...

    Question 1. There are 6 gifts with weights 5, 3, 2, 1, 6 and 4; and values 8, 2, 5, 13, 16, and 1 respectively. Use dynamic programming to find the most valuable subset of gifts subject to the constraint the total weight cannot exceed 10. Show the entire table for bottom-up computation, together with the keep array. (20)

  • (2) Suppose, the game is updated so that every item, i, now has weight, wi], in kilograms (you ca...

    Please help with question 2 (c). (2) Suppose, the game is updated so that every item, i, now has weight, wi], in kilograms (you can assume you are passed the item weights in an array, w, of size m). You can only carry n kilograms of weight. (a) (1 point) Example: Let n Ξ 15, m 5. If the item values are v (5.30, 17, 32, 40) and the item weights are w - 2,4, 3,6,15} which should you choose...

  • 1. Apply the dynamic programming algorithm discussed in class to solve the knapsack problem. (10 points)...

    1. Apply the dynamic programming algorithm discussed in class to solve the knapsack problem. (10 points) a. Show the completed table. b. Which items are included in the final configuration of the knapsack? c. What is the maximum value that can fit in the knapsack using a configuration of these items? item 1 2. 3 4 weight 3 2 value $25 $20 $15 1 capacity W = 6. 4 5 $40 $50 5

  • please I would like assistance with this which are question 1 and 2, thank you 2....

    please I would like assistance with this which are question 1 and 2, thank you 2. We have 5 objects, and the weights and values are No. 2 3 4 5 10 20 30 50 V 20 30 66 60 55 W 40 The knapsack can carry a weight not exceeding 90, find a subset items and give the total weight and value for following algorithms: 1) By using the algorithm of greedy of value for 0-1 knapsack problem? By...

  • Problem 3 You are given the following data: 510 15 20 25 30 35 40 45 50 Y 17 24 31 33 37 37 40 40 42 41 a. Use line...

    Problem 3 You are given the following data: 510 15 20 25 30 35 40 45 50 Y 17 24 31 33 37 37 40 40 42 41 a. Use linear regression to fit a straight line, a parabola, and a cubic function to the data b. Plot the data and the different curves on the same plot c. What are the errors associated with the derived parameters for the different curves? d. Which curve best aligns with the given...

  • Wind Chill 50 45 40 35 30 Wind Speed (km/h) 25 20 15 10 5 0...

    Wind Chill 50 45 40 35 30 Wind Speed (km/h) 25 20 15 10 5 0 in -10 -15 -20 35 40 -45 -50 Air Temperature (°C) Task: The wind chill index measures the sensation of cold on the human skin. In October 2001, Environment Canada introduced the wind chill index above. Each curve represents the combination of air temperature and wind speed that would produce the given wind chill value. For example, a temperature of -25°C and wind speed...

  • P (S) 50 45 40 35 30 25 20 15 o 20 30 40 50 60...

    P (S) 50 45 40 35 30 25 20 15 o 20 30 40 50 60 70 80 90 100 110 120 130 140 150 -5 -10 Suppose that there are 5 people with identical preferences around a pure public good. For each individual (i e {1, 2, 3, 4, 5]) the Private Marginal Benefit (PMB,) from a pure public good is given by PMB, 10-0.1G, where G is the quantity of the pure public good. 1. Draw the Private...

  • P (S) 50 45 40 35 25 20 15 10 o 20 30 40 50 60...

    P (S) 50 45 40 35 25 20 15 10 o 20 30 40 50 60 70 80 90 100 110 120 130 140 15o -5 -10 Suppose that there are 5 people with identical preferences around a pure public good. For each individual (i e (1,2,3, 4, 5)) the Private Marginal Benefit (PMB.) from a pure public good is given by PMB, 10-0.1G, where G is the quantity of the pure public good. 1. Draw the Private Marginal Benefit...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT