Financial Mathematics 1 - Homework 6
Instructor: Dr. Le Nhat Tan
1 Automation
error_func = function() {
print('Error. Recheck Your Input.')
return(-1)
}
capital_allocate = function(cost, profit, budget, net = TRUE) {
if (length(cost) != length(profit) | budget <= 0) {
return(error_func())
}
if (net == TRUE) {
NPV = profit
} else {
NPV = profit - cost
}
num_proj = length(cost)
my.lp = make.lp(0, num_proj)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, NPV)
add.constraint(my.lp, cost, '<=', budget)
set.type(my.lp, 1:num_proj, 'binary')
solve(my.lp)
return(c(get.objective(my.lp), get.variables(my.lp)))
}
echo_CA = function(cost, profit, budget, net = TRUE) {
solution = capital_allocate(cost, profit, budget, net)
cat('Optimal Portfolio: ')
cat(solution[-1], '\n')
cat(paste('Optimal Profit:', solution[1]))
}2 Capital Budgeting
2.1 Slide 14
A firm is considering funding several proposed independent projects that have financial properties shown in the following table.
| Project | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Outlay ($1000) | 300 | 400 | 200 | 100 | 200 |
| NPV ($1000) | 10 | 20 | 10 | 10 | -15 |
If there is no limit on the capital budget, which projects would you choose?
If there is a limit on the capital budget of $600,000, which projects would you choose to maximize the profit?
echo_CA(cost = c(300, 400, 200, 100, 200),
profit = c(10, 20, 10, 10, -15),
budget = 600)## Optimal Portfolio: 0 1 1 0 0
## Optimal Profit: 30
2.2 Slide 15
A firm is considering funding several proposed independent projects that have the following cash flows.
| Year | Project 1 | Project 2 | Project 3 |
|---|---|---|---|
| 0 | -100 | -200 | -300 |
| 1 | 30 | 40 | 40 |
| 2 | 30 | 40 | 40 |
| 3 | 30 | 40 | 40 |
| 4 | 40 | 120 | 240 |
| Cost of Capital | 5% | 6% | 7% |
- If there is no limit on the capital budget, which projects would you choose?
- If there is a limit on the capital budget of $600, which projects would you choose to maximize the profit?
Solution. The present value of the \(1^{\textrm{st}}\) project is \[\textrm{PV}_1=\frac{30}{1+5\%}+\frac{30}{(1+5\%)^2}+\frac{30}{(1+5\%)^3}+\frac{40}{(1+5\%)^4}\approx114.606.\]
Similarly, the PV of other projects are given below.
| Project | 1 | 2 | 3 |
|---|---|---|---|
| PV | 114.606 | 201.972 | 288.067 |
- We chooses projects 1 and 3, the ones having present values exceeding costs.
echo_CA(cost = c(100, 200, 300),
profit = c(114.606, 201.972, 288.067),
budget = 600, net = FALSE)## Optimal Portfolio: 1 1 0
## Optimal Profit: 16.578
3 Independent Projects
3.1 Slide 18
During its annual budget planning meeting, a small computer company has identified several proposals for independent projects that could be initiated in the forthcoming year. These projects include the purchase of equipment, the design of new products, the lease of new facilities, and so forth. The projects all require an initial capital outlay in the coming year. The company management believes that it can makes available up to $500; 000 for these projects. The financial aspect of the projects are shown in the following table.
| Project | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| Outlay ($1000) | 100 | 20 | 150 | 50 | 50 | 150 | 150 |
| Present Worth ($1000) | 300 | 50 | 350 | 110 | 100 | 250 | 200 |
Which projects the company should select?
echo_CA(cost = c(100, 20, 150, 50, 50, 150, 150),
profit = c(300, 50, 350, 110, 100, 250, 200),
budget = 500, net = FALSE)## Optimal Portfolio: 1 0 1 1 1 1 0
## Optimal Profit: 610
3.2 Slide 21
A firm is considering funding several proposed projects that have financial properties shown in the following table.
| Project | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Outlay ($1000) | 100 | 300 | 200 | 150 | 150 |
| Present Worth ($1000) | 200 | 500 | 300 | 200 | 250 |
The available budget is $600,000. What is the optimal set of investment and the corresponding profit?
echo_CA(cost = c(100, 300, 200, 150, 150),
profit = c(200, 500, 300, 200, 250),
budget = 600, net = FALSE)## Optimal Portfolio: 1 1 1 0 0
## Optimal Profit: 400
3.3 Slide 22
A company has identified a number of promising projects. The cash flows (with unit $1000) for the first two years are shown in the following table.
| Project | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| Outlay 1 | 90 | 80 | 50 | 20 | 40 | 80 | 80 |
| Outlay 2 | 58 | 80 | 100 | 64 | 50 | 20 | 100 |
| NPV | 150 | 200 | 100 | 100 | 120 | 150 | 240 |
The company managers have decided that they can allocate up to $250,000 in each of the first 2 years to fund these projects. If less than $250,000 is used the first year, the balance can be invested at 10% and used to augment the next year’s budget. What is the optimal set of investment and the corresponding profit?
my.lp = make.lp(0, 8)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, c(150, 200, 100, 100, 120, 150, 240, 0))
add.constraint(my.lp, c(90, 80, 50, 20, 40, 80, 80, 1), '=', 250)
add.constraint(my.lp, c(58, 80, 100, 64, 50, 20, 100, -1.1), '<=', 250)
set.type(my.lp, 1:7, 'binary')
solve(my.lp)get.objective(my.lp)## [1] 610
get.variables(my.lp)## [1] 1 0 0 1 1 0 1 20
4 Dependent Projects - Slide 24
A transportation authority, with the total budget 5 million dollars, wishes to construct a road between Augen and Burger cities, to improve Cay Road bridge and to build more traffic control in Downsberg. The financial aspect of these 3 goals are shown in the following 3 tables.
| Project | Concrete, 2 lanes | Concrete, 4 lanes | Asphalt, 2 lanes | Asphalt, 4 lanes |
|---|---|---|---|---|
| Cost ($1000) | 2000 | 3000 | 1500 | 2200 |
| NPV ($1000) | 4000 | 5000 | 3000 | 43000 |
| Project | Repair Existing | Add Lane | New Structure |
|---|---|---|---|
| Cost ($1000) | 500 | 1500 | 2500 |
| NPV ($1000) | 1000 | 1500 | 2500 |
| Project | Traffic Lights | Turn Lanes | Underpass |
|---|---|---|---|
| Cost ($1000) | 100 | 600 | 1000 |
| NPV ($1000) | 300 | 1000 | 2000 |
my.lp = make.lp(0, 10)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, c(4,5,3,4.3,1,1.5,2.5,0.3,1,2))
add.constraint(my.lp, c(2,3,1.5,2.2,0.5,1.5,2.5,0.1,0.6,1), '<=', 5)
add.constraint(my.lp, c(1,1,1,1,0,0,0,0,0,0), '<=', 1)
add.constraint(my.lp, c(0,0,0,0,1,1,1,0,0,0), '<=', 1)
add.constraint(my.lp, c(0,0,0,0,0,0,0,1,1,1), '<=', 1)
set.type(my.lp, 1:10, 'binary')
solve(my.lp)get.objective(my.lp)## [1] 8
get.variables(my.lp)## [1] 0 1 0 0 1 0 0 0 0 1
5 Cash Matching Problems
5.1 Slide 34
Roclap Inc. manufactures two products with corresponding quantities \(x_1\) and \(x_2\) (positive integers). It has been estimated that contribution margins per unit of product 1 and product 2 (to the firms cash flow) are $3 and $4:5, respectively. The availability of raw material, used for the production of the two output lines, is limited to 80 tonnes. The firm uses 0.05 tonnes of raw material to produce one unit of product 1 and 0.1 tonnes for one unit of product 2. Products 1 and 2 require one kilogram of a particular ingredient for each single unit of output. The maximum amount of this ingredient available is 1,000 kilograms. Roclap is bound by a legal contract with the government to produce a minimum of 300 units of product 2. The firm wishes to find out the product mix which maximizes the total dollar contribution subject to these constraints.
my.lp = make.lp(0, 2)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, c(3, 4.5))
add.constraint(my.lp,c(0.05, 0.1), '<=', 80)
add.constraint(my.lp,c(1, 1), '<=', 1000)
set.type(my.lp, 1:2, 'integer')
set.bounds(my.lp, lower = c(0, 300), columns = c(1, 2))
solve(my.lp)get.objective(my.lp)## [1] 3900
get.variables(my.lp)## [1] 400 600
5.2 Slide 36
Capitol Inc. faces one-period capital rationing. Capitol has two divisions, between which it must allocate capital. For every dollar invested in Division 1, $0.25 of NPV is created, and for every dollar invested in Division 2, $0.35 of NPV is created. Total investment opportunities in Divisions 1 and 2 are limited to $3,000 and $1,900, respectively. A by-product from Division 1 is used in Division 2, so the amount of investment in Division 1 must be at least twice that in Division 2. The firm wishes to decide how much to invest in each division.
Solution. Let \(x_1,x_2\) be the amount of investment in the two projects, then the problem can be restate in the form
\[\begin{matrix} \textrm{maximize} & 0.25x_1+0.35x_2\\ \textrm{subject to} & x_1\leq3000\\ & x_2\leq1900\\ & x_1\geq2x_2\\ & x_1,x_2\geq0 \end{matrix}\]
my.lp = make.lp(0, 2)
lp.control(my.lp, sense = 'max')
add.constraint(my.lp, c(1, -2),'>=',0)
set.objfn(my.lp, c(0.25, 0.35))
set.type(my.lp, 1:2, 'real')
set.bounds(my.lp, lower = c(0, 0), upper = c(3000, 1900), columns = 1:2)
solve(my.lp)get.objective(my.lp)## [1] 1275
get.variables(my.lp)## [1] 3000 1500
Solution by Hand: We convert the problem into standard form
\[\begin{matrix} \textrm{minimize} & -0.25x_1-0.35x_2\\ \textrm{subject to} & x_1+s_1=3000\\ & x_2+s_2=1900\\ & -x_1+2x_2+s_3=0\\ & x_1,x_2,s_1,s_2,s_3\geq0 \end{matrix}\]
and then proceed with the simplex algorithm as usual.
| \(x_1\) | \(x_2\) | \(s_1\) | \(s_2\) | \(s_3\) | rhs |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 3000 |
| 0 | 1 | 0 | 1 | 0 | 1900 |
| -1 | 2 | 0 | 0 | 1 | 0 |
| -1/4 | -7/20 | 0 | 0 | 0 | 0 |
| \(x_1\) | \(x_2\) | \(s_1\) | \(s_2\) | \(s_3\) | rhs |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 3000 |
| 1/2 | 0 | 0 | 1 | -1/2 | 1900 |
| -1/2 | 1 | 0 | 0 | 1/2 | 0 |
| -17/40 | 0 | 0 | 0 | 7/40 | 0 |
| \(x_1\) | \(x_2\) | \(s_1\) | \(s_2\) | \(s_3\) | rhs |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 3000 |
| 0 | 0 | -1/2 | 1 | -1/2 | 400 |
| 0 | 1 | 1/2 | 0 | 1/2 | 1500 |
| 0 | 0 | 17/40 | 0 | 7/40 | 1275 |
The optimal solution is \((3000,1500)\) and the optimal value is \(-1275,\) i.e. the maximum profit attainable is $1,275.
5.3 Slide 37
A company is considering several proposals for independent projects. The projects all require an initial capital outlay in each of the next two years. The company management believes that it can makes available up to $50,000 and $20,000 for the first and second outlays of these projects. The financial aspect of the projects are shown in the following table ($1000 unit).
| Project | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| NPV | 14 | 17 | 17 | 15 | 40 | 12 | 14 | 10 | 12 |
| Outlay 1st | 12 | 54 | 6 | 6 | 30 | 6 | 48 | 36 | 18 |
| Outlay 2st | 3 | 7 | 6 | 2 | 35 | 6 | 4 | 3 | 3 |
Which projects the company should select?
my.lp = make.lp(0,9)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, c(14,17,17,15,40,12,14,10,12))
add.constraint(my.lp, c(12,54,6,6,30,6,48,36,18), '<=', 50)
add.constraint(my.lp, c(3,7,6,2,35,6,4,3,3), '<=', 20)
set.type(my.lp, 1:9, 'binary')
solve(my.lp)get.objective(my.lp)## [1] 70
get.variables(my.lp)## [1] 1 0 1 1 0 1 0 0 1
5.4 Slide 39
A company is considering several proposals for independent projects. The projects all require an initial capital outlay in each of the next two years. The company management believes that it can makes available up to $50,000 and $20,000 for the first and second outlays of these projects. The discount rate is constant at 7% p.a. compounded annually. The financial aspect of the projects are shown in the following table ($1000 unit).
| Project | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Present Worth | 24 | 77 | 17 | 15 | 70 | 22 | 54 | 50 | 32 |
| Outlay 1st | 12 | 54 | 6 | 6 | 30 | 6 | 48 | 36 | 18 |
| Outlay 2st | 3 | 7 | 6 | 2 | 35 | 6 | 4 | 3 | 3 |
Which projects the company should select?
PV = c(24, 77, 17, 15, 70, 22, 54, 50, 32)
outlay_1 = c(12, 54, 6, 6, 30, 6, 48, 36, 18)
outlay_2 = c(3, 7, 6, 2, 35, 6, 4, 3, 3)
discount = rep(1.07, 9)
cost = outlay_1 / discount + outlay_2 / (discount ^ 2)
my.lp = make.lp(0, 9)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, PV - cost)
add.constraint(my.lp, outlay_1, '<=', 50)
add.constraint(my.lp, outlay_2, '<=', 20)
set.type(my.lp, 1:9, 'binary')
solve(my.lp)get.objective(my.lp)## [1] 47.67141
get.variables(my.lp)## [1] 1 0 1 1 0 1 0 0 1
5.5 Slide 40
A Majorca-based property developer plans to construct luxury hotels at beach resorts in north-east Australia. He has identified 4 potential locations for the building: Gold, Sunshine, Capricornia and Cassowary Coasts. The predicted capital investments for the four locations are $20M, $18M, $19M and $24M respectively, and the estimated NPV payoffs are $12M, $10M, $9M and $14M respectively. A total investment budget of $50M is available. Another constraint concerns the time required by the specialist resort architect to design the hotels. He can spend up to 1,000 hours on designs and modifications for the approval process. Each hotel will be unique in design, and respective time requirements are 250 hours, 180 hours, 320 hours and 400 hours. To maximize the profit, which places should be invested?
my.lp = make.lp(0, 4)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, c(12, 10, 9, 14))
add.constraint(my.lp, c(20, 18, 19, 24), '<=', 50)
add.constraint(my.lp, c(250, 180, 320, 400), '<=', 1000)
set.type(my.lp, 1:4, 'binary')
solve(my.lp)get.objective(my.lp)## [1] 26
get.variables(my.lp)## [1] 1 0 0 1
5.6 Slide 42
A coal-mining company wishes to open up new mines in an area where large coal deposits have been proven by geological survey. Mines at three sites labelled Mine A, Mine B and Mine C are being considered. Respective predicted capital outlays are $20M, $18M and $12M, and the company has $70M available for investment. To allow rail transport of coal to an export port on the coast, a railway line extension to the area at an outlay of $25M in present value terms is required. While accommodation already exists at mine sites A and B, Mine C would require a town development project costing $15M in present dollars. Predicted NPV payoffs from the three sites are $19M for Mine A, $17M for Mine B and $28M for Mine C. Markets exist for up to 45,000 tonnes (45 kt) of coal per year, and predicted mine outputs are 18, 16 and 24 kt/year respectively. Should the company do to maximize its profit?
my.lp = make.lp(0,5)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, c(19,17,28,-25,-15))
add.constraint(my.lp, c(20,18,12,25,15), '<=', 70)
add.constraint(my.lp, c(18,16,24,0,0), '<=', 45)
add.constraint(my.lp, c(1,1,1,-3,0), '<=', 0)
add.constraint(my.lp, c(0,0,1,0,-1), '<=', 0)
set.type(my.lp, 1:5, 'binary')
solve(my.lp)get.objective(my.lp)## [1] 11
get.variables(my.lp)## [1] 1 1 0 1 0
5.7 Slide 44
A sporting goods manufacturer is considering introducing a number of new product lines, namely cricket, golf, hockey and baseball equipment. Respective capital requirements for establishment of these product lines in million dollars are 4, 8, 3 and 3.5, and capital of up to 16 is available. NPV payoffs in million dollars are predicted to be 3, 5, 2 and 2.2. Because of the need for specialization to become technically efficient, the manufacturer decides to limit production to at most three product lines. Also, he does not wish to produce both hockey and baseball equipment, owing to lack of expertise in these product lines. What should the manufacturer do?
my.lp = make.lp(0, 4)
lp.control(my.lp, sense = 'max')
set.objfn(my.lp, c(3, 5, 2, 2.2))
add.constraint(my.lp, c(4, 8, 3, 3.5), '<=', 16)
add.constraint(my.lp, c(1, 1, 1, 1), '<=', 3)
add.constraint(my.lp, c(0, 0, 1, 1), '<=', 1)
set.type(my.lp, 1:4, 'binary')solve(my.lp)## [1] 0
get.objective(my.lp)## [1] 10.2
get.variables(my.lp)## [1] 1 1 0 1