spring 2013 solving a system of linear equations matrix inverse simultaneous equations cramer’s...
TRANSCRIPT
Spring 2013
Solving a System of Linear Equations
Matrix inverseSimultaneous equations
Cramer’s ruleSecond-order Conditions
Lecture 7
Spring 2013
1. Matrix Equation and Matrix Inversion
Market equilibrium model
Demand: Q + P = 10
Supply : Q – 4P = -3
In matrix form,
3
10
41
11
P
Q
Spring 2013
General equation system
(N equations, N unknowns)
NNNNNN
N
N
b
b
b
x
x
x
aaa
aaa
aaa
2
1
2
1
21
22221
11211
.11
NNNNbxA
Spring 2013
If we can find a matrix A -1 such that A -1 Ax = x, then we can solve the equations by observing that
A-1Ax = A-1b
x = A-1b
Existence of an inverse A-1:
• A is a square matrix.
• A is not a null matrix.
• Rows and columns are linearly independent.
• A-1A = AA-1 = IN.
Spring 2013
In the previous example,
3
10
41
11
P
QAx = b
Example 7.1: Consider the matrix
11
14
5
1B
10
01
41
11
11
14
5
1BA
62
47
3
10
11
14
5
1.
.* Bbx
Spring 2013
2. Determinants
2.1 Determinants of Order 2
|A| = a11a22 – a12a21.
|A| = 1·4 - 2·3 = -2.
2221
1211
aa
aaA
43
21AExample 7.2:
Spring 2013
333231
232221
131211
aaa
aaa
aaa
A
|A| = a11a22a33 + a12a23a31 + a13a21a32
- a11a23a32 – a12a21a33 – a13a22a31
2.2 Determinants of Order 3
Spring 2013
333231
232221
131211
aaa
aaa
aaa a11 a12
a21 a22
a31 a32
+ + +– – –
|A| = a11a22a33 + a12a23a31 + a13a21a32
- a11a23a32 – a12a21a33 – a13a22a31
Spring 2013
Example 7.3: Find the determinants of the following square matrices.
325
011
203
A
2
2
2
cc1
bb1
aa1
B
Spring 2013
|Mij| =
2.3 Expansion by Cofactors
1. The minor |Mij| of a matrix is the determinant of the matrix obtained by deleting the ith row and jth column.
11 1, 1 1 1, 1 1
21 2, 1 2 2, 1 2
1 , 1 , 1
1 , 1 , 1
j j j n
j j j n
i i j ij i j in
n n j nj n j nn
a a a a a
a a a a a
a a a a a
a a a a a
Spring 2013
|M11| = 4, |M12| = 3, |M21| = 2, |M22| = 1
|M11| = 5, |M12| = -17, |M13| = -14
43
21A
315
746
238
B
Example 7.4: Find all the minors of the matrices A and B.
Spring 2013
2. The cofactor |Cij| of a matrix = (-1)i+j|Mij|
Example 7.5: Find all the cofactors of the following matrices.
43
21A
315
746
238
B
Spring 2013
3. The determinant is the expansion along any row or column.
|A| = ai1Ci1 + ai2Ci2 + + aijCij + ainCin
= a1jC1j + a2jC2j + + aijCij + anjCnj
Spring 2013
1st row: |A| = a11C11 + a12C12 = 1·4 + 2·(-3) = -2
2nd row: |A| = a21C21 + a22C22 = 3·(-2) + 4·1 = -2
1st column: |A| = a11C11 + a21C21 = 1·4 + 3·(-2) = -2
2nd column: |A| = a12C12 + a22C22 = 2·(-3) + 4·1 = -2
43
21A
Example 7.6: Calculate the determinant of matrix A.
Spring 2013
Expansion along the 1st row
|B| = 8·5 + 3·17 + 2·(-14) = 63.
Expansion along the 3rd column
315
746
238
B
037
032
165
C
.27733237
321C
Spring 2013
2.4 Basic Rules for Determinatns
Let A be an n n matrix. Then:
• If all the elements in a row (or column) of A are zero, then |A| = 0.
• If two of the rows (or columns) of A are proportional, then |A| = 0.
Spring 2013
Let A and B be n n matrices. Then:
• If all the elements in a single row (or column) of A are multiplied by a number , the determinant is multiplied by .
• The value of the determinant of A is unchanged if a multiple of one row (or column) is added to a different row (or column) of A.
• |AB| = |A||B|.
Spring 2013
3. Matrix Inversion
Let A be n by n. If there is a n by n matrix X such that
AX = XA = In,
then X is called the inverse of A and is denoted by A-1.
Spring 2013
Example 7.7: Consider the following three matrices:
5 6 1/2 -3/10 1 0A , X and B .
5 10 -1/4 1/4 0 0
Show that A and X are inverses of each other and B has no inverse.
Spring 2013
Step 1: Check the singularity of A
|A| 0 Carry on matrix inversion
|A| = 0 Stop
Step 2: Find the cofactor matrix of A
NNNN
N
N
CCC
CCC
CCC
C
21
22221
11211
3.1 Finding the Inverse of a Matrix
Spring 2013
Step 3: Find the adjoint of A
adj(A) = CT.
Step 4: Compute the inverse
A-1 = adj(A) / |A|.
Example 7.8: Find the inverse of
43
21A
Spring 2013
Step 1: |A| = 1x4 – 3x2 = -2 < 0
Step 2: M11 = 4, M12 = 3, M21 = 2, M22 = 1
C11 = 4, C12 = -3, C21 = -2, M22 = 1
12
34C
Step 3:
13
24TCAadj
Spring 2013
Step 4:
5051
12
13
24
2
11
..A
AadjA
Example 7.9: Show that the matrix A has an inverse and find the inverse.
421
134
432
A
Spring 2013
3.2 Solving Equations
Matrix equation
b
N
x
N
A
NNNN
N
N
b
b
b
x
x
x
aaa
aaa
aaa
2
1
2
1
21
22221
11211
Ax = b A-1Ax = A-1b
x = A-1b.
Spring 2013
Example 7.10: Solve the following simultaneous equations.
3x1 – 2x2 = 11
2x1 + x2 = 12
Matrix equation
bxA
x
x
12
11
12
23
2
1
1. |A| = 31 – 2(-2) = 7 > 0
Spring 2013
32
212 C .
32
213 Aadj .
7372
7271
32
21
7
14 1-A .
2
5
12
11
7372
7271*x
Spring 2013
4. Cramer’s Rule
Matrix equation
Let
b
N
x
N
A
NNNN
N
N
b
b
b
x
x
x
aaa
aaa
aaa
2
1
2
1
21
22221
11211
A 2 ,,
NNNNN
N
N
NNNN
N
N
aaba
aaba
aaba
aab
aab
aab
A
31
223221
113111
2
2222
1121
1
Spring 2013
Cramer’s rule: If |A| 0, then for i = 1,...,N,
In the previous example,
x1* = A1 / |A| = 35/7 = 5
x2* = A2 / |A| = 14/7 = 2
.*
A
Ax ii
14122
11335
112
2111
2A and A
Spring 2013
Example 7.11: Solve the following system for the unknowns x1, x2 and x3 using Cramer’s rule.
2x1 + 4x2 – x3 = 15
x1 – 3x2 + 2x3 = -5
6x1 + 5x2 + x3 = 28
Spring 2013
Example 7.12: Solve the following system of equations:
x1 + x2 = 3
x1 + x3 = 2
x2 + x3 + x4 = 6
x2 + x4 = 1
Spring 2013
3 Possible Cases of an Equation System
Case 1: Unique solution
|A| 0
b
N
x
N
A
NNNN
N
N
b
b
b
x
x
x
aaa
aaa
aaa
2
1
2
1
21
22221
11211
Spring 2013
Case 2: No solution
|A| = 0 and equations are inconsistent.
Case 3: Multiple solutions
|A| = 0 and equations are consistent.