Question: You are a humble process scheduler on an algorithm student's laptop, and it's your job to handle what problems the CPU is crunching on at

You are a humble process scheduler on an algorithm student's laptop, and it's your job to handle what problems the CPU is crunching on at any given time. Unfortunately, your user likes to kick off multiple big problems at once, and then keep browsing the web while they run, so vou have to figure out how to not only change with varving processing conditions, but also how to 2 optimally switch back and forth between the different problems so that they all finish as soon as possible. Today, luckily, you only have two problems to deal with. Given the two problems P and Q, you know that, at any given cycle i (i ranges from 1 to n), the CPU can do pi work on problem P or qi work on problem Q. Additionally, switching problems takes 100 consecutive cycles. Formally, you're given pi...Pn and q1 ...qn as input.(Note that these numbers should be non- negative.) A plan is an assignment of "work on P", "work on Q" or "switch jobs" to each of the n cycles. You goal is to design a dynamic programming algorithm that creates a plan such that you maximize eTpPi + jETQqj respectively. where 1p and 1o are the cycles spent workng on P and Q (a) What are the subproblems that your algorithm will iteratively solve? (b) Give a recursive formula for these subproblems in terms of pi's, qi's and other subproblem solutions. Justify these briefly, and explicitly include your base cases. (c) Briefly describe your algorithm for designing the plan. Use psuedocode if necessary. (d) Give a brief analysis of your algorithm's time and space complexity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
