Professional Documents
Culture Documents
1 - Linear Systems, Matrices
1 - Linear Systems, Matrices
Nguyễn Anh Tú
natu@hcmiu.edu.vn
Contents
1 Introduction
3 Gaussian elimination
4 Matrix Operations
5 Inverse matrices
Section 1
Introduction
Introduction
Linear Algebra is a mathematical branch of foundational
importance.
Introduction
Linear Algebra is a mathematical branch of foundational
importance.
Method:
• Elimination: Substract 4 × Eq.(1) from Eq. (2) to get
−3y = −6 → y = 2.
System of linear equations (n=2)
A central problem of linear algebra is solving linear equations.
Example: Solve (
1x + 2y = 3
4x + 5y = 6
Here, the two unknowns that we need to find are x and y .
Method:
• Elimination: Substract 4 × Eq.(1) from Eq. (2) to get
−3y = −6 → y = 2.
• Back-substitution: Put this value of y into the first
equation to find x = −1.
System of linear equations (n=2)
A central problem of linear algebra is solving linear equations.
Example: Solve (
1x + 2y = 3
4x + 5y = 6
Here, the two unknowns that we need to find are x and y .
Method:
• Elimination: Substract 4 × Eq.(1) from Eq. (2) to get
−3y = −6 → y = 2.
• Back-substitution: Put this value of y into the first
equation to find x = −1.
Gaussian elimination
Gaussian elimination
Variables: x, y , z
Solution The first step is to find the associated linear system
2x + y − 3z = 5
− 3y + 2z = 17
5z = −10
where d can take any value. Thus, this system has infinitely
many solutions.
Reduction to Row Echelon Form
The main step of row reduction consists of three sub-steps:
1 Find the leftmost non-zero column of the matrix.
2 If necessary, apply a row exchange so that the top entry
of this column is non-zero. This entry will be the pivot of
the first row.
3 “Kill” (i.e. make them 0) all non-zero entries below the
pivot by adding (subtracting) an appropriate multiple of
the first row from the rows below.
After applying the main step, we leave the first row alone, and
apply the main step to the matrix consisting of rows 2, . . . ,
m.
Then we leave the first two rows alone, and apply the main
step to the matrix consisting of rows 3, . . . , m.
Continuing in this fashion, after at most m applications of the
main step, the matrix will be in echelon form.
Reduction to Row Echelon Form
x + 4y − 4z = 3
3y + 2z = 7
26z = 13
2 −1 −1 3 2 −1 −1 3
R2 +3R1
-6 6 5 −3 −−−−→ 0 3 2 6
R3 −2R1
4 4 7 3 0 6 9 −3
Examples
2 −1 −1 3 2 −1 −1 3
R3 −2R2
0 3 2 6 −−−−→ 0 3 2 6
0 6 9 −3 0 0 5 −15
Example
Solve the following system
3y + 2z = 7
x + 4y − 4z = 3
3x + 3y + 8z = 1
Examples
Example
Solve the following system
3y + 2z = 7
x + 4y − 4z = 3
3x + 3y + 8z = 1
Hint
0 3 2 7 1 4 −4 3
I12 ;R3 −3R1 0 3 2 7
1 4 −4 3 −−−−−−→
R3 +3R2
3 3 8 1 0 0 26 13
Examples
Example
Solve the following system with three equations and three
unknowns:
2x + y + 5z = 1
x − 3y + 6z = 2
3x + 5y + 4z = 0
Examples
Example
Solve the following system with three equations and three
unknowns:
2x + y + 5z = 1
x − 3y + 6z = 2
3x + 5y + 4z = 0
1 −2 −1 −1 −4 1 −2 −1 −1 −4
R2 −3R1
3 1 1 −2 11 −−−−→ 0 7
4 1 23
R3 −R1
1 12 7 1 31 0 14 8 2 35
1 −2 −1 −1 −4
R3 −2R2
−− −−→ 0 7 4 1 23 → No solution!
0 0 0 0 −11
Examples
Example
Solve the following system of four equations and five
unknowns:
x + 2y + w + 3t = 1
− z +w
=2
2x + 4y + z + w + 7t = 1
3x + 6y + 2z + w + 9t = −1
Examples
Example
Solve the following system of four equations and five
unknowns:
x + 2y + w + 3t = 1
− z +w
=2
2x + 4y + z + w + 7t = 1
3x + 6y + 2z + w + 9t = −1
2x + 8y − z + w = 0
+ 16y − 3z − w = −10
4x
−2x + 4y − z + 3w = −6
−6x + 2y + 5z + w = 3
Exercises
2x + 8y − z + w = 0
+ 16y − 3z − w = −10
4x
−2x + 4y − z + 3w = −6
−6x + 2y + 5z + w = 3
x1 − x2 + x3 =0
−x1 + x2 − x3 =0
10x2 + 25x3 = 90
20x1 + 10x2 = 80
Theorem
To solve an n × n system by Gaussian elemination, we need at
1
most n(4n2 + 9n − 7) operations.
6
We say the computational complexity of Gaussian elimination
is O(n3 ). Best known algorithm to solve n × n system has
complexity O(n2.332 ).
Section 4
Matrix Operations
Special Matrices
• Let A be a square, n × n, matrix. Then its (principal)
diagonal consists of the entries a11 , a22 , ..., ann .
a11 a12 · · · a1n
a21 a22 · · · a2n
A = .. .. . . ..
. . . .
an1 an2 · · · ann
Special Matrices
• Let A be a square, n × n, matrix. Then its (principal)
diagonal consists of the entries a11 , a22 , ..., ann .
a11 a12 · · · a1n
a21 a22 · · · a2n
A = .. .. . . ..
. . . .
an1 an2 · · · ann
a11 0 · · · 0
.
0 a22 · · · ..
. ..
..
0 . 0
0 · · · 0 ann
Special Matrices
Then
a11 ± b11 a12 ± b12 ··· a1n ± b1n
a21 ± b21 a22 ± b22 ··· a2n ± b2n
A±B = .. .. ..
...
. . .
am1 ± bm1 am2 ± bm2 · · · amn ± bmn
Basic Matrix Operations
b. Scalar multiplication:
αa11 αa12 · · · αa1n
αa21 αa22 · · · αa2n
αA = .. .. ..
. ...
. .
αam1 αam2 · · · αamn
In particular, we denote
−A = (−1) · A.
Theorem
Let A, B, and C be m × n matrices.
(a) A + B = B + A.
(b) A + (B + C ) = (A + B) + C .
(c) Let O be the zero matrix of the same size with A. Then
A + O = A.
Some Properties
Theorem
Let A, B, and C be m × n matrices.
(a) A + B = B + A.
(b) A + (B + C ) = (A + B) + C .
(c) Let O be the zero matrix of the same size with A. Then
A + O = A.
Theorem
If r and s are real numbers then
(a) r (sA) = (rs)A
(b) (r + s)A = rA + sA
(c) r (A + B) = rA + rB if A, B ∈ Mm×n ,
(d) A(rB) = r (AB) = (rA)B if A ∈ Mm×n and B ∈ Mn×p .
Multiplication of Matrices
for 1 ≤ i ≤ m and 1 ≤ j ≤ p.
Multiplication of Matrices
for 1 ≤ i ≤ m and 1 ≤ j ≤ p.
• For k ∈ N, the k-th power of an n × n matrix A is defined
by
Ak = A · A · · · A (k factors.)
We also define A0 = In .
Examples
2
5 2 3 −1 = 10 − 2 − 12 = −4.
−4
5 3
2 3 1 25 7
4 0 =
−1 2 4 15 1
3 1
Properties of Matrix Multiplication
(a) A(BC ) = (AB)C if A ∈ Mm×n , B ∈ Mn×p and C ∈ Mp×q .
(b) (A + B)C = AC + BC if A, B ∈ Mm×n and C ∈ Mn×p .
(c) C (A + B) = CA + CB if A, B ∈ Mn×p and C ∈ Mm×n .
(d) Im A = AIn = A if if A ∈ Mm×n .
Properties of Matrix Multiplication
(a) A(BC ) = (AB)C if A ∈ Mm×n , B ∈ Mn×p and C ∈ Mp×q .
(b) (A + B)C = AC + BC if A, B ∈ Mm×n and C ∈ Mn×p .
(c) C (A + B) = CA + CB if A, B ∈ Mn×p and C ∈ Mm×n .
(d) Im A = AIn = A if if A ∈ Mm×n .
Proof:
Example: (AB)T = B T AT
0 1
1 3 2
A= ,B = 2 2
2 −1 3
3 −1
12 5 T 12 7
AB = , [AB] =
7 −3 5 −3
On the other hand,
1 2
T T 0 2 3
A = 3 −1 , B =
1 2 −1
2 3
12 7
T T
B A = = [AB]T
5 −3
Section 5
Inverse matrices
Inverse Matrix
Definition
Let A be an n × n matrix. An n × n matrix B is an inverse of
A if
AB = BA = In ,
where In is the n × n identity matrix. In this case, A is said to
be invertible or nonsinglar.
Inverse Matrix
Definition
Let A be an n × n matrix. An n × n matrix B is an inverse of
A if
AB = BA = In ,
where In is the n × n identity matrix. In this case, A is said to
be invertible or nonsinglar.
Example
−1 −1
1 2 −2 1 −2 1 1 2
= , =
3 4 3/2 −1/2 3/2 −1/2 3 4
Inverse Matrix
Theorem
An invertible matrix has only one inverse.
Inverse Matrix
Theorem
An invertible matrix has only one inverse.
Theorem
If A and B are both invertible n × n matrices, then AB is
invertible and
(AB)−1 = B −1 A−1
Theorem
Suppose that A is an invertible n × n matrix. Then
• A−1 is invertible and (A−1 )−1 = A.
Inverse Matrix
Theorem
Suppose that A is an invertible n × n matrix. Then
• A−1 is invertible and (A−1 )−1 = A.
• AT is invertible and (AT )−1 = (A−1 )T .
Inverse Matrix
Theorem
Suppose that A is an invertible n × n matrix. Then
• A−1 is invertible and (A−1 )−1 = A.
• AT is invertible and (AT )−1 = (A−1 )T .
• AB = AC implies B = C , where B and C are n × m
matrices.
Inverse Matrix
Theorem
Suppose that A is an invertible n × n matrix. Then
• A−1 is invertible and (A−1 )−1 = A.
• AT is invertible and (AT )−1 = (A−1 )T .
• AB = AC implies B = C , where B and C are n × m
matrices.
Example
3 4
A=
5 6
−1 −3 2
→A =
5/2 −3/2
Algorithm for finding A−1
Theorem
An n × n matrix A is invertible if and only if A is row equivalent
to In . If this is the case, any sequence of elementary row
operations that transforms A to In also transforms In to A−1 .
Algorithm for finding A−1
Theorem
An n × n matrix A is invertible if and only if A is row equivalent
to In . If this is the case, any sequence of elementary row
operations that transforms A to In also transforms In to A−1 .
Example
Find the inverse of
1 3 3
A= 1 4 3
2 6 7
An algorithm for finding A−1
Example
Find the inverse of
1 3 3
A= 1 4 3
2 6 7
1 3 3 1 0 0 1 3 3 1 0 0
R −R1
[A|I3 ] = 1 4 3 0 1 0 −−2−−→ 0 1 0 −1 1 0
R3 −2R1
2 6 7 0 0 1 0 0 1 −2 0 1
Solution (Cont.) Step 2: Apply Row Operations on [A|I3 ]
1 3 3 1 0 0 1 3 3 1 0 0
R −R1
[A|I3 ] = 1 4 3 0 1 0 −−2−−→ 0 1 0 −1 1 0
R3 −2R1
2 6 7 0 0 1 0 0 1 −2 0 1
1 0 3 4 −3 0
R1 −3R2
−− −−→ 0 1 0 −1 1 0
0 0 1 −2 0 1
Solution (Cont.) Step 2: Apply Row Operations on [A|I3 ]
1 3 3 1 0 0 1 3 3 1 0 0
R −R1
[A|I3 ] = 1 4 3 0 1 0 −−2−−→ 0 1 0 −1 1 0
R3 −2R1
2 6 7 0 0 1 0 0 1 −2 0 1
1 0 3 4 −3 0
R1 −3R2
−− −−→ 0 1 0 −1 1 0
0 0 1 −2 0 1
1 0 0 10 −3 −3
R1 −3R3
−− −−→ 0 1 0 −1 1 0 = [I3 |A−1 ]
0 0 1 −2 0 1
Solution (Cont.) Step 2: Apply Row Operations on [A|I3 ]
1 3 3 1 0 0 1 3 3 1 0 0
R −R1
[A|I3 ] = 1 4 3 0 1 0 −−2−−→ 0 1 0 −1 1 0
R3 −2R1
2 6 7 0 0 1 0 0 1 −2 0 1
1 0 3 4 −3 0
R1 −3R2
−− −−→ 0 1 0 −1 1 0
0 0 1 −2 0 1
1 0 0 10 −3 −3
R1 −3R3
−− −−→ 0 1 0 −1 1 0 = [I3 |A−1 ]
0 0 1 −2 0 1
Step 3: Conclusion
10 −3 −3
A−1 = −1 1 0
−2 0 1
An algorithm for finding A−1
Example
Find the inverse of the matrix
0 1 2
A = 1 0 3 ,
4 −3 8
if it exists.
An algorithm for finding A−1
Example
Find the inverse of the matrix
0 1 2
A = 1 0 3 ,
4 −3 8
if it exists.
Solution:
An algorithm for finding A−1
The system
a11 x1 + a12 x2 + ... + a1n xn = b1
a21 x1 + a22 x2 + ... + a2n xn = b2
.. (2)
.
am1 x1 + am2 x2 + ... + amn xn = bm
Example
Solve the system
3x1 + 4x2 = 3
5x1 + 6x2 = 7
3 4
This system is equivalent to Ax = b, where A = , so
5 6
−1 −3 2 3 5
x =A b= =
5/2 −3/2 7 −3
Use inverse matrix to solve linear system