In a certain week, a company wants to finish m projects. To this end, the company can employ at most n people from the unemployment agency for a period of one week. Each external employee will cost the company salary euro, unless the project in which he/she is involved is not completed in time. In that case no payment is due.
For each project the company knows from experience the probability that the project will be completed within a week, as a function of the number of employees working on it. These probabilities are given as percentages pij, where i (with 1 ≤ i ≤ m) is the number of the project and j is the number of people working on it. Of course, when nobody is working on a project i, the probability pi0 is zero percent.
If project i is indeed finished within a week, the company earns reward(i) euro; if it is not ready in time, the company has to pay a fine of punishment(i) euro.
Of course the company wants to maximise its total expected profit1 at the end of the week by finding the optimal number of external employees to hire, and how to divide them over the projects. The optimal number of employees is the total number of people needed to achieve the maximal expected profit. Your task in this matter is to calculate this optimal number of external employees. Remember that at most n people are available. Furthermore: if a person is employed, he/she works on one and only one project.
--------------------------------------------------------------------------------
1Let p (0 < p < 1) be the probability that a job is finished in time, and let E1 be the profit in that case. Furthermore, let E2 be the (negative) profit in case the job is not finished in time. Then the expected profit for this particular job is p*E1 + (1 - p)*E2.