VIETNAM NATIONAL UNIVERSITY-HCMC
International University
Chapter 1. Introduction to linear systems and matrices
Linear Algebra for FERM
Lecturer: Nguyen Minh Quan, PhD
[email protected]Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
1 / 102
Contents
1
Basic concepts
Linear systems of equations
Gaussian elimination and Gauss-Jordan elimination
Matrix Operations
Inverse matrices
The LU factorization
Applications: Leontief input-output Model
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
2 / 102
Introduction
Linear Algebra has become as basic and as applicable as calculus, and
fortunately it is easier. Gilbert Strang, MIT
The application of linear algebra to economics lies primarily in its use of
matrices. A matrix in economics is used to solve a large number of linear
equations at once, where the variables are economic indicators and factors.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
3 / 102
Introduction
Leontief, 1973 Nobel Prize in Economic Science, divided the U.S.
economy into 500 sectors, and analyzed a linear system of 500
equations in 500 unknowns.
Linear programming: Many important management decisions today
are made on the basis of linear programming models. The airline
industry, for instance, employs linear programs that schedule flight
crews, monitor the locations of aircraft,...
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
4 / 102
What is a Vector?
A vector, represented by an arrow, has both a direction and a
magnitude. Magnitude is shown as the length of a line segment.
Direction is shown by the orientation of the line segment, and by an
arrow at one end.
Equal vectors have the same length and direction but may have
different starting points.
Examples of vectors in nature are velocity, force, electromagnetic
fields,...
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
5 / 102
What is a Vector?
Consider the figure below:
Each of the directed line segments in the sketch represents the same
vector. In each case the vector starts at a specific point then moves 2
units to the left and 5 units up.
Notation: ~v = h2, 5i or ~v = (2, 5).
Be careful to distinguish vector notation ~v = (2, 5) from the notation we
use to represent coordinates of points, A(2, 5) .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
6 / 102
Vectors
Given the two points A(a1 , a2 ) and B(b1 , b2 ), the vector with the
~ is AB
~ = (b1 a1 , b2 a2 ).
representation AB
The magnitude, or length, of the vector ~v = (a, b) is given by,
p
k~v k = a2 + b 2
Example, if ~v = (3, 5) then its magnitude
k~v k = 9 + 16 = 5
Any vector with magnitude of 1 is called a unit vector, e.g.,
~v1 = (0, 1), or ~v2 = (1, 0) (standard basis vectors).
Zero Vector, ~0 = (0, 0), is a vector that has no magnitude or
direction.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
7 / 102
Linear systems of equations
We begin with the central problem of linear algebra: solving linear
equations.
Any straight line in the xy-plane can be represented algebraically by
an equation of the form
a1 x + a2 y = b
where a1 , a2 and b are real constants, a1 , a2 not both zero.
In general, a linear equation in the variables x1 , x2 , , xn is one that can
be put in the form
a1 x1 + a2 x2 + ... + an xn = b
where a1 , a2 , ..., an and b are real constants. The variables in a linear
equation are sometimes called unknowns.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
8 / 102
System of linear equations
Example
The director of a trust fund has $100.000 to invest. The rules of the trust
state that both a certificate of deposit (CD) and a long-term bond must
be used. The directors goal is to have the trust yield $7800 on its investments for the year. The CD chosen returns 5% per annum, and the bond
9%. Find the amounts that the director invest in the CD and in the bond.
Let x and y be the amount to invest in the CD and in the bond,
respectively. We have
x + y = 100, 000
0.05x + 0.09y = 7800
To eliminate x, we add (0.05) times the first equation to the second,
obtaining 0.04y = 2800, this implies y = 70, 000. Thus, x = 30, 000.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
9 / 102
System of linear equations (n=2)
We consider another example
1x + 2y = 3
(1)
4x + 5y = 6
(2)
The two unknowns are x and y.
How to solve? Elimination
Eq. (2) 4 Eq.(1): 3y = 6 y = 2.
Back-substitution x = 1.
This method is called Gaussian Elimination. It is good to solve large
systems of equations. We will consider in detail this method in this section.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
10 / 102
The Geometry of Linear Equations
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
11 / 102
The Geometry of Linear Equations
Understand this subject is by example:
2x y = 1
x +y =5
First approach: Each equations stands for a straight line. In column form
(2nd approach: vectors):
2
1
1
x
+y
=
1
1
5
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
12 / 102
Examples of system of linear equations (n=3)
Consider a system of n = 3 equations:
x + 2y + 3z = 6
2x 3y + 2z = 14
3x + y z = 2
To eliminate x, we add (2) times the first equation to the second one
and (3) times the first equation to the third one, obtaining a system of
two equations in the unknowns y and z
7y 4z = 2
5y 10z = 20
We multiply the second equation by 1/5, yielding
7y 4z = 2
y + 2z = 4
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
13 / 102
Examples of system of linear equations (n=3)
Interchanging equations
y + 2z = 4
7y 4z = 2
We now eliminate y by adding 7 times the first equation to the second
one, to obtain 10z = 30. Thus, z = 3. Substitute z = 3 into y + 2z = 4
to get y = 2. Finally, we find x = 1.
We observe further that our elimination procedure has actually produced
the linear system which is equivalent to the original one.
x + 2y + 3z = 6
y + 2z = 4
z =3
The importance of this procedure is that the later system is easier to solve!
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
14 / 102
The Geometry of Linear Equations
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
15 / 102
Column Vectors and Linear Combinations
Consider a system of n = 3 equations (3 planes):
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
16 / 102
The Geometry of Linear Equations
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
17 / 102
The method of elimination
The method of elimination involves three manipulations that can be
performed on a linear system to convert it into an equivalent system:
We need the concept of matrix to investigate the method of Gaussian
Elimination.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
18 / 102
What is a Matrix?
A matrix is a set of elements, organized into rows and columns
The number aij , 1 i m, 1 j n, are called the entries (or elements)
of A.
Matrix is like a function that transforms the vectors on a plane:
ax + by = e
a b
x
e
=
cx + dy = f
c d
y
f
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
19 / 102
Example of matrix
The following matrix gives the airline distance between the indicated cities
(in statute miles):
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
20 / 102
Example of matrix
Suppose that a manufacturer has four plants, each of which makes three
products. If we let aij denote the number of units of product i made by
plan j in one week, then the 3 4 matrix
gives the manufacturers production for the week. For example, plant 2
makes 270 units of product 3 in one week.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
21 / 102
Matrices
A matrix with m rows and n columns is called an m n matrix (m by n
matrix) or a matrix of order m n.
A matrix consisting of a single column is called a column vector and a
matrix consisting of a single row is called a row vector.
If m = n the matrix is called a square matrix. For example,
1 2 3
is a 2 by 3 matrix
4 5 6
1 2 3
3 5 1 is a (square) 3 by 3 matrix
7
0 9
Equality: Two matrices are said to be equal if they have the same order
and all the corresponding entries are equal.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
22 / 102
Linear systems of equations
We often deal with several linear equations at the same time:
a11 x1 + a12 x2 + ... + a1n xn = b1
a21 x1 + a22 x2 + ... + a2n xn = b2
..
.
am1 x1 + am2 x2 + ... + amn xn = bm
A system with at least one solution is called consistent. Otherwise, it is
called inconsistent.
Theorem: Every system of linear equations has zero, one or infinitely many
solutions; there are no other possibilities.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
23 / 102
Linear systems of equations
Matrix of coefficients is a matrix of m rows and n
a11 a12 a1n
a21 a22 a2n
A= .
..
..
..
..
.
.
.
columns:
am1 am2 amn
Augmented matrix is
A=
a11
a21
..
.
a12
a22
..
.
..
.
a1n b1
a2n b2
..
.
am1 am2 amn bm
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
24 / 102
Example
Consider the linear system of equations
x1 2x2 + x3 = 0
2x2 8x3 = 8
4x1 + 5x2 + 9x3 = 9
Matrix of Coefficients is
1 2 1
0
2 8
4 5
9
Augmented matrix is
1 2 1 0
0
2 5 8
4 5
9 9
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
25 / 102
Linear systems of equations
Motivation: Original augmented matrix much simpler augmented
matrix of an equivalent system!
For any augmented matrix of a system of equations, the following
operations produce the augmented matrix of an equivalent system:
1. Interchanging any two rows, denoted by: Iik .
2. Multiply a row by a nonzero constant: Ri .
3. Add a multiple of one row to another: Ri + Rk .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
26 / 102
Pivot-Matrix in Echelon Form
A pivot (leading entry) of a matrix is the first nonzero entry in a row. A
pivot column is a column of A that contains a pivot position.
Definition
A matrix is in (row) echelon form if
a. All rows that contain only zeros are grouped at the bottom of the
matrix
b. For each row that does not contain only zeros, the pivot appears
strictly to the right of the pivot of each row that appears above it
Intuitively, a matrix is in row echelon
staircase pattern like
0
0 0
0 0 0 0
0 0 0 0
0 0 0 0
Nguyen Minh Quan (HCMIU-VNU)
form if it has the appearance of a
0
0
Chap 1 Linear systems and Matrices
Spring 2014
27 / 102
Matrix in Row Echelon Form
Example
The following matrices are in row echelon form
0 0 2 1 4
a)
0 0 0 0 1
1 3 2 7
b) 0 3 1 7
0 0 2 9
4 2 1 7 9 1
0 0 5 9 1 2
c)
0 0
0 8 3 5
0 0
0 0 0 0
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
28 / 102
Matrix in Row Echelon Form
Example
The following matrices are NOT in row echelon form
0 0 0 0 0
a)
0 0 0 0 1
1 3 2 7
b) 0 0 1 7
0 2 2 9
4 2 1 7 9 1
0 0 5 9 1 2
c)
0 0
0 8 3 5
0 0
0 7 1 0
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
29 / 102
Reduced Echelon Form
The leading entry in each nonzero row is 1.
Each leading 1 is the only non-zero
1 0 0
0 1 0
0 0 1
1 0 0
0 1 0
0 0 1
0 0 0
entry in its column.
29
16
1
0
0
0
1
Remark:
(1) If the reduced augmented matrix is in echelon form, the method is
called Gauss Elimination.
(2) If the reduced augmented matrix is in reduced echelon form, the
method is called Gauss-Jordan Elimination.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
30 / 102
Matrix in Row Echelon Form
Example
Suppose that the augmented matrix for a linear system has been reduced
to the given matrix in row echelon form and the variables are also given.
Solve the system.
2 1 3
5
0 3 2
17
0 0
5 10
Variables: x, y , z
Solution The first step is to find the associated linear system
2x + y 3z = 5
3y + 2z = 17
5z = 10
The system is in triangular form and we solve it by backward substitution:
5z = -10 leads to z = -2. Thus, y=-7, x=3.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
31 / 102
Matrix in Row Echelon Form
Example
Suppose that the augmented matrix for a linear system has been reduced
to the given matrix in row echelon form and the variables are also given.
Solve the system.
2 3 1 5 2
0 3 2 1 2
0 0 2 8 4
Variables: x, y , z, w
Solution The associated linear system is
2x + 3y z + 5w = 2
3y + 2z w = 2
2z 8w = 4
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
32 / 102
Matrix in Row Echelon Form
Solution (Cont.)
The variables x, y, and z corresponding to the pivots of the augmented
matrix are called leading variables (or dependent variables). The remaining
variables are called free variables (or independent variables).
The second step is to move the free variables to the right-hand side of the
equations
2x + 3y z = 2 5w
3y + 2z = 2 + w
2z = 4 + 8w
We let w = t, the system becomes in triangular form
2x + 3y z = 2 5t
3y + 2z = 2 + t
2z = 4 + 8t
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
33 / 102
Matrix in Row Echelon Form
Solution (Cont.)
It can be solved by backward substitution.
2z = 4 + 8t, thus, z = 2 4t
3y + 2(2 4t) = 2 + t
3y = 6 + 9t, y = 2 + 3t
2x + 3(2 + 3t) (2 4t) = 2 5t x = 3 9t
The solution is
(x, y , z, w ) = (3 9t, 2 + 3t, 2 4t, t), where t is any real number
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
34 / 102
Matrix in Row Echelon Form
Exercises
Reduce the matrix A below to echelon form.
0 3 6 4
9
1 2 1 3
1
A=
2 3 0
3 1
1
4
5 9 7
Hint
1 4
5
0 2
4
0 5 10
0 3 6
1
0
Echelon Form
0
0
Nguyen Minh Quan (HCMIU-VNU)
9 7
6 6
15 15
4
9
4
2
0
0
5 9 7
4 6 6
0 5 0
0 0
0
Chap 1 Linear systems and Matrices
Spring 2014
35 / 102
Gaussian elimination
Example
Solve the following system
2x y z = 3
6x + 6y + 5z = 3
4x + 4y + 7z = 3.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
36 / 102
Gaussian elimination
Example
Solve the following system
2x y z = 3
6x + 6y + 5z = 3
4x + 4y + 7z = 3.
First, find the augmented matrix
2 1 1 3
2 1 1 3
3R1 +R2 R2
6 6
5 3
2 6
0 3
2R1 +R3 R3
4
4
7
3
0 6
9 3
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
36 / 102
Gaussian elimination
2 1 1 3
2 1 1 3
2R +R3 R3
0 3
2 6
2 6 2
0 3
3
0 0
5 15
0 6
9
The matrix is now in row echelon form, so we find the associated system
2x y z = 3
3y + 2z = 6
5z = 15.
Thus, z = 3, then y = 4 and x = 2.
The solution is (x, y , z) = (2, 4, 3).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
37 / 102
Gaussian elimination
Example
Solve the following system with three equations and three unknowns:
2x + y + 5z = 1
x 3y + 6z = 2
3x + 5y + 4z = 0.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
38 / 102
Gaussian elimination
Example
Solve the following system with three equations and three unknowns:
2x + y + 5z = 1
x 3y + 6z = 2
3x + 5y + 4z = 0.
First, write down the augmented matrix
2 1 5 1
2
1
5
1/2R1 +R2 R2
1 3 6 2
0 7/2 7/2
3/2R1 +R3 R3
3 5 4 0
0 7/2 7/2
1
3/2
3/2
Nguyen Minh Quan (HCMIU-VNU)
Spring 2014
Chap 1 Linear systems and Matrices
38 / 102
Gaussian elimination
2
1
5 1
R +R3 R3
2
0 7/2 7/2 3/2
0
0
0 0
The last row gives us no information whatsoever. If we let z = t
arbitrarily, then y = t 3/7.
Substituting this into the first row, we get x = (1 y 5z)/2 = 5/7 3t.
Thus, this system has an infinite number of solutions parameterized by the
parameter t, i.e., for every value of t, there corresponds a solution to the
system.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
39 / 102
Gaussian elimination
Example
Solve the following system with three equations and four unknowns:
x 2y z w = 4
3x + y + z 2w = 11
x + 12y + 7z + w = 31.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
40 / 102
Gaussian elimination
Example
Solve the following system with three equations and four unknowns:
x 2y z w = 4
3x + y + z 2w = 11
x + 12y + 7z + w = 31.
1 2 1 1 4
1
3R +R2 R2
3 1
1 2 11 1
0
R1 +R3 R3
1 12 7
1 31
0
1 2 1 1
2R +R3 R3
4
1
2
0 7
0 0
0
0
2 1 1 4
7
4
1 23
14 8
2 35
4
23
11
The last equation can not be solved. So the system has no solutions.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
40 / 102
The Cost of Elimination
Q: How many separate arithmetical operations does elimination require,
for n equations in n unknowns?
Since all the steps are known, we should be able to predict the number of
operations.
Theorem
If n is at all large, a good estimate for the number of operations is 1/3n3 .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
41 / 102
The Cost of Elimination
Q: How many separate arithmetical operations does elimination require,
for n equations in n unknowns?
Since all the steps are known, we should be able to predict the number of
operations.
Theorem
If n is at all large, a good estimate for the number of operations is 1/3n3 .
Proof:
(1) Suppose we call each division, and each multiplication-subtraction, one
operation.
In column 1, takes n operations for every zero we achieve-one to find the
multiple, and the other to find the new entries along the row.
(2) There are n 1 rows underneath the first one, so the first stage of
elimination needs n(n 1) = n2 n operations.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
41 / 102
The Cost of Elimination
Proof (cont.):
(3) When the elimination is down to k equations, only k 2 k operations
are needed to clear out the column below the pivot.
(4) Altogether, the total number of operations is the sum of k 2 k over
all values of k from 1 to n.
n
X
k=1
n (n + 1) (2n + 1) n (n + 1)
k2 k =
6
2
=
n3 n
3
Therefore, a good estimate for the number of operations is 1/3n3 .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
42 / 102
Exercises: Gaussian elimination
Exercises
Solve the following system
2x + 5y z = 15
x y + 3z = 4
3x + 3y 5z = 2.
Answer: (x, y , z) = (1, 3, 2).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
43 / 102
Gauss-Jordan elimination
Gauss-Jordan method uses row operations to transform the augmented
matrix of a linear system of equations into one of the form from which the
solution can be immediately read.
For example, if we employ row operations of the augmented matrix A and
obtain the following
1 0 0 c1
Row operations
Row operations 0 1 0 c2
A ... . . .
.
.
.. .. . . .. ..
0 0 1 cn
Then, the solution is
x1 = c1 , x2 = c2 , ..., xn = cn
Recall: In Gauss-Jordan elimination, the reduced augmented matrix is in
reduced echelon form.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
44 / 102
Gauss-Jordan elimination
Example
Use Gauss-Jordan method to solve the system
2x1 3x2 + x3 = 2
x1 2x2 + 3x3 = 1
3x1 2x2 + 4x3 = 2
Solution:
The augmented matrix is given by
2 3 1 2
A = 1 2 3 1
3 2 4 2
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
45 / 102
Gauss-Jordan elimination
Solution (Cont.)
Employ row operations, we obtain
1 2 3 1
2 3 1 2
I12
2 3 1 2
A = 1 2 3 1
2
3 2 4 2
3 2 4
1 2 3 1
2R +R2 R2
1 5 4
1
0
3 2 4 2
1 2 3 1
3R +R3 R3
1
0 1 5 4
0 8 13 5
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
46 / 102
Gauss-Jordan elimination
Solution (Cont.)
1 0 7 7
2R +R1 R1
2
0 1 5 4
8R2 +R3 R3
0 0 27 27
7
1
0
7
1
R R3
27 3
0 1 5 4
0 0 1 1
1 0 0 0
5R +R2 R2
3
0 1 0 1
7R3 +R1 R1
0 0 1 1
Then, the solution is
x1 = 0, x2 = 1, x3 = 1
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
47 / 102
Gauss-Jordan elimination
Example
Use Gauss-Jordan method to solve the system
3x1 + 2x2 x3 = 3
x1 x2 + 2x3 = 4
2x1 + 3x2 x3 = 3
Hint:
3 2 1
1 1 2
2 3 1
3
1 0 0
Row Operations
4 0 1 0
3
0 0 1
1
1
2
The solution is
x1 = 1, x2 = 1, x3 = 2
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
48 / 102
Gaussian elimination and Gauss-Jordan method
Exercises
Solve the following system
x 2y + z = 0
2y 8z = 8
4x + 5y + 9z = 9
Answer: (x, y , z) = (29, 16, 3).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
49 / 102
Gaussian elimination and Gauss-Jordan method
Exercises
Solve the following system
2x + 8y z + w = 0
4x + 16y 3z w = 10
2x + 4y z + 3w = 6
6x + 2y + 5z + w = 3
Answer: (x, y , z, w ) = (3, 1/2, 4, 2).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
50 / 102
Gaussian elimination and Gauss-Jordan method
Exercises
1. Using Gaussian elimination method and Gauss-Jordan method to solve
the linear system
2x + 3y z = 7
x y +z =1
4x 5y + 2z = 3
2. A certain brand of razor blades comes in packages of 6, 12, and 24
blades, costing $2, $3, and $4 per package, respectively. A store sold 12
packages, containing a total of 162 razor blades and took in $35. How
many packages of each type were sold?
Answer: (x, y , z) = (5, 3, 4).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
51 / 102
Exercises
It is known that three brands of fertilizer (Fertifun, Big Grow and Soakem)
are available that provide Nitrogen, Phosphoric Acid and Soluble Potash to
the soil. One bag of each brand provides the following units of each
nutrient:
Nitrogen
Phosphoric Acid
Potash
Fertifun BigGrow Soakem
1 2 3
3 1 2
2 0 1
The soil of Dong Nai farm needs 18 units of nitrogen, 23 units of
phosphoric acid and 13 units of potash per acre. The corresponding units
for An Giang are 31, 24, and 11. How many bags of each brand of
fertilizer should be used per acre for each farm?
Hint: a. Dong Nai: (x, y , z) = (5, 2, 3).
b. An Giang: (x, y , z) = (2, 4, 7).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
52 / 102
Product of two vectors
Product of a row matrixand a column matrix of the same dimension: Let
A = a1 a2 an and B = ( b1 b2 bn )T . The product
AB is the 1 1 matrix whose entry is
Xn
a1 b1 + a2 b2 + ... + an bn =
ai b i
1
i.e., it is the dot product of the row vector A and the column vector B.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
53 / 102
Product of two vectors
Product of a row matrixand a column matrix of the same dimension: Let
A = a1 a2 an and B = ( b1 b2 bn )T . The product
AB is the 1 1 matrix whose entry is
Xn
a1 b1 + a2 b2 + ... + an bn =
ai b i
1
i.e., it is the dot product of the row vector A and the column vector B.
Example
If
u = (3, 6, 2) , v = (4, 2, 4) ,
then
u v = 3 4 + 6 2 + 2 4 = 32
u u = 3 3 + 6 6 + 2 2 = 49 = kuk2
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
53 / 102
Basic Matrix Operations
Addition, Subtraction, Multiplication: creating new matrices.
a. Addition: Just add elements
a b
e
+
c d
g
a+e
c +g
b+f
d +h
b. Subtraction: Just subtract elements
a b
e f
ae
=
c d
g h
c g
bf
d h
f
h
=
Generally, if both matrices A and B are of the
a11 b11 a12 b12
a21 b21 a22 b22
AB =
..
..
.
.
same size, then
..
.
a1n b1n
a2n b2n
..
.
am1 bm1 am2 bm2 amn bmn
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
54 / 102
Basic Matrix Operations
c. Scalar Multiplication
2 3
10 15
5 4 1 = 20 5
1/5 6
1
30
A = A =
a11
a21
..
.
a12
a22
..
.
..
.
a1n
a2n
..
.
am1 am2 amn
d. Multiplication: Multiply each row by each column
a b
e f
ae + bg af + bh
=
c d
g h
ce + dg cf + dh
Is AB = BA? Maybe, but maybe not! In general, multiplication is NOT
commutative!
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
55 / 102
Matrix Multiplication
The product AB of two matrices A and B is defined if and only if the
number of columns of A is equal to the number of rows of B.
(A)mn (B)np = (AB)mp
Furthermore, the entry in the i-th row and j-th column of AB is given by
the dot product of the i-th row of A and the j-th column of B. That is,
If A = (aij )mn , B = (bij )np , then AB = C = (cij )mp where
cij = ai1 b1j + ai2 b2j + + ain bnj , i.e.,
!
n
X
AB =
aik bkj
k=1
Nguyen Minh Quan (HCMIU-VNU)
mp
Chap 1 Linear systems and Matrices
Spring 2014
56 / 102
Scalar Multiplication
Example
Let
18.95
p = 14.75
8.60
be a 3-vector that represents the current prices of three items at a store.
Suppose that the store announces a sale so that the price of each item is
reduced by 20%.
(a) Determine a 3-vector that gives the price changes for the three items.
(b) Determine a 3-vector that gives the new prices of the items.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
57 / 102
Scalar Multiplication
Solution
(a) Since each item is reduced by 20%, the 3-vector
(0.20) (18.95)
3.79
(0.20) p = (0.20) (14.75) = 2.95
(0.20) (8.60)
1.72
gives the price changes for the three items.
(b) The new prices of the items are given by the expression
18.95
3.79
15.16
p 0.20p = 14.75 2.95 = 11.80
8.60
1.72
6.88
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
58 / 102
Examples: Matrix Multiplication
Example
5 2 3
2
1 = 10 2 12 = 4.
4
Example
2 3 1
1 2 4
Nguyen Minh Quan (HCMIU-VNU)
5 3
4 0 = 25 7
15 1
3 1
Chap 1 Linear systems and Matrices
Spring 2014
59 / 102
Examples: Matrix Multiplication
Example
If A =
3 4 1
2 0 1
then
AB =
1 1 2
3
, B = 1 2
2
3 1
1 8 17
0 5 5
Example
Let
A=
1 x 3
2 1 1
2
and B = 4
y
12
If AB =
, find x and y .
6
Answer: x = 2, y = 6.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
60 / 102
Examples: Matrix Multiplication
Last month, Nguyen bought 3 pencils, 3 notebooks, and 1 eraser. This
month, he bought 3 pencils, 2 notebooks, and 5 erasers. The prices at IU
are $2, $5 and $1 respectively. Hence
QUANTITY PRICE = COST
Nguyen Minh Quan (HCMIU-VNU)
3 3 1
3 2 5
2
5 = 22
21
1
Chap 1 Linear systems and Matrices
Spring 2014
61 / 102
Exercise
Multiply
2 1 3
4 7 8
4
6 ,B = 9 3
5
A= 0
6 10 5
1 1 2
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
62 / 102
Exercises
A store brand X and brand Y dishwashers. The following matrices give the
sales figures and costs of these items for three months. Use matrix
multiplication to determine the total dollar sales and total costs of these
items for the three months.
Brand X
Brand Y
Dec. Apr . Aug .
18 10 12
,
19 12 14
Nguyen Minh Quan (HCMIU-VNU)
Retail Price
Dealer Cost
Chap 1 Linear systems and Matrices
X Y
350 260
240 190
Spring 2014
63 / 102
Properties of Matrix Addition
Theorem
Let A, B, and C be m n matrices.
(a) A + B = B + A.
(b) A + (B + C ) = (A + B) + C .
(c) There is a unique m n matrix O such that A + O = A, for any m n
matrix A. The matrix O is called the m n zero matrix
(d) For each m n matrix A, there is a unique m n matrix D such that
A + D = O, where O is the m n zero matrix.
We will write D as A.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
64 / 102
Properties of Matrix Addition
Theorem
Let A, B, and C be m n matrices.
(a) A + B = B + A.
(b) A + (B + C ) = (A + B) + C .
(c) There is a unique m n matrix O such that A + O = A, for any m n
matrix A. The matrix O is called the m n zero matrix
(d) For each m n matrix A, there is a unique m n matrix D such that
A + D = O, where O is the m n zero matrix.
We will write D as A.
Proof:
(a) Let A = [aij ], B = [bij ], A + B = C = [cij ], and B + A = D = [dij ].
By the definition of matrix addition, we have cij = aij + bij and
dij = bij + aij . Since aij and bij are real numbers, we get
aij + bij = bij + aij , which implies cij = dij for all i, j.
Thus, C = D, or A + B = B + A.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
64 / 102
Properties of Matrix Multiplication
Theorem
If A, B, and C are matrices of the appropriate sizes then
(a) A(BC ) = (AB)C .
(b) (A + B)C = AC + BC .
(c) C (A + B) = CA + CB.
Proof:
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
65 / 102
Properties of Scalar Multiplication
Theorem
If r and s are real numbers and A, B, and C are matrices of the
appropriate sizes then
(a) r (sA) = (rs)A
(b) (r + s)A = rA + sA
(c) r (A + B) = rA + rB
(d) A(rB) = r (AB) = (rA)B.
Proof:
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
66 / 102
Example: (AB)T = B T AT
0 1
1 3 2
A=
,B = 2 2
2 1 3
3 1
12 5
12 7
T
AB =
, (AB) =
7 3
5 3
On the other hand,
1 2
0 2 3
T
T
A = 3 1 , B =
1 2 1
2 3
T
B A =
Nguyen Minh Quan (HCMIU-VNU)
12 7
5 3
= (AB)T
Chap 1 Linear systems and Matrices
Spring 2014
67 / 102
Remark
Remark: If a, b, and c are real numbers for which ab = ac and a 6= 0 it
follows that b = c. That is, we can cancel out the nonzero factor a.
However, the cancellation law does NOT hold for matrices, as the
following example shows.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
68 / 102
Remark
Remark: If a, b, and c are real numbers for which ab = ac and a 6= 0 it
follows that b = c. That is, we can cancel out the nonzero factor a.
However, the cancellation law does NOT hold for matrices, as the
following example shows.
Let
A=
1 2
2 4
,B =
2 1
3 2
, and C =
AB = AC =
8 5
16 10
2 7
5 1
but B 6= C .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
68 / 102
Remark
Remark: We also note two other peculiarities of matrix multiplication. If a
and b are real numbers, then ab = 0 can hold only if a or b is zero.
However, this is not true for matrices.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
69 / 102
Remark
Remark: We also note two other peculiarities of matrix multiplication. If a
and b are real numbers, then ab = 0 can hold only if a or b is zero.
However, this is not true for matrices.
Let
A=
1 2
2 4
, and B =
but
AB =
Nguyen Minh Quan (HCMIU-VNU)
0 0
0 0
4 6
2 3
Chap 1 Linear systems and Matrices
Spring 2014
69 / 102
Special Types of Matrices
An n n matrix A = [aij ] is called a diagonal
i 6= j.
a11 0
.
0 a22 0 ..
..
..
.
.
0
0
0
0
ann
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
matrix if aij = 0 for
Spring 2014
70 / 102
Special Types of Matrices
An n n matrix A = [aij ] is called a diagonal
i 6= j.
a11 0
.
0 a22 0 ..
..
..
.
.
0
0
0
0
ann
matrix if aij = 0 for
An n n diagonal matrix whose entries on the diagonal are all 1 is
called an identity matrix (or a unit matrix). It is denoted by In or
simply I .
1 0 0
I3 = 0 1 0
0 0 1
It is easy to show that In A = AIn for any square n n matrix A.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
70 / 102
Special Types of Matrices
An n n matrix A = [aij ] is called a diagonal
i 6= j.
a11 0
.
0 a22 0 ..
..
..
.
.
0
0
0
0
ann
matrix if aij = 0 for
An n n diagonal matrix whose entries on the diagonal are all 1 is
called an identity matrix (or a unit matrix). It is denoted by In or
simply I .
1 0 0
I3 = 0 1 0
0 0 1
It is easy to show that In A = AIn for any square n n matrix A.
A scalar matrix is a diagonal matrix whose diagonal elements are
equal.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
70 / 102
Special Types of Matrices
Suppose that A is a square matrix. The powers of a matrix, Ap , for p
a positive integer, is defined by
Ap = A.A...A
(p factors)
We also define A0 by the n n identity matrix, In .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
71 / 102
Special Types of Matrices
Suppose that A is a square matrix. The powers of a matrix, Ap , for p
a positive integer, is defined by
Ap = A.A...A
(p factors)
We also define A0 by the n n identity matrix, In .
An n n matrix A = [aij ] is called
Example
1
A= 0
0
Nguyen Minh Quan (HCMIU-VNU)
upper triangular if aij = 0 for i > j.
7 5
2 1
0 2
Chap 1 Linear systems and Matrices
Spring 2014
71 / 102
Special Types of Matrices
Suppose that A is a square matrix. The powers of a matrix, Ap , for p
a positive integer, is defined by
Ap = A.A...A
(p factors)
We also define A0 by the n n identity matrix, In .
An n n matrix A = [aij ] is called
Example
1
A= 0
0
upper triangular if aij = 0 for i > j.
7 5
2 1
0 2
An n n matrix A = [aij ] is called lower
Example:
1 0
B = 1 2
2 4
Nguyen Minh Quan (HCMIU-VNU)
triangular if aij = 0 for i < j.
0
0
2
Chap 1 Linear systems and Matrices
Spring 2014
71 / 102
Transpose, Symmetric
The transpose of an m n matrix A = [aij ], denoted by AT is
obtained by interchanging the rows and columns of A, i.e.
[aij ]T = [aji ]
Example: Let
A=
1 2 3
4 8 7
1 4
AT = 2 8
3 7
A matrix A is symmetric if AT = A.
1
A = 1
4
Nguyen Minh Quan (HCMIU-VNU)
Example:
1 4
0 2
2 6
Chap 1 Linear systems and Matrices
Spring 2014
72 / 102
Properties of Transpose
Theorem
If r and s are real numbers and A, B, and C are matrices of the
appropriate sizes then
(a) (AT )T = A
(b) (A + B)T = AT + B T
(c) (AB)T = B T AT
(d) (rA)T = r (AT ).
Proof:
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
73 / 102
Skew Symmetric
A matrix A with real entries is called
Example:
0
A = 2
3
skew symmetric if AT = A.
2 3
0 0
4 0
Remark:
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
74 / 102
Skew Symmetric
A matrix A with real entries is called
Example:
0
A = 2
3
skew symmetric if AT = A.
2 3
0 0
4 0
Remark:
If A is symmetric or skew symmetric, then A is a square matrix
(Why?).
If A is a symmetric matrix, then the entries of A are symmetric with
respect to the main diagonal of A.
A is symmetric if and only if aij = aji , and A is skew symmetric if and
only if aij = aji .
If A is an n n matrix, then we can show that A = S + K , where S is
symmetric and K is skew symmetric (Exercise).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
74 / 102
Diagonal
Let A be a square, n n, matrix. Then its (principal) diagonal
consists of the entries a11 , a22 , ..., ann .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
75 / 102
Remark on representing linear systems via matrices
Consider the linear system of m equations in n unknowns,
a11 x1 + a12 x2 + ... + a1n xn = b1
a21 x1 + a22 x2 + ... + a2n xn = b2
..
.
am1 x1 + am2 x2 + ... + amn xn = bm
Then the linear system can be re-written as AX = b, where
a11 a12 a1n
a21 a22 a2n
T
T
A= .
.. , X = (x1 , x2 , ..., xn ) and b = (b1 , b2 , ..., bn )
..
.
.
.
.
.
.
.
am1 am2 amn
Q: Can we find X as X = A1 b? And what is A1 ?
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
76 / 102
Inverse of a Matrix
Definition
Let A be an n n matrix. A matrix B is said to be the inverse of A if
AB = BA = In ,
where In is the n n identity matrix. In this case, we denote B by A1 .
And A is said to be invertible or nonsinglar.
Example
1 2
3 4
Thus,
1 2
3 4
2
1
3/2 1/2
1
=
Nguyen Minh Quan (HCMIU-VNU)
=
2
1
3/2 1/2
2
1
3/2 1/2
1 2
3 4
=
1 0
0 1
1
2
1
1 2
,
=
3/2 1/2
3 4
Chap 1 Linear systems and Matrices
Spring 2014
77 / 102
Inverse of a Matrix
If AB = In , then BA = In (why?).
Thus, to verify that B is an inverse of A, we need verify only that
AB = In .
Theorem
The inverse of a matrix, if it exists, is unique.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
78 / 102
Inverse of a Matrix
If AB = In , then BA = In (why?).
Thus, to verify that B is an inverse of A, we need verify only that
AB = In .
Theorem
The inverse of a matrix, if it exists, is unique.
Proof: Let B and C be inverses of A. Then AB = BA = In and
AC = CA = In . We then have
B = BIn = B(AC ) = (BA)C = In C = C ,
which proves that the inverse of a matrix, if it exists, is unique.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
78 / 102
Inverse of a Matrix
Theorem
If A and B are both nonsingular n n matrices, then AB is nonsingular and
(AB)1 = B 1 A1
Proof:...
Hint: Show that (AB)(B 1 A1 ) = In and (B 1 A1 )(AB) = In .
Corollary
If A1 , A2 ,..., and Ak are nonsingular n n matrices, then A1 A2 ...Ak is
nonsingular and
1
1
(A1 A2 ...Ak )1 = A1
k Ak1 ...A1
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
79 / 102
Inverse of a Matrix
Theorem
If A is a nonsingular matrix, then A1 is nonsingular and (A1 )1 = A.
Hint: Show that (A1 )A = A(A1 ) = In !
Theorem
If A is a nonsingular matrix, then AT is nonsingular and
(A1 )T = (AT )1
Proof: Taking transposes of the equation AA1 = In both sides, we get
A1
Similarly, AT A1
inverse of AT
T
AT = InT = In
T
= (A1 A)T = In . These equation implies that the
T
is A1 .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
80 / 102
Inverse of a Matrix
Note: If A is nonsingular. Then AB = AC implies that B = C (Exercise).
Theorem
Let
A=
a b
c d
If ad bc 6= 0 then A is nonsingular and
1
d b
1
A =
ad bc c a
Example
3 4
5 6
3
2
5/2 3/2
A=
1
A
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
81 / 102
An algorithm for finding A1
Theorem
An n n matrix A is invertible if and only if A is row equivalent to In , and
in this case, any sequence of elementary row operations that reduces A to
In also transforms In to A.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
82 / 102
An algorithm for finding A1
To obtain A1 for any n n invertible matrix A, follow these steps
Algorithm for finding A1
1. Form the matrix [A I ], where I is the identity matrix.
2. Perform row operations on [A I ] to get a matrix of the form [I B].
3. Matrix B is A1 .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
83 / 102
Finding A1
Example
Find the inverse of the matrix
1 3 3
A= 1 4 3
2 6 7
Solution: Step 1: We form the matrix
1 3
[A|I ] = 1 4
2 6
Nguyen Minh Quan (HCMIU-VNU)
[A|I ]
3
3
7
as
1 0 0
0 1 0
0 0 1
Chap 1 Linear systems and Matrices
Spring 2014
84 / 102
Solution (Cont.)
Step 2: Using Row Operations on [A|I ]
1 3 3
1 3 3 1 0 0
R2 R1 R2
0 1 0
1 4 3 0 1 0
[A|I ] =
R3 2R1 R3
0 0 1
2 6 7 0 0 1
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
1 0 0
1 1 0
2 0 1
Spring 2014
85 / 102
Solution (Cont.)
Step 2: Using Row Operations on [A|I ]
1 3 3
1 3 3 1 0 0
R2 R1 R2
0 1 0
1 4 3 0 1 0
[A|I ] =
R3 2R1 R3
0 0 1
2 6 7 0 0 1
1 0 0
1 1 0
2 0 1
1 0 3 4 3 0
R 3R2 R1
1
0 1 0 1 1 0
0 0 1 2 0 1
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
85 / 102
Solution (Cont.)
Step 2: Using Row Operations on [A|I ]
1 3 3
1 3 3 1 0 0
R2 R1 R2
0 1 0
1 4 3 0 1 0
[A|I ] =
R3 2R1 R3
0 0 1
2 6 7 0 0 1
1 0 3 4
R 3R2 R1
1
0 1 0 1
0 0 1 2
1 0 0 10 3
R 3R3 R1
1
0 1 0 1 1
0 0 1 2 0
Nguyen Minh Quan (HCMIU-VNU)
1 0 0
1 1 0
2 0 1
3 0
1 0
0 1
3
0 = [I |A1 ]
1
Chap 1 Linear systems and Matrices
Spring 2014
85 / 102
Solution (Cont.)
Step 2: Using Row Operations on [A|I ]
1 3 3
1 3 3 1 0 0
R2 R1 R2
0 1 0
1 4 3 0 1 0
[A|I ] =
R3 2R1 R3
0 0 1
2 6 7 0 0 1
1 0 3 4
R 3R2 R1
1
0 1 0 1
0 0 1 2
1 0 0 10 3
R 3R3 R1
1
0 1 0 1 1
0 0 1 2 0
1 0 0
1 1 0
2 0 1
3 0
1 0
0 1
3
0 = [I |A1 ]
1
Step 3: Conclusion
A1
Nguyen Minh Quan (HCMIU-VNU)
10 3 3
0
= 1 1
2 0
1
Chap 1 Linear systems and Matrices
Spring 2014
85 / 102
An algorithm for finding A1
Example
Find the inverse of the matrix
0 1 2
A = 1 0 3 ,
4 3 8
if it exists.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
86 / 102
An algorithm for finding A1
Example (Cont.)
Since A I , A is nonsingular and
9/2 7 3/2
4
1
A1 = 2
3/2 2 1/2
Check: AA1 = I3 (?).
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
87 / 102
An algorithm for finding A1
Example
1 2 1
6 ,
Find the inverse of the matrix A = 1 5
5 4 5
if it exists.
So [A I ] is row equivalent to a matrix of the form [B D], where B has a
row of zeros. Further row operations will not transform B into I . Thus, A
does NOT have the inverse.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
88 / 102
An algorithm for finding A1
Theorem
If A is an invertible (nonsingular) n n matrix , then for each b in Rn , the
equation Ax = b has the unique solution x = A1 b.
Example
Solve the system
3x1 + 4x2 = 3
5x1 + 6x2 = 7
This system is equivalent to Ax = b, where A =
1
x =A
Nguyen Minh Quan (HCMIU-VNU)
b=
3
2
5/2 3/2
3
7
Chap 1 Linear systems and Matrices
3 4
, so
5 6
=
5
3
Spring 2014
89 / 102
The LU factorization
The LU factorization described below is motivated by the fairly common
industrial and business problem of solving a sequence of equations, all with
the same coefficient m n matrix A:
Ax = b1 , Ax = b2 , ..., Ax = bk
When A is invertible, one could find A1 then compute A1 b1 ,
A1 b2 ,...,A1 bk .
However it is more efficient when apply LU factorization, by re-write A in
the form A = LU, where L is an m m lower triangular matrix with 1s on
the diagonal, and U is an m n echelon form of A.
The matrix L is invertible and is called a unit lower triangular matrix.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
90 / 102
The LU factorization
Example of an LU factorization
Why they are so useful? We have
Ax = b LUx = b
Ly = b
Ux = y
We thus can solve x by solving the pairs of equations
Ly = b
Ux = y
First solve Ly = b for y , and then solve Ux = y for x.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
91 / 102
The LU factorization
An LU Factorization Algorithm
1. Reduce A to an echelon form U by a sequence of row replacement
operations, if possible.
2. Place entries in L such that the same sequence of row operations
reduces L to I .
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
92 / 102
The LU factorization
Example
Find an LU factorization of
2
4 1 5 2
4 5 3 8 1
A=
2 5 4 1
8
6 0
7 3 1
Solution:
The first column of L is the divided by the top pivot entry:
1 0 0 0
2 1 0 0
L=
1
1 0
3
1
Compare the first columns of A and L. The row operations that create
zeros in the first column of A will also create zeros in the first column of L.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
93 / 102
The LU factorization
Solution (Cont.)
To make this same correspondence of row operations on A hold for the
rest of L, watch a row reduction of A to an echelon form U.
The highlighted entries above determine the row reduction of A to U. At
each pivot column, divide the highlighted entries by the pivot and place
the result into L.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
94 / 102
The LU factorization
Solution (Cont.)
An easy calculation verifies that this L and U satisfy LU = A.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
95 / 102
The LU factorization
Example
Use the LU factorization to solve Ax = b, where
3 7 2 2
3 5
1
0
A=
6 4 0 5
9 5 5 12
and
Nguyen Minh Quan (HCMIU-VNU)
9
5
b=
7
11
Chap 1 Linear systems and Matrices
Spring 2014
96 / 102
The LU factorization
Hint
1
0 0
1 1 0
L=
2 5 1
3 8 3
0
3 7 2 2
0
0 2 1 2
,U =
0 0 1 1
0
1
0 0
0 1
Solve Ly = b for y :
Solve Ux = y for x:
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
97 / 102
Leontief input-output Model
Wassily Leontief (Nobel Prize in Economics in 1973) conducted a
monumental input-output analysis of the United States economy in the
1930s.
Assumptions:
Suppose the nations economy is divided into many sectors, such as
service industries, manufacturing, communication, and entertainment.
Suppose that for each sector we know its total output for one year
and we know exactly how this output is divided or exchanged among
the sectors of the economy.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
98 / 102
Leontief input-output Model
E.g., the 2nd column says that the total output of Electric is divided as
follows: 40% to Coal, 50% to Steel, and the remaining 10% to Electric.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
99 / 102
Leontief input-output Model
How much should each industry sector produce (output) in order to meet
demand for their commodities (so called equilibrium prices)?
Solution Denote the prices (in US dollars) of the total annual output of
Coal, Electric, and Steel sectors by x, y, and z, respectively. We want to
find x, y, z such that
x = 0.4y + 0.6z
y = 0.6x + 0.1y + 0.2z
z = 0.4x + 0.5y + 0.2z
That is,
0 0.4 0.6
x
x
0.6 0.1 0.2 y = y
0.4 0.5 0.2
z
z
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
100 / 102
Leontief input-output Model
Solution (cont.)
x 0.4y + 0.6z = 0
0.6x 0.9y 0.2z = 0
0.4x 0.5y + 0.8z = 0
The general solution is x = 0.94z, y = 0.85z, and z is free. Thus, the
equilibrium prices vector has the form (x, y , z)T = z(0.94, 0.85, 1)T for
any nonnegative z.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
101 / 102
Exercises (B. Kolman-D. Hill)
Section 1.1: 1-4, 16, 17, 18, 30, 32
Section 1.2: 1, 2, 4, 6, 9, 18, 20.
Section 1.3: 2, 3, 12, 15, 30, 31, 48, 49, 50.
Section 1.4: 13, 14, 16, 18, 26, 27, 37.
Section 1.5: 8, 12, 22, 35, 38, 48, 50.
Section 2.1: 11, 12.
Section 2.2: 5-8, 14, 15.
Nguyen Minh Quan (HCMIU-VNU)
Chap 1 Linear systems and Matrices
Spring 2014
102 / 102