# Dynamic programming

###### Question:

(a) Give a dynamicprogramming solution to the 0-1 knapsack problem that runs in O(nW)time, where n is the number of items and W is the maximum weight ofitems thatthe thief can put in the knapsack.
(b) Apply your algorithm to the problem when n = 4, W = 10, thevalue of items are v1 = 20, v2 = 60, v3 = 80, v4 = 100, and theweight items are w1 = 2, w2 = 4, w3 =5, w4 = 7.

#### Similar Solved Questions

##### 8. A health record has been subpoenaed and a court order accompanies it. The physician has...
8. A health record has been subpoenaed and a court order accompanies it. The physician has removed important parts of the record. You know that this information is missing. The office sends you to court as the keeper of the record. You must testify about the completeness of the record. What are you ...
##### A. It is 2016, you've just graduated college, and you are contemplating your lifetime budget. You...
a. It is 2016, you've just graduated college, and you are contemplating your lifetime budget. You think your general pre-retirement living expenses will average around $50,000 a year. For the next 8 years, you will rent an apartment for$16,000 a year (assume end-of-period payments). At the end ...
##### The following table gives the joint probability distribution between employment status and college graduation among those...
The following table gives the joint probability distribution between employment status and college graduation among those either employed or looking for work (unemployed) in the working age U.S. population Unemployed (Y-0) 0.0426 0.0103 0.0529 Employed Non-college grads (X- 0) College grads (X= 1) T...
##### 6. The level of lead in the blood was determined for a sample of 152 male and 86 female hazardous- waste workers resulting in mean t standard error of 5.5 t 0.3 for the men and 3.8 ± 0.2 for the...
6. The level of lead in the blood was determined for a sample of 152 male and 86 female hazardous- waste workers resulting in mean t standard error of 5.5 t 0.3 for the men and 3.8 ± 0.2 for the women. (a) Provide a 92% CI on the difference between the true average blood levels for male and ...
##### Express f in terms of unit step functions. fo) 1- 3 t-(t-1)2(t-1)-T(t-4) O t2(t-4) O t-1+...
Express f in terms of unit step functions. fo) 1- 3 t-(t-1)2(t-1)-T(t-4) O t2(t-4) O t-1+ (t-4) O ti(t-1) _ (t-1)- (t-4) Find f(t) and Xset f(t). (Enter your answer in terms of s.) Xiet f(t))...
##### Dr. Burke, a urologist, performs a destruction of a penile lesion of a patient. Are all...
Dr. Burke, a urologist, performs a destruction of a penile lesion of a patient. Are all destruction codes the same? if not, state what the differences are based on....
##### Distributions Worksheet At the organizational meeting of AID, Inc., Ashley, Ian, and Dallas, acting in their...
Distributions Worksheet At the organizational meeting of AID, Inc., Ashley, Ian, and Dallas, acting in their capacity as the Board of Directors, approved the issuance of 1,000 shares of $1 par common stock to each of them at a price of$5 per share (for a total issuance of 3,000 shares). Each of the...
##### [0/2 Points) DETAILS PREVIOUS ANSWERS LARCOLALG10 1.3.055. MY NOTES ASK YOUR TEACHER PRACTICE ANOTHER A nursery...
[0/2 Points) DETAILS PREVIOUS ANSWERS LARCOLALG10 1.3.055. MY NOTES ASK YOUR TEACHER PRACTICE ANOTHER A nursery has 560,000 of inventory in dogwood trees and red maple trees. The profit on a dogwood tree and the profit on a red maple trees 1. The profit for the entire stock 201. How much invested in...
##### Weygandt, Accounting Principles, 12e Question S ZUMBRUNN COMPANY Income Statement For the Year Ended December 31,...
Weygandt, Accounting Principles, 12e Question S ZUMBRUNN COMPANY Income Statement For the Year Ended December 31, 2017 Service revenue Operating expenses, excluding depreciation Depreciation expense Loss on disposal of equipment Income before income taxes Income tax expense Net income 54,500 26,000 ...
##### Question 28 (4 points) A plant operates on Just-in-Time/lean principles. The total production requirements for next...
Question 28 (4 points) A plant operates on Just-in-Time/lean principles. The total production requirements for next three days are 3000 units of X, 300 units of Y, and 1200 units of Z. Assume that the plant has enough capacity to produce all of the units within the three-day period. Which one of the...
##### Please do a-e if possible, you may use matlab too. 1. (20 points) Design an FIR...
Please do a-e if possible, you may use matlab too. 1. (20 points) Design an FIR bandstop filter with low cutoff frequency fi = 3565 Hz high cutoff frequency fn = 7325 Hz sampling rate fsampling = 22000 Hz length N=17 Blackman window. (a) Find the unscaled impulse response hBs(k) of the filter for 0...
##### /3 y13 6. Suppose that a firm has a production function given by: q-Ks a) Derive...
/3 y13 6. Suppose that a firm has a production function given by: q-Ks a) Derive the conditional factor demands. b) Derive the cost function. c) Derive the supply function. d) Derive the input demand functions....
##### Will rate lifesaver the right answer.. thank you
QuestionDetails:A narrow U-shaped glass tube withopen ends is filled with 25.0 of oil (of specific gravity 0.800) and25.0 of water on opposite sides, with abarrierseparating the liquids.What would the heights be if theoil's density were much less than that of water?So far, I know that water...
##### Provide mechanism type ne sono Et3N (cat) sto se H20 Ph Ph1
Provide mechanism type ne sono Et3N (cat) sto se H20 Ph Ph1...
##### Vino Veritas Company, a U.S.-based importer of wines and spirits, placed an order with a French...
Vino Veritas Company, a U.S.-based importer of wines and spirits, placed an order with a French supplier for 2,200 cases of wine at a price of 260 euros per case. The total purchase price is 572,000 euros. Relevant exchange rates for the euro are as follows: Date Spot Rate Forward Rate to October...