Question: please use dynamic programming to solve this, and why greedy is not better dynamic Assume that you have a list of n home maintenance/repair tasks
please use dynamic programming to solve this, and why greedy is not better dynamic

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 ci]. 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]In . First, find a justify a recurrence (with boundary conditions) giving the optimal cost for completing the tasks. Give an (n)-time recursive algorithm with memoization for calculating the value of the Give an O(n)-time bottom-up algorithm for filling in the array for in an optimal solution. recurrence . Describe how to determine which tasks to do yourself, and which tasks to hire the handyman 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 ci]. 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]In . First, find a justify a recurrence (with boundary conditions) giving the optimal cost for completing the tasks. Give an (n)-time recursive algorithm with memoization for calculating the value of the Give an O(n)-time bottom-up algorithm for filling in the array for in an optimal solution. recurrence . Describe how to determine which tasks to do yourself, and which tasks to hire the handyman
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
