2. (8 pts) Assume that you have a list of n home maintenance/repair tasks (numbered from...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. (8 pts) Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n) that must be done in list order on your house. You can either do each task i yourself at a positive cost (that includes your time and effort) of c[i]. Alternatively, you could hire a handyman who will do the next 4 tasks on your list for the fixed cost h (regardless of how much time and effort those 4 tasks would cost you). You are to create a dynamic programming algorithm that finds a minimum cost way of completing the tasks. The inputs to the problem are h and the array of costs c[1],..., c[n]. • (3 pts) First, find a justify a recurrence (with boundary conditions) giving the optimal cost for completing the tasks. . (1 pts) Give an O(n)-time recursive algorithm with memoization for calculating the value of the recurrence. . (1 pt) Give an O(n)-time bottom-up algorithm for filling in the array ● (2 pts) Describe how to determine which tasks to do yourself, and which tasks to hire the handy- man for in an optimal solution. 2. (8 pts) Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n) that must be done in list order on your house. You can either do each task i yourself at a positive cost (that includes your time and effort) of c[i]. Alternatively, you could hire a handyman who will do the next 4 tasks on your list for the fixed cost h (regardless of how much time and effort those 4 tasks would cost you). You are to create a dynamic programming algorithm that finds a minimum cost way of completing the tasks. The inputs to the problem are h and the array of costs c[1],..., c[n]. • (3 pts) First, find a justify a recurrence (with boundary conditions) giving the optimal cost for completing the tasks. . (1 pts) Give an O(n)-time recursive algorithm with memoization for calculating the value of the recurrence. . (1 pt) Give an O(n)-time bottom-up algorithm for filling in the array ● (2 pts) Describe how to determine which tasks to do yourself, and which tasks to hire the handy- man for in an optimal solution.
Expert Answer:
Answer rating: 100% (QA)
Ans a The recurrence relation for the given problem is Tn Tn1 Tn4 1 b The On time recursive algorith... View the full answer
Related Book For
Elementary Principles of Chemical Processes
ISBN: 978-0471720638
3rd Edition
Authors: Richard M. Felder, Ronald W. Rousseau
Posted Date:
Students also viewed these general management questions
-
Suppose you have n data points (x 1 , y 1 ) (x 2 , y 2 ), . . , (x n , y n ) and you wish to fit a line through the origin (y = ax) to these data using the method of least squares. Derive Equation...
-
Suppose you have n data points (x 1 ; y 1 ), (x 2 ; y2 ), . . . , (x n ; y n ) and you wish to fit a line through the origin (y = ax) to these data using the method of least squares. Derive Equation...
-
Suppose you have n data points (x 1 ; y 1 ), (x 2 ; y2 ), . . . , (x n ; y n ) and you wish to fit a line through the origin (y = ax) to these data using the method of least squares. Derive Equation...
-
Turtle Creek Partnership had the following revenues, expenses, gains, losses, and distributions Sales revenue Long-term capital gains Cost of goods sold Depreciation-MACRS $ 59,000 $ 3,300) $...
-
Develop a table similar to Table 20.1 for a range of latitudes from 4030' N to 4039' N in the Pennsylvania North Zone with standard parallels of 4053' N and 4157' N, and a grid origin at (4010' N,...
-
Place the following types of molecular and ion interactions in order of increasing strength: (a) Iondipole; (b) Induced-dipoleinduced-dipole; (c) Dipoledipole in the gas phase; (d) Ionion; (e)...
-
If the allowable bearing stress for the plates under the supports at A and B is ( b ) allow =1.8 MPa, determine the size of square bearing plates A and B required to support the load. Dimension the...
-
Hubble versus Arecibo the Hubble Space Telescope bas an aperture of 2.4 m and focuses visible light (400-700 nm). The Arecibo radio telescope in Puerto Rico is 305 m (1000 ft) in diameter (it is...
-
The inputs of a JK FF are Delay and Toggle flip-flops. The Q output of the D-FF is connected to the J input and the Q output of the T-FF to the K input. (i) Draw the logic diagram using AND/NOR gates...
-
1. Marketing analysts use market position maps to display visually the customers perceptions of a firm in relation to its competitors regarding two attributes. Prepare a market position map for Alamo...
-
A region bounded by the curve y=x +7,y=0, x=5 and x=0 rotated through 360 around x-axis. Sketch the diagram and calculate the volume of the region.
-
A trader collects the below information to devise his forex management strategy during the next year: Spot Rate of USD: INR 74.40 Interest rates in USA: 2.5% Interest rates in India: 6.5% What is...
-
Jaina's donations to church and other charities were $3,550. Her medical and dental expenses exceeding 12 percent of adjusted gross income were $570. Her state income tax was $980, and her...
-
Using which one (1) of the following investing strategies would be INCONSISTENT with a belief in the "Weak Form" of the "Efficient Market Hypothesis"? a. A Bottom-Up Approach b. Technical Analysis c....
-
What are the contract specification of a German Bund future traded on Eurex (Bloomberg code RX1 Comdty): Nominal value of 1 contract Value of 1 point Tick size Tick value Price Contract Value...
-
What are the key mechanisms driving speciation and extinction dynamics in the context of contemporary global biodiversity trends ?
-
Address the questions and directives within each section below in paragraph format. Include at least one paragraph for each section. Because of this, your response will be longer than the 150 word...
-
Element compound homogeneous mixture (heterogeneous mixture) 4) A piece of gold has a mass of 49.75 g. What should the volume be if it is pure gold? Gold has a density of 19.3 g/cm (3 points) D=m/v...
-
Spray drying is a process in which a liquid containing dissolved or suspended solids is injected into a chamber through a spray nozzle or centrifugal disk atomizer. The resulting mist is contacted...
-
Draw and label the given streams and derive expressions for the indicated quantities in terms of labeled variables. The solution of part (a) is given as an illustration. (b) The feed to a batch...
-
The rate at which a substance passes through a semi permeable membrane is determined by the diffusivity D(cm 2 /s) of the gas. D varies with the membrane temperature T(K) according to the Arrhenius...
-
When randomly selecting a day of the week, it is certain that you will select a day containing the letter y, so P(y) = 1. For Exercises 510, decide whether the statement makes sense (or is clearly...
-
Use subjective judgment to estimate the probability that the next time you ride an elevator, it gets stuck between floors.
-
Because it is impossible for Thanksgiving to fall on Tuesday, the probability of Thanksgiving falling on Tuesday is 0. For Exercises 510, decide whether the statement makes sense (or is clearly true)...
Study smarter with the SolutionInn App