Question: Dynamic Programming 2. (8 pts) Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n) that must be done

Dynamic ProgrammingDynamic Programming 2. (8 pts) Assume that you have a list of

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 cli]. 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 cli]. 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!