Question 5 You want to move from your house You want to fit
Question 5: You want to move from your house. You want to fit all your stuff in the trunk of your car. You have three bags with weight w1 = 2lbs, w2 = 5lbs and w3 = 10lbs. The cost of the content of each bag is v1 = $20, v2 = $30 and v3 = $50. You can fit only W = 9 lbs in your trunk but you want to maximize the value. a. What is the name of this kind of problems? b. Solve this problem
Solution
a.it is called Knapsack problem.
b. solution
as problem is very easy...it directly state that w3=10ls has value $50.....per weight it has more
value....a1=20/21, a2=30/51 a3=50/10......a3 is more valuable.......so we keep 9 lbs of w3..which cost 9*5=45
