Chapter 2. Linear Algebra
Chapter 2. Linear Algebra
Linear Algebra
1
2.1.1. Matrices
1 3 1
2 3 7
A= B = 2 1 4
1 − 1 5 4 7 6
Why matrix?
2
2.1.1. Matrices
Consider the following set of equations:
x + y = 7, It is easy to show that x = 3 and y = 4.
3x − y = 5.
x + y − 2 z = 7,
2 x − y − 4 z = 2,
How about solving
−5 x + 4 y + 10 z = 1,
3x − y − 6 z = 5.
∑
i =1
aii = a11 + a22 + ... + ann
is called the trace of A.
5
2.1.1. Matrices
Equal matrices
1 0 a b
Example: A= and
B=
−4 2 c d
Given that A = B, find a, b, c and d.
if A = B, then a = 1, b = 0, c = -4 and d = 2.
7
2.1.1. Matrices
Zero matrices
8
2.1.2. Operations of matrices
Sums of matrices
12
2.1.2. Operations of matrices
Properties
13
2.1.2. Operations of matrices
Matrix multiplication
c11 = 1 × ( −1) + 2 × 2 + 3 × 5 = 18
−1 2 c = 1× 2 + 2 × 3 + 3 × 0 = 8
1 2 3 ⇒ 12
0 1 4 2 3
c21 = 0 × ( −1) + 1 × 2 + 4 × 5 = 22
5 0 c22 = 0 × 2 + 1 × 3 + 4 × 0 = 3
−1 2
1 2 3 18 8
C = AB = 2 3 =
0 1 4 22 3
5 0
15
2.1.2. Operations of matrices
Matrix multiplication
16
2.1.2. Operations of matrices
Matrix multiplication
BUT BA is a m × m matrix!
b11 b11a11 b11a12 K b11a1m
b b a b a b a
BA = 21 [ a11 a12 ... a1m ] = 21 11 21 12 21 1m
M M O
b
m1 b a b
m1 11 m1 12a b a
m1 1m
So AB ≠ BA in general !
17
2.1.2. Operations of matrices
Properties
18
2.1.2. Operations of matrices
Properties
20
2.1.3. Types of matrices
Identity matrix
21
2.1.3. Types of matrices
Identity matrix
22
2.1.3. Types of matrices
Identity matrix
23
2.1.3. Types of matrices
Special square matrix
26
2.1.3. Types of matrices
Symmetric matrix
1/ 3 1/ 3 1/ 3
Since, A = 1/ 6
T
. 6
−2 / 6 1/ Hence, AAT = ATA = I.
−1/ 2 0 1/ 2
Can you show the
details?
We’ll see that orthogonal matrix represents a rotation in
fact! 28
2.1.4. Properties of matrix
(AB)-1 = B-1A-1
(AT)T = A and (λA)T = λ AT
(A + B)T = AT + BT
(AB)T = BT AT
29
2.1.4. Properties of matrix
Example: Prove (AB)-1 = B-1A-1.
30
2.1.5. Determinants
When we look at a particular square matrix, the
question of whether it is nonsingular is one of the
first things that we ask. This section develops a
formula to determine this.
3 - 31
The Determinant of a Matrix
The determinant of a 2 × 2 matrix:
a11 a12
A=
a a
21 22
⇒ det( A) = | A | = a11a22 − a21a12
Note: a11 a12 a11 a12
a ≡
21 a22 a21 a22
2 −3
= 2( 2) − 1( −3) = 4 + 3 = 7
1 2
3 - 32
Minor of the entry aij :
a11 a12 L a1( j −1) a1( j +1) L a1n
M M M
a( i −1)1 L a( i −1)( j −1) a( i −1)( j +1) L a( i −1) n
M ij = aij
a( i +1)1 L a( i +1)( j −1) a( i +1)( j +1) L a( i +1) n
M M M M
a n1 L an( j −1) an( j +1) L ann
• Cofactor ofaij :
C ij = ( −1)i + j M ij
3 - 33
Example:
a11 a12 a13 a11 a12 a13
A = a21 a22 a23 A = a21 a22 a23
a31 a32 a33 a31 a32 a33
a12 a13 a11 a13
⇒ M 21 = M 22 =
a32 a33 a31 a33
+ − + − + L
− + − + − L
Notes: Sign pattern for cofactors
+ − + − + L
− + − + − L
+ − + − + L
M M M M M
3 - 34
Expansion by cofactors
Let A is a square matrix of order n, then the determinant of A is
given by
n
( a ) det( A) =| A |= ∑ aij C ij = ai 1C i 1 + ai 2C i 2 + L + ainC in
j =1
3 - 36
Example: (The determinant of a matrix of order
3)
0 2 1
A = 3 − 1 2 ⇒ det( A) = ?
4 − 4 1
Sol:
1+ 1 −1 2 3 2
C11 = ( −1) =7 1+ 2
C12 = ( −1) = −(3 − 8) = 5
−4 1 4 1
1+ 3 3 −1
C13 = ( −1) = −12 + 4 = −8
4 −4
–4 0 6
Ex : 0 2 1 0 2
A = 3 − 1 2 3 − 1
4 − 4 1 4 − 4
0 16 –12
⇒ det( A) =| A |= 0 + 16 − 12 − (−4) − 0 − 6 = 2
3 - 38
Upper triangular matrix:
All the entries below the main diagonal are zeros.
Lower triangular matrix:
All the entries above the main diagonal are zeros.
Diagonal matrix:
All the entries above and below the main diagonal are zeros.
3 - 39
Determinant of a Triangular Matrix
If A is an nxn triangular matrix (upper triangular, lower
triangular, or diagonal), then its determinant is the
product of the entries on the main diagonal. That is
det( A) =| A |= a11a22a33 L ann
3 - 41
Evaluation of a determinant using elementary operations
3 - 42
Ex:
1 2 3
A = 0 1 4 det( A) = −2
1 2 1
4 8 12 0 1 4 1 2 3
A1 = 0 1 4 A2 = 1 2 3 A3 = − 2 − 3 − 2
1 2 1 1 2 1 1 2 1
Ex: Evaluation of a determinant using elementary row operations
2 − 3 10
A = 1 2 − 2 ⇒ det( A) = ?
0 1 − 3
Sol:
2 −3 10 1 2 −2
ρ12
det( A) = 1 2 −2 → − 2 −3 10
0 1 −3 0 1 −3
3 - 44
1 2 −2 1
1 2 −2
−2 ρ1 + ρ 2 − ρ2 1
→ − 0 −7 14
7
→ ( − 1)( −1 ) 0 1 −2
0 1 −3 7
0 1 −3
1 2 −2
− ρ2 + ρ3
→ 7 0 1 −2 = (7)(1)(1)( −1) = −7
0 0 −1
3 - 45
• Conditions that yield a zero determinant
If A is a square matrix and any of the following conditions is true,
then det (A) = 0.
(a) An entire row (or an entire column) consists of zeros.
(b) Two rows (or two columns) are equal.
(c) One row (or column) is a multiple of another row (or
column).
The theorem states that : a matrix with two identical rows or two linear dependent
rows has a determinant of zero. A matrix with a zero row has a determinant of zero.
Note that a matrix is nonsingular if and only if its determinant is nonzero and the
determinant of an echelon form matrix is the product down its diagonal.
3 5 9 5 10
5 119 205 30 45
3 - 47
• Ex: (Evaluating a determinant)
2 0 1 3 −2
−2 1 3 2 −1
A = 1 0 −1 2 3
3 −1 2 4 −3
1 1 3 2 0
Sol:
2 0 1 3 −2 2 0 1 3 −2
−2 1 3 2 −1 −2 1 3 2 −1
det( A) = 1 0 −1 2 3 = 1 0 −1 2 3
ρ 2 + ρ4
3 − 1 2 4 − 3 − ρ 2 + ρ 5 1 0 5 6 −4
1 1 3 2 0 3 0 0 0 1
2 1 3 −2
1 −1 2 3
= (1)( − 1)2+ 2
1 5 6 −4
3 0 0 1
3 - 48
8 1 3 −2
8 1 3 0 0 5
−3 ρ 4 + ρ 1 −8 − 1 2 3
= = (1)( − 1)4+ 4 − 8 −1 2 = −8 − 1 2
13 5 6 −4 ρ 2 + ρ1
13 5 6 13 5 6
0 0 0 1
−8 −1
= 5( − 1)1+ 3
13 5
= (5)( −40 + 13) = (5)( −27)
= −135
3 - 49
Properties of Determinants
Determinant of a matrix product
• Notes:
3 - 50
Ex: (The determinant of a matrix product)
1 − 2 2 2 0 1
A = 0 3 2 B = 0 − 1 − 2
1 0 1 3 1 − 2
1 −2 2 2 0 1
| A |= 0 3 2 = −7 | B |= 0 − 1 − 2 = 11
1 0 1 3 1 −2
3 - 51
1 − 2 2 2 0 1 8 4 1
AB = 0 3 2 0 − 1 − 2 = 6 − 1 − 10
1 0 1 3 1 − 2 5 1 − 1
8 4 1
⇒| AB |= 6 − 1 − 10 = −77 =| A || B |
5 1 −1
3 - 52
Determinant of a scalar multiple of a matrix
3 - 54
Determinant of an inverse matrix
1
If A is invertible,then det(A −1 ) = .
det(A )
Determinant of a transpose
If A is a square matrix, then det( AT ) = det( A).
• Ex:
1 0 3 −1
(a) A = ? (b) AT = ?
A = 0 − 1 2
2 1 0
Sol:
1 0 3 1 1
∴ A−1 = =
Q | A |= 0 −1 2 = 4 A 4
2 1 0 AT = A = 4
3 - 55
Equivalent conditions for a nonsingular matrix:
matrix
(1) A is invertible.
(4) A is row-equivalent to In
3 - 56
• Ex: Which of the following system has a unique
solution?
(a) 2 x2 − x3 = −1
3x1 − 2 x2 + x3 = 4
3x1 + 2 x2 − x3 = −4
Sol: 0 2 −1
Ax = b Q A = 3 −2 1 = 0
3 2 −1
3 - 57
(b) 2 x2 − x3 = −1
3 x1 − 2 x2 + x3 = 4
3 x1 + 2 x2 + x3 = −4
Sol:
Bx = b
Q B = −12 ≠ 0
3 - 58
Applications of Determinants
Matrix of cofactors of A:
C11 C12 L C1n
C C L C
[ ] M M
C ij = 21 22 2n
M
Note Cij = (−1)i + j Mij
C n1 C n 2 L C nn
Adjoint matrix of A:
C11 C 21 L C n1
C C 22 L C n 2
adj ( A) = [ Cij ]
T
= 12
M M M
C1 n C 2 n L C nn
3 - 59
The inverse of a matrix given by its adjoint
If A is an n × n invertible matrix, then
−1 1
A = adj ( A)
det( A)
Ex:
a b d − c d − b
A= CA = adj ( A) =
c d − b a − c a
⇒ det( A) = ad − bc
1
−1 1 d − b
⇒A = adj ( A) =
det ( A) ad − bc − c a
3 - 60
• Ex:
− 1 3 2 (a) Find the adjoint of A.
A = 0 − 2 1
1 0 − 2 (b) Use the adjoint of A to find A−1
i+ j
Sol: Q C ij = ( −1) M ij
−2 1 0 1 0 −2
⇒ C11 = + = 4, C12 = − = 1, C13 = + =2
0 −2 1 −2 1 0
3 2 −1 2 −1 3
C21 = − = 6, C22 = + = 0, C23 = − =3
0 2 1 2 1 0
3 2 −1 2 −1 3
C31 = + = 7, C 32 = − = 1, C33 = + =2
−2 1 0 1 0 −2
3 - 61
⇒ cofactor matrix of A ⇒ adjoint matrix of A
4 1 2 4 6 7
C ij = 6 0 3 adj ( A) = C ij = 1 0 1
T
7 1 2 2 3 2
⇒ inverse matrix of A
Q det ( A ) = 3
−1 1
A = adj ( A)
det ( A )
43 2 7
3 4 6 7
= 13 0 1
= 13 1 0 1
3
23 1 3
2
2 3 2
Check: AA−1 = I
3 - 62
• Cramer’s Rule
a11 x1 + a12 x2 + L + a1n xn = b1
a21 x1 + a22 x2 + L + a2 n xn = b2
M
an1 x1 + an 2 x2 + L + ann xn = bn x1 b1
x b
Ax = b A = aij = A(1) , A(2) , L , A( n ) x = 2 b = 2
n× n M M
a11 a12 L a1n xn bn
a21 a22 L a2 n
det( A) = ≠0
M M M (this system has a unique
a n1 a n 2 L ann solution)
3 - 63
Cramer’s rule
A j = A(1) , A(2) ,L , A( j −1) , b, A( j +1) , L , A( n )
det( A j )
⇒ xj = , j = 1, 2 , L , n
det( A)
3 - 64
• Proof:
A x = b, det( A) ≠ 0
1
−1
⇒x= A b = adj ( A)b
det( A)
C11 C 21 L C n1 b1
C n 2 b2
1 C12 C 22 L
=
det( A) M M M M
C1 n C 2 n L C nn bn
3 - 65
1
⇒ xj = (b1C1 j + b2C 2 j + L + bnC nj )
det( A)
det( A j )
= j = 1, 2 , L , n
det( A)
3 - 66
• Ex: Use Cramer’s rule to solve the system of linear equations.
− x + 2 y − 3z = 1
2x + z = 0
3x − 4 y + 4 z = 2
Sol: −1 2 − 3 1 2 −3
det( A) = 2 0 1 = 10 det( A1 ) = 0 0 1 =8
3 −4 4 2 −4 4
−1 1 − 3 −1 2 1
det( A2 ) = 2 0 1 = −15, det( A3 ) = 2 0 0 = −16
3 2 4 3 −4 2
det( A1 ) 4 det( A2 ) − 3 det( A3 ) − 8
x= = y= = z= =
det( A) 5 det( A) 2 det( A) 5
3 - 67
2.2. System of Equations: Matrices and
Vectors
Assume an economic model as system of linear
equations in which
aij parameters, where i = 1.. n rows, j = 1.. m
columns, and n=m
xi endogenous variables,
di exogenous variables and constants
a11 x1 + a12 x2 + a1m xn = d1
a21 x1 + a22 x2 + a 2 m xn = d 2
M M M M
an1 x1 + an 2 x2 + anm xn = d n
68
2.2. System of equations: Matrices and Vectors
70
2.2.2. Linear dependence
• A set of vectors is linearly
dependent if any one of
them can be expressed as a v1' = [ 5 12]
linear combination of the v2' = [10 24]
remaining vectors; 5 10 v1'
otherwise, it is linearly 12 24 = '
v2
independent. 2v1/ − v2/ = 0 /
• Dependence prevents
solving a system of 2 1 4
equations. More unknowns v1 = ; v2 = ; v3 =
than independent 7 8 5
equations. 3v1 − 2v2
• The number of linearly = [ 6 21] − [ 2 16]
independent rows or = [ 4 5] = v3
columns in a matrix is the
rank of a matrix (rank(A)). 3v1 − 2v2 − v3 = 0
71
2.2.3. Application 1:One Commodity Market
Model (2x2 matrix)
Economic Model a+c
P =*
1) Qd=Qs b+d
2) Qd = a – bP (a,b >0) ad − bc
Q =
*
3) Qs = -c + dP (c,d >0) b+d
Find P* and Q*
Scalar Algebra Matrix Algebra
Endog. :: Constants 1 b Q a
4) 1Q + bP = a 1 − d P = − c
5) 1Q – dP = -c
Ax = d
x* = A−1d
72
2.2.3. One Commodity Market Model
(2x2 matrix)
Matrix algebra
1 b Q a
1 − d P = − c
Ax = d
−1
Q 1 b a
*
* =
P 1 − d − c
−1
x =A d
*
73
2.2.4. General form of 3x3 linear matrix
75
2.2.6. Three Equation National Income
Model
• Endogenous: Y, C, T: Income (GNP), Consumption,
and Taxes.
• Exogenous: I0 and G0: autonomous Investment &
Government spending.
• Constants a & d: autonomous consumption and taxes.
• Parameter t is the marginal propensity to tax gross
income 0 < t < 1.
• Parameter b is the marginal propensity to consume
private goods and services from gross income 0 < b < 1.
a − bd + I 0 + G0
8) Y =*
1 − b + bt
76
2.2.6. Three Equation National Income
Model
Parameters & Exog.
Endogenous vars. vars.
Given
Y C T &cons.
Y = C + I 0 + G0 1Y -1C +0T = I0+G0
-bY +1C +bT = a
C = a + b(Y-T)
-tY +0C +1T = d
T = d + tY
1 − 1 0 Y I 0 + G0
Find Y*, C*, T*
− b 1 b C = a
Ax = d
− t 0 1 T d
x * = A−1d
78
2.2.6. Three Equation National Income
Model
1 − 1 0 Y I 0 + G0
− b 1 b C = a
− t 0 1 T d
Ax = d
−1
Y 1 − 1 0 I 0 + G0
*
*
C = − b 1 b a
T * − t 0 1 d
−1
x =A d
*
79
2.2.7. Application III: Two Commodity
Market Equilibrium (4x4 matrix)
Given Scalar algebra
Qdi = Qsi, i=1, 2 1Q1 +0Q2 +2P1 - 1P2 = 10
Qd1 = 10 - 2P1 + P2 1Q1 +0Q2 - 3P1 +0P2= -2
Qs1 = -2 + 3P1 0Q1+ 1Q2 - 1P1 + 1P2= 15
Qd2 = 15 + P1 - P2
0Q1+ 1Q2 +0P1 - 2P2= -1
Qs2 = -1 + 2P2
1 0 2 − 1 Q1 10
Find Q , Q2 , P , P 1 0 − 3 0 Q2 − 2
* * * *
1 1 2
=
Ax = d 0 1 − 1 1 P1 15
x* = A−1d 0 1 0 − 2 P2 − 1
80
2.2.8. Two Commodity Market Equilibrium
1 0 2 − 1 Q1 10
1 0 −3
0 2 − 2
Q
=
0 1 −1 1 P1 15
0 1 0 − 2 P2 − 1
Ax = d
−1
Q1* 1 0 2 − 1 10
*
Q 2 = 1 0 −3 0 − 2
P * 0 1 −1 1 15
1*
P2 0 1 0 − 2 − 1
x* = A−1d 81
2.3. Eigenvalues and eigenvectors
Eigenvalue problem:
Eigenvalue
(The fundamental equation for
Ax = λx
the eigenvalue problem)
Eigenvector
3 - 82
• Ex 1: (Verifying eigenvalues and eigenvectors)
1 4 1 2
A= x1 = x2 =
2 3 1 − 1
Eigenvalue
1 4 1 5 1
Ax1 = = = 5 = 5 x1
2 3 1 5 1
Eigenvector
Eigenvalue
1 4 2 − 2 2
Ax2 = = = −1 = (−1) x2
2 3 − 1 1 − 1
Eigenvector
3 - 83
Question:
Given an n× n matrix A, how can you find the eigenvalues and
corresponding eigenvectors?
Note:
Ax = λ x = λ Ix ⇒ (λ I − A) x = 0 (homogeneous system)
Note: If (λI − A) x = 0 has nonzero solutions iff det(λI − A) = 0.
3 - 84
• Ex: (Finding eigenvalues and eigenvectors)
1 4
A=
2 3
Eigenvalue: λ1 = 5, λ2 = −1
3 - 85
4 −4 x1 0
(1) λ1 = 5 ⇒ (λ1I − A) x = x =
−2 2 2 0
x1 t 1
x = = t , t ≠ 0
2 t 1
−2 −4 x1 0
(2) λ2 = −1 ⇒ ( λ 2 I − A) x = x =
−2 −4 2 0
x1 2t 2
x = = t , t ≠ 0
2 −t − 1
3 - 86
Quadratic Forms
Definition 1: Let A be n×n symmetric matrix and x
denote an n×1 column vector. Then Q=X’AX is said to
be a quadratic form of A.
Example: A = 1 2
2 1
1 2 X 1
The form of A is Q = X ′AX = ( X 1 X 2 )
2 1 X 2
2 2
= X1 + 4 X1 X 2 + X 2
Definiteness
Definition 2: A quadratic form is said to be:
A) Negative definite: Q<0 when x≠0
B) Negative semi definite: Q≤0 for all x and Q=0 for
some x≠0
C)Positive definite: Q>0 when x≠0
D)Positive semi definite: Q≥0 for all x and Q=0 for
some x≠0
E) Indefinite: Q≥0 for some x and Q<0 for some other
x
Examples
1 0 0
Example 1: D = 0 2 0
0 0 4
Q = X ′DX = X 1 + 2 X 2 + X 3
2 2 2
∀X ≠ 0, Q > 0
Hence D is positive definite
91
Determining Positive-definiteness
An arbitrary matrix is positive definite if and only
if all the principal sub-matrices have a positive
determinant.
92
Diagonal dominance
A matrix M is row diagonally dominant if
n
mi ,i > ∑
j =1, j ≠ i
mi , j
for i=1,…,n.
A matrix M is column diagonally dominant if
n
mi ,i > ∑
j =1, j ≠ i
m j ,i
for i=1,…,n.
A matrix is diagonally dominant if it is both
row and column diagonally dominant.
93
Positive-definite definition
A symmetric row diagonally-dominant matrix
with positive definite entries is positive definite.
Example: if 3 −1 −2
M = −2 2 0 ,
1 0 1
is it positive definite?
Determinants of principal sub-matrices
3,3*2-2=4,3*2-2+4=8
94