Question

In: Computer Science

Suppose you are a high-level manager in a software firm and you are managing n software...

Suppose you are a high-level manager in a software firm and you are managing n software projects. You are asked to assign m of the programmers in your firm among these n projects. Assume that all of the programmers are equally competent.
After some careful thought, you have figured out how much benefit i programmers will bring to project j. View this benefit as a number. Formally put, for each project j, you have computed an array Aj[0..m] where Aj[i] is the benefit obtained by assigning i programmers to project j. Assume that Aj[i] is nondecreasing with increasing i.

Design a dynamic programming algorithm to determine how many programmers you will assign to each project such that the total benefit obtained over all projects is maximized. Analyze its running time. (algorithm can be written in pseudocode, no specific language needed).

Solutions

Expert Solution

The solution of your problem:
We have to calculate p[i][j] - the maximal benefit we can obtain arranging j programmers for the first i projects.

The base of the dynamics is p[0][j]=0 for all j from 0 to m, we obviously get no profit if programmers do no projects.

For the other values we calculate p[i][j] in the following way:
if we want to arrange j programmers for the first i projects, we first need to arange (j-k) programmers for the first (i-1) projects and then to assume k programmers to the i-th project.

The total benefit we can get is p[i-1][j - k] + Ai[k]. In order to get maximal benefit we should maximaze this sum among all k=0..j and remember the proper k which maximizes this sum (for example put q[i][j]=k). Since the values of p were correct for smaller i, the value of p[i][j] is correct as well. Then, since Ai[j] is nondecreasing with increasing i, the p[n][m] maximal benefit me can obtain aranging all programmers to all projects.

In order to restore the answer we look at q[n][m] - amount of programmers we assume to the project m. Then we have n-1 projects and m-q[n][m] programmers left and, thus, q[n-1][m-q[n][m]] programmers must be assigned to the (n-1)-th project. The amount of programmers for the other projects can be obtained in the same way.

We need to calculate n*m elements of array p, each calculation takes O(m) time. So, the overall complexity is O(n*m^2).

Solution 2.

let p(j) be the number of programmers assigned to the jth project. The quantify to maximize is given by:
f(p) = Sum[A_j(p_j),{j,0,n}],
subject to the constraint that:
Sum[p_j,{j,0,n}] = m.

f(p) is monotonically increasing in m, but is not concave with respect to programmer reassignment when constrained to a particular m. This means that a gradient descent algorithm cannot succeed in general when starting from some choice of p_j. One algorithm that is guaranteed to succeed can take advantage of the monotonicity of f(p):

1) Let p_j = m for all j, such that there is m*n programmers
f(p) is at a maximum in the space where each of the p_j's is confined to lie between 0 and m (monotonicity).

2 )for each project k, compute f(p'(k)), where p'(k) is the assignment p with 1 programmer subtracted from project k. Find the k such that f(p'(k)) is the largest. This is the maximal f for n*m-1 total programmers.

3) set p_j = p_j-1 for the project k.

4) repeat steps 2 and 3 until the total number of programmers is m. You are now done.

This algorithm will run in time O[ mXn^3 ]: Step 2 must compute f n times, and each computation of f is linear in n. Step 2 must be done (mXn - m) times.

Since the algorithm is independent of any properties of the A_j's, apart from monotonicity, the worst, best and average case running times are all exactly same for some of n and m.


Related Solutions

Suppose you are a fund manager managing a portfolio worth $10million with Beta equal 1.2. The...
Suppose you are a fund manager managing a portfolio worth $10million with Beta equal 1.2. The index futures price is 1000 and each future contracts is on $50 times the index. If you want to keep the value of the portfolio stable without selling the portfolio in the next two months, what is your hedging strategy? In the maturity date, the index is 1050, please show the success of your strategy. The risk-free interest rate is 5% per annum (continuously...
Suppose you are a fund manager, currently managing a diversified risky portfolio that consists of equity...
Suppose you are a fund manager, currently managing a diversified risky portfolio that consists of equity index fund A (40%), bond index fund B (30%), and international equity fund C (30%). The portfolio has an expected rate of return of 12% and a standard deviation of 25%. Lisa, a project manager in IBM, is one of your clients. After some discussion with her, you suggest Lisa to invest her total $800,000 personal wealth in your fund and a T-bill money...
Suppose you are requested, as an IT project manager, to develop software applications to provide solutions...
Suppose you are requested, as an IT project manager, to develop software applications to provide solutions to certain issues at your workplace, place of study, or personal uses. In this assignment, you need to design a new software system that will solve these issues. In order to design that system, you need to identify, business requirements (functional and nonfunctional), identify an appropriate process model, and conduct a feasibility study. You also need to discuss ethical and professional issues related to...
1)You should suppose that you are managing or participating in an existing firm (e.g., Apple, Samsung,...
1)You should suppose that you are managing or participating in an existing firm (e.g., Apple, Samsung, Wal-Mart, Carrefour, Volkswagen, Exxon Mobil, any other small- and medium-sized firms, and so on) and you are responsible for assuming a project through which this firm would become more digital than now.
1 Assume you are the Human Resource Manager of a large software firm with global presence....
1 Assume you are the Human Resource Manager of a large software firm with global presence. The employee turnover rate of the firm has hovered around 15% for the last three years, compared to the industry average of 20%. Competition for quality software professionals is expected to increase as more firms from the developed countries set up their operations offshore in developing economies. You foresee a shortage of software professionals in the labor market in the future at both entry...
Suppose the firm moves from a high-wage to a low-wage country but its level of output...
Suppose the firm moves from a high-wage to a low-wage country but its level of output remains constant at 200 units per day. How will its total employment change?
Suppose you are the manager of a firm producing soap. In the long-run, you are deciding...
Suppose you are the manager of a firm producing soap. In the long-run, you are deciding from which of the following three production processes to choose your production method. Your wish, in order to maximize profits, is to choose the most economically efficient method of production that produces 100 units of soap per day. Method Units of Labor Units of Capital Labor Cost Capital Cost Capital Intensive 1 worker 5 machines Even Split 3 workers 3 machines Labor Intensive 6...
Scenario: Suppose you are a risk management professional working for risk managing firm which islocated in...
Scenario: Suppose you are a risk management professional working for risk managing firm which islocated in Dubai. risk managing firm provides consulting services to firms such as airlinecompanies and mining companies on their risk management. Mr. Abdul, the treasurer of goil Pte Ltd, approaches you today (assume it is now July 2020) to ask you for advice onthe financial risk management of his company. Goil (Dubai) Pte Ltd is a trading company which specializes in international trade of petrochemicals and...
Suppose that the accounting manager of a firm you are auditing is suspected of manipulating sales...
Suppose that the accounting manager of a firm you are auditing is suspected of manipulating sales and collection transactions to make earnings and receivable payments look higher than they are. What kinds of evidence will your audit look for? Suppose that this accounting manager wanted sales to appear lower in order to reduce tax expenses. What kinds of evidence will your audit look for in this case?
Suppose that the accounting manager of a firm you are auditing is suspected of manipulating sales...
Suppose that the accounting manager of a firm you are auditing is suspected of manipulating sales and collection transactions to make earnings and receivable payments look higher than they are. What kinds of evidence will your audit look for?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT