Question

ALGORITHM

Given the following Knapsack problem instance and its DP solution: 1 2 3 4 5 weight value To 10 10 10 10 item1 1 10 item2 | 2

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

a) Maximum profit is 36 and it is generated only by the 5th row at index (4,5). Therefore, it is this cell that lets me pick item 4.

Remaining profit is 36-value of item4 = 36-15 = 21.

b) Maximum profit now has become 21 and it is generated only by the 4th row at index (3,2) at the earliest, therefore, it is this cell that lets me pick item 3.

Remaining profit would be 21-value of item3 = 21-11 = 10.

c) Maximum profit now has become 10 and is generated by both third and second row, but in the first row the earliest at index (1,1) and no row above this row contains 10, therefore, it is this cell that lets me pick item 1.

Remaining profit = 10-10 = 0.

Hope the above solution solves your doubt. Thank you:)

Add a comment
Know the answer?
Add Answer to:
ALGORITHM Given the following Knapsack problem instance and its DP solution: 1 2 3 4 5...
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
  • This is the sequence 1,3,6,10,15 the pattern is addin 1 more than last time but what is the name for this pattern These are called the triangular numbers The sequence is 1 3=1+2 6=1+2+3 10=1+2+3+4 15=1+2+3+4+5 You can also observe this pattern

    This is the sequence 1,3,6,10,15 the pattern is addin 1 more than last time but what is the name for this patternThese are called the triangular numbers The sequence is 1 3=1+2 6=1+2+3 10=1+2+3+4 15=1+2+3+4+5 You can also observe this pattern x _________ x xx __________ x xx xxx __________ x xx xxx xxxx to see why they're called triangular numbers. I think the Pythagoreans (around 700 B.C.E.) were the ones who gave them this name. I do know the...

  • Problem 3. (15 points) Given the following data: 3, 2, 3, 4, 5, 3, 4, 6,...

    Problem 3. (15 points) Given the following data: 3, 2, 3, 4, 5, 3, 4, 6, 4, 10, 7, 11 () (2 points) Calculate the sample mean by hand using its definition. Round your in results to two decimal places and your final answer to one decimal place. Same for the remai questions. (2) (2 points) Calculate the median of the data. (3) (3 points) Calculate the sample variance by hand using its definition. 4) (3 poi ning ints) Calculate...

  • Probs. 3-4-5 refer to the following problem and its complete solution Max . Z 4x1 + 6x2 + 3x3 + x+ ?2x1 + 2x2...

    Probs. 3-4-5 refer to the following problem and its complete solution Max . Z 4x1 + 6x2 + 3x3 + x+ ?2x1 + 2x2 + 4x3 + 3x+ 550 (x5) 2x1 + 3x2 + x3 + 2x‘ S 20O (x7) R.S 4-6 -31 /4 3 1 550 700 200 0 o1 3 o 2 Z O 400 2/11 1/12/10 o 1/11 662 / ง 9 525 2 /20 425 2/ 25 1/2-1/10 13/20 1 0 。 3a. Read off the...

  • "1",4.69816621546105 "2",4.44756510829146 "3",6.84100846766469 "4",7.01358258791867 "5",3.12935822296976 "6",5.14762683649335 "7",2.54905695207...

    "1",4.69816621546105 "2",4.44756510829146 "3",6.84100846766469 "4",7.01358258791867 "5",3.12935822296976 "6",5.14762683649335 "7",2.54905695207479 "8",4.06103182893184 "9",2.48237691955398 "10", 6.2004516591676 "11", 3.01735627817734 "12", 3.54398983209343 "13",5.02652010457958 "14", 5.94118091122925 "15", 7.01208796523191 "16",1.78016831028813 "17",4.33834121978255 "18", 8.93218857046722 "19", 8.43778411332812 "20",8.85822711493131 "21",4.75013154193281 "22", 9.31373767405901 "23",4.09575976019349 "24",2.74688111585186 "25", 3.8040095716617 26",9.34905953037803 "27", 5.87804953966622 "28",7.30637945593767 "29",7.14701470885807 "30",4.48962722844458 "31", 5.04849646123746 "32", 3.97515036133807 "33", 5.32546715405807 "34",8.17769559423788 "35", 6.42260496868865 "36",7.81161965525343 "37",9.8499408616349 "38",9.93608614628273 "39",8.04555405523207 "40",4.14121187997945 "41",5.19842955121368 "42",6.43976800531653 "43", 5.06797870826443 "44",3.79022295456759 "45",8.64229620362652 "46",10.7203765104341 "47",5.45008418851375 "48",4.96026223624637 "49",3.35515355305645 "50",4.3593298786236 Problem 2: Load in the file "data.csv". Assume that this is a random sample from...

  • Python 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 abscissa = np.arange(20) 5 plt....

    python 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 abscissa = np.arange(20) 5 plt.gca().set_prop_cycle( ’ color ’ , [ ’ red ’ , ’ green ’ , ’ blue ’ , ’ black ’ ]) 6 7 class MyLine: 8 9 def __init__(self, * args, ** options): 10 #TO DO: IMPLEMENT FUNCTION 11 pass 12 13 def draw(self): 14 plt.plot(abscissa,self.line(abscissa)) 15 16 def get_line(self): 17 return "y = {0:.2f}x + {1:.2f}".format(self.slope, self.intercept) 18 19 def __str__(self):...

  • Year 3 Quarter 1 2 70.000 80.000 Data Year 2 Quarter 4 1 2 3 5...

    Year 3 Quarter 1 2 70.000 80.000 Data Year 2 Quarter 4 1 2 3 5 Budgeted unit sales 40,000 60.000 100,000 50,000 6 7 • Selling price per unit $8 8 • Accounts receivable, beginning balance $65,000 9 • Sales collected in the quarter sales are made 75% 10 • Sales collected in the quarter after sales are made 25% 11 • Desired ending finished goods inventory is 30% of the budgeted unt sales of the next quarter 12...

  • AutoSave OFF BESU: 2 M4 expected values company updated Home Insert Draw Page Layout Formulas Data...

    AutoSave OFF BESU: 2 M4 expected values company updated Home Insert Draw Page Layout Formulas Data Review View Tell me Share O Comments Insert v v X La Calibri (Body) = = 12 . Å ab Wrap Text General Do 國留通 WE 49" . Ou 8 Delete v Paste BI U A Merge & Center $ % ) .00 00 20 Conditional Format Formatting as Table Cell Styles Ideas Sort & Filter Format Find & Select Sensitivity Yes No Open...

  • 3 Problem 1143 (#1 and 2 only) Flexible Budgeting: Variances; Impact on Behavior 4 DATA INPUT...

    3 Problem 1143 (#1 and 2 only) Flexible Budgeting: Variances; Impact on Behavior 4 DATA INPUT Lawnmate Company Operating Results For the Month of May 6 8 9 10 Units sold Actual Master Budget 5,000 Variance 4,800 200 U $ 1,200,000 760,000 S 440,000 180,000 120,000 S 140,000 $ 1,152,000 780,000 S 372,000 180,000 115,000 S 77,000 $ 48,000 U 20,000) U $ 68,000 U 12 Revenue 13 Variable cost 14 Contribution margin 15 Fixed overhead 16 Fixed general and...

  • Problem 1 (Short Answer) Answer the following questions in 2-4 sentences: a) Describe how uncertainty plays...

    Problem 1 (Short Answer) Answer the following questions in 2-4 sentences: a) Describe how uncertainty plays a role in engineering measurements and experiments b) Explain what the variance of a dataset or random variable represents. c) Explain why normal distributions and normal random variables are used very commonly in engineering practice Describe what is meant by the rejection region of an alternative hypothesis, and sketch the rejection regions for the right-sided, left-sided, and two-sided alternatives d) Problem 2 (Health Data...

  • Student #2 C- 72% 144 34 0 40 70 Student #3 74% C 148 40 10 43 55 Student # 4 50 36 A 93% 186 10 90 Student #5 B+ 87% 1...

    Student #2 C- 72% 144 34 0 40 70 Student #3 74% C 148 40 10 43 55 Student # 4 50 36 A 93% 186 10 90 Student #5 B+ 87% 174 48 10 46 70 Student #6 56% 112 44 5 28 35 Student #7 65 84% 168 50 10 43 Student #8 48 B- 80% 159 46 10 55 Student #9 C+ 79% 158 50 10 73 25 Student #10 86% 172 33 5 44 90 Student...

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