Question: 3. (20 points) Dynamic Programming You own a waterpark and are deciding what days to open for the summer. Some days the park does well

 3. (20 points) Dynamic Programming You own a waterpark and are

3. (20 points) Dynamic Programming You own a waterpark and are deciding what days to open for the summer. Some days the park does well and you make money and other days there are not enough visitors and you lose money. Based on data from previous years you have come up with a guess for the amount of money you will make every day from the earliest possible opening day until the last possible closing day for a total of n days. Some days are positive earnings and some are negative earnings. You want to pick and opening day and a closing day that maximizes your summer earnings. Here is a short sample input. P-I-3,6,-4,10,-5,4,-3 (2 points)If we open on the first day and close on the last day then we will earn a total of 5. What opening day and closing day should we select instead so that we maximize the earnings over these days? a) b) (2 points) If we have n days how many different starting and ending days do we have assuming the start day must always be earlier or equal to the end day

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!