Professional Documents
Culture Documents
J02 LinAlg and LPs Rev
J02 LinAlg and LPs Rev
1
MIT and James Orlin 2003
Some elementary facts about vectors and matrices. The Gauss-Jordan method for solving systems of equations. Bases and basic solutions and pivoting.
2
MIT and James Orlin 2003
w ! ?w1
w2
w3
v4 w4
3
Matrix Multiplication
A! (aij ) B ! (bij ) C ! (cij ) ! AvB
cij ! k !1aikbkj
n
4
MIT and James Orlin 2003
Multiplying Matrices
Let C = (cij) = AB. Then cij is the inner product of row i of A and column j of B.
a11 a12 A ! a21 a22 a31 a32 a13 b11 b12 a23 B ! b21 b22 a33 b31 b32 b13 b23 b33
Multiplying Matrices
Let C = (cij) = A v B. Then each column of C is obtained by adding multiples of columns of A.
1 2 3 100 123 4 5 6 v 10 ! 456 7 8 9 1 789
1 2 3 ! 100 4 10 5 6 7 8 9
MIT and James Orlin 2003
x1 1 2 4 x ! x A! 2 2 1 1 x3
2v3 3v1
0 b! 6
2v1
x1 2 x2 4 x3 ! 0 2 x1 x2 x3 ! 6
Find a linear combination of the columns of A that equals b.
1 2 4 0 2 x1 1 x2 1 x3 ! 6
1 2 -1
2 1 1
4 -1 2
1 -1 2
= = =
0 6 -3
8
MIT and James Orlin 2003
1 2 -1
= = =
Go to the animation
9
MIT and James Orlin 2003
b1 b2 b3
Pivot on a23
10
MIT and James Orlin 2003
Pivot on a23
x1 x2 x3 x4
a11 Da11
a12
a0 13 a1 23 0 a33
b1 b2b2 23 /a b3
What will be the next coefficient of b1? a32? of aij for i {2? MIT and James Orlin 2003
11
1 0 0
0 1 0
0 0 1
-1 1 0
= = =
2 1 -1
There are m columns that have been transformed into unit vectors, one for each row. The variables in these columns are called basic. The remaining variable(s) are called non-basic.
MIT and James Orlin 2003
12
1 0 0
0 1 0
0 0 1
-1 1 0
= = =
2 1 -1
In the basic solution, the non-basic variables are set to 0. The basic solution is:
MIT and James Orlin 2003
x1 = 2, x2 = 1, x3 = -1, x4 = 0
13
1 0 0
0 1 0
0 0 1
-1 1 0
= = =
2 4 -2 1 -1 3
We get a feasible solution to the system of equations for every choice of values for non-basic variables. If we set x4 = 2, what solution do we get? If we set x4 = (, what solution do we get? 14
MIT and James Orlin 2003
0 1 0
1 1 0
-2 0 0 3 -3 1
-1 1 0 1 0
= = =
1 4 -2 3 -1 3
Applications
A Financial Model
an investment model over multiple time periods goal: optimize the total revenues at the end of the time horizon
16
MIT and James Orlin 2003
A Financial Problem
Sarah has $1.1 million to invest in five different projects for her firm. Goal: maximize the amount of money that is available at the beginning of 2006.
At most $500,000 in any investment, except for CDs. Can invest in CDs, at 5% per year.
17
MIT and James Orlin 2003
STEP 1. Choose the decision variables Let xA denote the amount in millions of dollars invested in A. Define xB, xC, xD, and xE similarly. Let x3 denote the amount put in a CD in 2003. (Define x4 and x5 similarly)
19
MIT and James Orlin 2003
With your partner formulate the LP model. Step 2. Formulate the objective function
put the objective function in words first. E.G. we are minimizing cost or maximizing utility
20
MIT and James Orlin 2003
The model
Max z= Subject to .8 xB + 1.5 xD + 1.2 xE + 1.05 x5 xA + xC + xD + x3 = 1.1 (Year 2003) (Year 2004) (Year 2005)
Excel Solution
21
MIT and James Orlin 2003
FAQ. Do the units matter? How does one choose the units?
The units do not matter so long as one is careful to use units correctly. It would be possible to have xA be in $ millions and for xB to be in dollars. But some choices of units are more natural than others, and easier to use and to communicate.
22
MIT and James Orlin 2003
Financial Problems in practice are much larger, involving lots of potential investments, and more time periods. Data is often stored in a database. Other (to be addressed soon)
23
How might management use this model in practice? Lets vary some of the data and see if we can obtain insights:
How will the return vary with the initial investment? How will the return vary with the CD rate of return? Use SolverTable or usual sensitivity analysis Excel Solution
24
n investments, over m time periods. Total budget B to invest in period 1. The payback of $1 of investment j in period i is pij. If investment j starts in period i, then pij = -1, indicating that $1 is invested in that period. Everything is reinvested. Maximum of uj in investment j. Maximize the total return in period m.
Work with your partner on formulating the generalization. Let xj be the amount put into investment j
25
MIT and James Orlin 2003
The model
Maximize z ! subject to
n j !1 n j !1
n j !1
pmj x j
0 e x j e u j for j = 1 to n
26
MIT and James Orlin 2003
Finance concentrators: have we made assumptions that you would like to challenge? Can we deal with a more realistic model?
27
MIT and James Orlin 2003
Summary
Gauss-Jordan solving of equations and other background in linear algebra A financial problem Note: Modeling in practice is an art form. It requires finding the right simplifications of reality for a given situation.
28