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 14:30
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
question
Computers and Technology, 24.06.2019 02:30
Write the pseudo code for this problem based on what you learned from the video. the purpose is to design a modular program that asks the user to enter a distance in kilometers, and then converts that distance to miles. the conversion formula is as follows: miles = kilometers x 0.6214
Answers: 3
question
Computers and Technology, 24.06.2019 03:00
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Why is hard disk space important to an audio engineer? why are usb ports and firewire ports useful for an audio engineer? explain in 2-3 sentences. (3.0 points) here's a list of different audio software: ableton live apple inc.'s garageband apple inc.'s logic studio digidesign's pro tools propellerhead sofware's reason sony creative software's acid pro steinberg cubase steinberg nuendo choose one of the software programs listed above, and then go to that software program's web site. read about what the software program is used for, and then write 4-5 sentences about what you learned. (10.0 points) which type of software license is the most limiting? why? explain in 2-3 sentences. (3.0 points) when sending a midi channel voice message, how can you control the volume of the sound? explain in 2-3 sentences. (4.0 points)
Answers: 1
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
Computers and Technology, 27.08.2019 04:50
question
Mathematics, 27.08.2019 04:50