subject

Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n ) that must be done in numeric 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 for the fixed cost h (regardless of how much time and effort those 4 tasks would cost you). The handyman always does 4 tasks and cannot be used if fewer than four tasks remain. 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] . a) Find and justify a recurrence (without boundary conditions) giving the optimal cost for completing the tasks. Use M(j) for the minimum cost required to do the first j tasks.

b) Give an O(n) -time recursive algorithm with memoization for calculating the M(j) values.

c) Give an O(n) -time bottom-up algorithm for filling in the array.

d) Describe how to determine which tasks to do yourself, and which tasks to hire the handyman for in an optimal solution.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
Which feature of a blog to restore and retrieve older post
Answers: 3
You know the right answer?
Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n ) that must be...
Questions
question
Mathematics, 29.10.2020 17:20
question
Mathematics, 29.10.2020 17:30
question
Physics, 29.10.2020 17:30
Questions on the website: 13722359