question archive 1) Suppose it is near the end of the semester and you are taking n courses, each with a ?nal project that still has to be done
Subject:Computer SciencePrice: Bought3
1) Suppose it is near the end of the semester and you are taking n courses, each with a ?nal project that still has to be done. Each project will be graded on the following scale: it will receive an integer score on a scale of 0 to 100, higher numbers being better grades. Your goal is to maximize your average grade on the 71. projects. You have a total of H hours in which to work on the 71. projects cumulatively, and you want to decide how to divide up this time. For simplicity1 assume H > 0 is an integer, and you will spend an integer number of hours on each project. To ?gure out how best to divide up your time, you have come up with a set of functions (fg £121 for each of your an. courses; if you spend h g H hours on the project for course ’5, you will get a grade of fz(h). (You may assume that each function f; are nondecreasing: if h < h’, then fz‘(h) g fi (if). You can also assume 12(0) 2 0 for all 3'.) The problem. Given these functions ”0:121: decide how many hours to spend on each project (in integer values only) so that your average grade, as computed according to the fé, is as large as possible. Your algorithm should run in time 0(n3H 3). Prove the correctness of your algorithm and analyze its running time.