Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2.2 ExPLORE Consider the Job Selection problem from lecture. You will modify the solution to this problem to work for a related problem. In lecture
2.2 ExPLORE Consider the Job Selection problem from lecture. You will modify the solution to this problem to work for a related problem. In lecture we had the rule that if you work one day you can't work the next (or previous). In the modified problem you are allowed to work two days in a row but not three days in a row (so if you work 2 days in a row you can't work the day before these 2 days or the day after) 1. (2 point) Express the modified problem formally with input and output conditions. 2. (4 points) State a self-reduction for your problem. Use the self-reduction from lecture as inspiration. (4 points) State a dynamic programming algorithm based off of your self reduction that computes the maximum earnings. 4. (4 points) Design a function that recovers the days that must be worked to achieve the maximum earnings 5. (2 point) Compute the maximum earnings and the days to work for this input (same as above P 15,9, 12,7,5,13,7,5,4,9,8,7,5,8,4,3,5,10,4,6,8,12,5,6,3,7,16,2,2, 16] 2.2 ExPLORE Consider the Job Selection problem from lecture. You will modify the solution to this problem to work for a related problem. In lecture we had the rule that if you work one day you can't work the next (or previous). In the modified problem you are allowed to work two days in a row but not three days in a row (so if you work 2 days in a row you can't work the day before these 2 days or the day after) 1. (2 point) Express the modified problem formally with input and output conditions. 2. (4 points) State a self-reduction for your problem. Use the self-reduction from lecture as inspiration. (4 points) State a dynamic programming algorithm based off of your self reduction that computes the maximum earnings. 4. (4 points) Design a function that recovers the days that must be worked to achieve the maximum earnings 5. (2 point) Compute the maximum earnings and the days to work for this input (same as above P 15,9, 12,7,5,13,7,5,4,9,8,7,5,8,4,3,5,10,4,6,8,12,5,6,3,7,16,2,2, 16]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started