Question: there are n hotels, at mile posts a 1 < a 2 < a 3 < ... < a n , where each ai is

there are n hotels, at mile posts a1 < a2 < a3 < ... < an, where each ai is measured from the starting point. The only places you are allowed to stop at are these hotels, but you can choose which of the hotels you can stop at. You must stop at the final hotel (at distance an) which is your destination. Youd ideally like to travel 200 miles a day, but this may not be possible (depending on the spacing of the hotels). If you travel x miles a day, the penalty for the travel is (200 x) 2 . You want to plan your trip so as to minimize the total penalty - that is the sum, over all travel days, of the daily penalties. Give an efficient dynamic programming algorithm for the above problem. Be sure to state the base case, recurrence and pseudocode and explanation of the correctness. (Dasgupta Dynamic Programming Exercises)

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!