Question

Given items as {value,weight} pairs {{40,20},{30,10},{20,5}}. The capacity of knapsack=25. Find the maximum value output assuming...

Given items as {value,weight} pairs {{40,20},{30,10},{20,5}}. The capacity of knapsack=25. Find the maximum value output assuming items to be divisible

a.

60

b.

100

c.

80

d.

70

Homework Answers

Answer #1

Solution:

Here given {value,weight} pairs {{40,20},{30,10},{20,5}} and knapsack size is 25.

P1 P2 P3
value 40 30 20
weight 20 10 5
value/weight 2 3 4

Now sort the value/weight values in ascending order and fill the bag with each pair weight one by one.

So after arranging value/weights in ascending order it looks like P3,P2,P1.

Now Bag Size = 25

Contents in Bag Remaining Bag Size Profit Total Profit
P3 = 5 25-5=20 20 20
P2 = 10 20-10 = 10 30 50
P3=10 10-10=0 10*2=20 70

After filling 10 from p3 bag size becomes zero so the total profit was 20+30+20=70.

So option D is correct i.e 70. Here weights are divisible.

Note: If you have any queries please post a comment before giving any review thanks a lot..always available to help you..

Know the answer?
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
Similar Questions
You are given a knapsack that can carry a maximum weight of 60. There are 4...
You are given a knapsack that can carry a maximum weight of 60. There are 4 items with weights {20, 30, 40, and 70} and values {70, 80, 90, and 200}. Apply the brute force algorithm to find the maximum value of the items you can carry using the knapsack?
the table is for 0-1 knapsack problem given for the following items, each labeled with weight...
the table is for 0-1 knapsack problem given for the following items, each labeled with weight and value. Assume the total weight limit W is 8 lbs. Item 1 2 3 4 Value ($) 8 40 30 54 Weight (lb) 1 2 3 6 Solve the fractional knapsack problem using the input?
KNAPSACK Optimization Problem using Greedy Method Problem 1: Item Weight Value 1    14 20 2...
KNAPSACK Optimization Problem using Greedy Method Problem 1: Item Weight Value 1    14 20 2     6 16 3   10 8 4     5 10 5   4 12 Allowed weight = 24 Kg Problem 2: Item Weight Value 1 6 30 2 8 40 3 15 45 4 22 88 5 25 80 Allowed weight = 60 Kg Problem 3: Item Weight Value 1     6 30 2     8 40 3    15 45 4    22 88...
Given the following information. Maximum capacity (labor hours): 350 hours per week Effective capacity ratio: 70%...
Given the following information. Maximum capacity (labor hours): 350 hours per week Effective capacity ratio: 70% Actual time worked: 243 hours per week over the last two weeks On-time delivery %: 60 percent of the jobs are being completed on time a. Calculate the effective capacity and actual utilization. (Round your answers to 2 decimal places.) b. Do we need to add more capacity? Yes No
Assuming that a user enters 64 as his marks obtained, what is the output of the...
Assuming that a user enters 64 as his marks obtained, what is the output of the following code snippet? int main() { int score = 0; cout << "Enter your score: "; cin >> score; if (score < 40) { cout << "F" << endl; } else if (score < 50) { cout << "D" << endl; } else if (score < 60) { cout << "C" << endl; } else if (score < 70) { cout << "B" <<...
2. Find the maximum of the following profit function by finding out (a) the output ?∗value...
2. Find the maximum of the following profit function by finding out (a) the output ?∗value where the first order condition is satisfied; and (b) the maximum profit. ?(?)=−?^3/3−5?2+2000?−326.
2. Find the maximum of the following profit function by finding out (a) the output ?∗value...
2. Find the maximum of the following profit function by finding out (a) the output ?∗value where the first order condition is satisfied; and (b) the maximum profit. ?(?)=−?^3/3−5?2+2000?−326. (please explain in full)
The age x of a pony (in months) and the weight y (in kg) is given...
The age x of a pony (in months) and the weight y (in kg) is given in the following pairs (x,y): (3,60), (6,95), (12,140), (18,170), (24,185) (that is, at 3 months it weighed 60 kg, at 6 months it weighed 95 kg, etc.) a) Find the value of r for this data. b) Is there strong, moderate or weak correlation? Is this positive or negative? c) Find the least squares line and use it to predict the weight of the...
Find the absolute maximum value of f(x)= x4−2x a) 0 b) −1.1906 c) No absolute maximum...
Find the absolute maximum value of f(x)= x4−2x a) 0 b) −1.1906 c) No absolute maximum d) 0.7937 e) None of the above A farmer has 420 feet of fencing to enclose 2 adjacent rectangular pig pens sharing a common side. What dimensions should be used for each pig pen so that the enclosed area will be a maximum? The two adjacent pens have the same dimensions. a) 220 ft  ×  15  ft b) 120 ft  ×  27.50  ft c)...
1. Compute the risk weighted assets given the following data. Asset Book value Weight Residual mortgage...
1. Compute the risk weighted assets given the following data. Asset Book value Weight Residual mortgage loans 100 million 50% Treasury bills 100 million 0% Municipal G. O. bonds 100 million 20% Total 300 million A. 50 B. 70 C. 90 D. 100 2. A bank’s reserves are computed as: A. Deposits with the Fed minus vault cash. B. Deposits with the fed plus vault cash.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT