Linear Algebra Concepts for Engineers
Linear Algebra Concepts for Engineers
for Engineers
𝐿 . . . 𝐿1𝑁 𝑀 1 𝑂1
𝐿11 𝑀 1 + · · · + 𝐿 1𝑁 𝑀 𝑁 = 𝑂1 11
𝐿21 𝑀 1 + · · · + 𝐿 2𝑁 𝑀 𝑁 = 𝑂2 𝐿 21 . . . 𝐿2𝑁 𝑀 2 𝑂2
.. →↑ . . . . ... ... = ...
..
.
𝐿 𝑃𝑁 𝑀 1 + · · · + 𝐿 𝑃𝑁 𝑀 𝑁 = 𝑂𝑃 𝐿 𝑃𝑁 . . . 𝐿 𝑃𝑁 𝑀 𝑁 𝑂 𝑃
Contents 2
List of Figures 4
3 Vector spaces 26
3.1 Vector spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2 The space R𝑁 and its subspaces . . . . . . . . . . . . . . . . . . . . . 28
3.3 Vector subspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.4 Linear combination and linear span . . . . . . . . . . . . . . . . . . . 31
3.5 Linear independence . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.6 Basis and dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.7 Change of basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.8 Rank-nullity theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.9 The geometry of the solution set of 𝑄 = 𝑂 . . . . . . . . . . . . . . . 39
Practice problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2
CONTENTS 3
5 Linear transformations 51
5.1 Matrix representation . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.2 Vector space of all linear transformations . . . . . . . . . . . . . . . 54
5.3 Composite linear transformation . . . . . . . . . . . . . . . . . . . . 54
5.4 Linear transformation in computer graphics . . . . . . . . . . . . . . 55
Practice problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8 Applications 81
8.1 Minimizing convex quadratic functions . . . . . . . . . . . . . . . . 81
8.2 Least-squares solutions of linear systems . . . . . . . . . . . . . . . . 82
8.3 Linear regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
8.4 Principal component analysis . . . . . . . . . . . . . . . . . . . . . . 86
8.5 Image compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
List of Figures
4
Chapter 1
𝐿11 𝑀1 + · · · + 𝐿1𝑁 𝑀 𝑁 = 𝑂1 𝐿
11 . . . 𝐿1𝑁 𝑀 1 𝑂 1
𝐿21 𝑀1 + · · · + 𝐿2𝑁 𝑀 𝑁 = 𝑂2 . . . . ... ... = ... →↑ 𝑄𝑀 = 𝑂.
.. →↑ ..
.
𝐿 𝑃𝑁 . . . 𝐿 𝑃𝑁 𝑀 𝑁 𝑂 𝑃
𝐿 𝑃𝑁 𝑀1 + · · · + 𝐿 𝑃𝑁 𝑀 𝑁 = 𝑂𝑃
In the above figure, we may observe a di!ernt view from a linear system into a
simple matrix equation. This gives a new interpretation; instead of finding 𝑀 that
solves an equation, we find a vector 𝑀 that is transformed (by a transformation 𝑄)
into a new vector 𝑂.
The study of solutions of 𝑄𝑀 = 𝑂 is then developed into the theory about vector
space. The theory helps understanding a hidden structure that helps paving the
way to computing.
Another aspect that is heavily studied revolves around matrices. Many modern
applications in the digital world are the byproduct of the matrix theory. In partic-
ular, matrix is a systematic way to put data into places and matrix computations
help dealing with those data — especially in the large scales.
This lecture note could be roughly divided into four parts.
Part 1. This is Chapter 2, which talks about linear systems, matrix equations and
how to solve them.
5
1.2. MATRIX ALGEBRA: A QUICK REVIEW 6
Part 2. Consisting of Chapters 3–4, this part studies vector spaces, their algebraic
structure and geometric structure.
Part 3. This third part includes Chapters 5–7. It starts with an interpretation
of a matrix as a transformation, followed by di!erent constants that are
indications of the properties that a matrix carries. The factorizations into
canonical forms are also discussed here.
Part 4. This final part is Chapter 8 which talks about some selected applications
of linear algebra.
The classical lectures will also be accompanied with computer laboratory ses-
sions to accommodate more complex calculations and to demonstrate the appli-
cations.
·
𝐿21 𝐿22 . . . 𝐿2𝑁 &อฟ ( แถว
.
.. .. . . . ... .
.
𝐿 𝑃1 𝐿 𝑃2 . . . 𝐿 𝑃𝑁
แถว ห
This matrix is said to have dimension of 𝑃 ↓ 𝑁, i.e. having 𝑃 rows and 𝑁 columns.
The 𝑈 th row of this matrix is the array
' (
𝐿 𝑈1 𝐿 𝑈2 . . . 𝐿 𝑈𝑁 ,
In this course, matrices are usually presented with capital roman alphabets,
i.e., 𝑄, 𝑊, 𝑋, . . . , etc.
The following illustration depicts the 𝑈 th row and 𝑉 th column of a matrix:
·
. · . . . 𝐿1𝑉 . . . ·
· ... ·
.. .. ... ..
. . · . . . 𝐿2𝑉 . . . ·
. . . 𝐿 𝑈𝑁 . .
.
𝑈 row ↔ 𝐿 𝑈1 𝐿 𝑈2
.. . . ... . . . ...
th
.. .. . . . ...
. · · 𝐿 𝑃 𝑉 · ·
· . . . ·
· ↗
𝑉 th column
เ ย กเอ กเตอ
# หล ายR ow
Definition 1.1. A matrix that has a single column (i.e. of dimension 𝑁 ↓ 1) is called
a column vector. Likewise, a matrix that has a single row (i.e. of dimension 1 ↓ 𝑁)
is called a row vector.
In this course, we use the simple term vector to refer to a column vector. Vectors
in this course are usually presented with lower-case letters like 𝐿, 𝑂, 𝑌, . . . or more
often with 𝑀, 𝑆, 𝑍, 𝑅, . . . ,etc.
To save up spaces, a column vector 𝑀 (with 𝑁 entries) is usually written also
as 𝑀 = (𝑀1 , . . . , 𝑀 𝑁 ). Hence, writting
𝑀 = (𝑀1 , . . . , 𝑀 𝑁 ) F Kristes.... An
is the same as
𝑀1
.
𝑀 = .. .
𝑀 𝑁
์
Definition 1.2. A square matrix is the one having equal rows and columns.
รี
มี
ร์
ริ
1.2. MATRIX ALGEBRA: A QUICK REVIEW 8
ทแยง
𝐿11 · . . . ·
· 𝐿22 . . . ·
.
.. .. . . . ...
. *เ เ
· . . . 𝐿 𝑁𝑁
น ท
·
↘
diagonal of 𝑄
Definition 1.3. A diagonal matrix is a square matrix whose nonzero entries are only
on its diagonal.
𝑎1 0
·
:
diag( 1,355) =
diag(𝑎1 , . . . , 𝑎𝑁 ) = .
𝑎2
...
0 𝑎𝑁
ิกเอก ก
ร
เมท
Definition 1.4. The identity matrix of dimension 𝑁 ↓ 𝑁 is the matrix 𝑏 given by
1
. 0
𝑏 = diag(1, . . . , 1) = ..
)⨌⨌*+⨌⨌, 0
𝑁 times 1 𝑁↓𝑁 ่
(เมทร ิกสามเห ย
Definition 1.5. A matrix 𝑄 is said to be an upper triangular matrix if all the entries
below its diagonal are all 0. Likewise, it is said to be a lower triangular matrix if all
the entries above its diagonal are all 0.
... ...
0 ≃
· 𝐿 𝑁𝑁 𝐿 𝑁𝑁
เ น& หม ไเ
We simply say that 𝑄 is a triangular matrix if it is either an upper or a lower
น
triangular matrix.
มุ
มื
นี้
ว็
ม่
ตั
ป็
ชื่
ขี
ส้
ดี
ลั
ลี
ม่
ป็
1.2. MATRIX ALGEBRA: A QUICK REVIEW 9
Scalar multiplication
We can multiply a scalar (a constant) to a matrix in a componentwise fashion.
Let 𝑌 ⇐ R be a scalar and 𝑄 = [𝐿 𝑈𝑉 ]𝑃↓𝑁 a matrix. Then the multiplication of 𝑌
with 𝑄, written 𝑌𝑄, is defined by
𝑌𝐿11 𝑌𝐿12 . . . 𝑌𝐿1𝑁
A
𝑌𝐿21 𝑌𝐿22 . . . 𝑌𝐿2𝑁
= ..
C = S
𝑌𝐿 𝑃1 𝑌𝐿 𝑃2 . . . 𝑌𝐿 𝑃𝑁
=
A = in BESG
=
1.2. MATRIX ALGEBRA: A QUICK REVIEW 10
⇑ and 𝑄 ± 𝑊 = 𝑊 ± 𝑄,
* *
⇑ (𝑄 ± 𝑊)𝑐 = 𝑄𝑐 ± 𝑊𝑐 ,
⇑ (𝑄 ± 𝑊) ± 𝑋 = 𝑄 ± (𝑊 ± 𝑋) = 𝑄 ± 𝑊 ± 𝑋,
Matrix multiplication
Now, we consider multiplying two matrices 𝑄 and 𝑊, denoted 𝑄𝑊. For this, we
require the number of columns of 𝑄 and the number of rows of 𝑊 to be the same.
Let 𝑄 = [𝐿 𝑈𝑉 ]𝑃↓𝑁& and 𝑊 = [𝑂 𝑈𝑉 ]&
𝑁↓𝑑 , then 𝑄𝑊 = [𝑌 𝑈𝑉 ] is the matrix of dimension 𝑃 ↓ 𝑑
where the entry 𝑌 𝑈𝑉 is defined by
ห กก วง = แถว
𝑌 𝑈𝑉 = 𝐿 𝑈1 𝑂1𝑉 + 𝐿 𝑈2 𝑂2𝑉 + · · · + 𝐿 𝑈𝑁 𝑂 𝑁𝑑 .
While 𝑃 and 𝑑 are not necessarily equal, 𝑊𝑄 is not even well-defined. For this
-
reason alone, there is no reason that 𝑄𝑊 and 𝑊𝑄 are the same. In general, even for
square matrices 𝑄 and 𝑊, 𝑄𝑊 and 𝑊𝑄 are not equal.
ต้
ลั
วิ
1.2. MATRIX ALGEBRA: A QUICK REVIEW 11
Theorem 1.6. Let 𝑄, 𝑊, 𝑋 be two matrices. Then, whenever the above products are
well-defined, we have
&
⇑ 𝑄(𝑊 ± 𝑋) = 𝑄𝑊 ± 𝑄𝑋,
* =
=
⇑ (𝑄 ± 𝑊)𝑋 = 𝑄𝑋 ± 𝑊𝑋,
<
=
⇑ (𝑄𝑊)𝑐 = 𝑊𝑐 𝑄𝑐 ,
In this chapter, we focus on systems of linear equations (or linear systems) and
their reformulations into matrix equations through which all the analysis will be
carried out. We shall study the classifications of the matrix equation 𝑄𝑀 = 𝑂 based
on its solution set being empty, singleton, or otherwise. Along the way, we study,
among other things, the notions of echelon forms and rank. We shall also study
the Gauss and Gauss-Jordan elimination methods which reduce any matrix into
a row echelon and reduced row echelon forms, respectively. These methods are
also used in finding solutions of a linear system.
Recall that a single-variable equation is said to be linear if it is in the form
𝐿𝑀 = 𝑂. (ส ปสา ( วแปร) = าค
𝐿11 𝑀 + 𝐿 12 𝑆 = 𝑂1
𝐿21 𝑀 + 𝐿 22 𝑆 = 𝑂2 .
To solve this system, we first eliminate a variable and fix the solution of the other
then substitute back into one of the original equations.
The same principle applies to the case of linear systems with three vari-
12
ตั
ค่
2.1. SOLUTIONS OF A LINEAR SYSTEM 13
The simple answer to the above question is “No”. We may have 𝑁 variables that
are linked by 𝑃 linear equations:
𝐿11 𝑀1 + 𝐿 12 𝑀2 + · · · + 𝐿1𝑁 𝑀 𝑁 = 𝑂1
= 𝑂2
𝐿12 𝑀1 + 𝐿 22 𝑀2 + · · · + 𝐿2𝑁 𝑀 𝑁
.. ..
𝑃 equations
. .
= 𝑂𝑃 .
𝐿 𝑃1 𝑀 1 + 𝐿 𝑃2 𝑀 2 + · · · + 𝐿 𝑃𝑁 𝑀 𝑁
)⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌*+⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌⨌,
𝑁 variables
Now let us turn to solving a linear system instead of just verifying values.
𝑀1 + 𝑀2 ⇒ 𝑀3 = 1
2𝑀 1 ⇒ 𝑀 2 + 𝑀 3 = 2
𝑀1 ⇒ 𝑀 2 ⇒ 𝑀 3 = ⇒1.
3𝑀 1 ⇒ 2𝑀 2 + 2𝑀 3 = 1
2𝑀 1 ⇒ 𝑀 2 + 𝑀 3 = 2
𝑀1 ⇒ 𝑀 2 = ⇒1.
We should have observed that the method used to solve (and to further analyze)
linear systems are di!erent from problem to problem. To develop a consistent
methodology, we first need to rewrite them as matrix equations.
ตั
ตั
2.2. MATRIX EQUATIONS 15
𝐿11 𝑀 1 + 𝐿 12 𝑀2 + · · · + 𝐿1𝑁 𝑀 𝑁 = 𝑂1
𝐿12 𝑀 1 + 𝐿 22 𝑀2 + · · · + 𝐿2𝑁 𝑀 𝑁 = 𝑂2
.. ..
. .
𝐿 𝑃1 𝑀 1 + 𝐿 𝑃2 𝑀2 + · · · + 𝐿 𝑃𝑁 𝑀 𝑁 = 𝑂 𝑃 ,
we would define
𝐿11 𝐿12 . . . 𝐿1𝑁 𝑂1 𝑀1
𝐿21 𝐿22 . . . 𝐿2𝑁 𝑂2 𝑀2
𝑄 = .. .. . . . ... , 𝑂 = .. , 𝑀 = .. .
. . . .
𝐿 𝑃1 𝐿 𝑃2 . . . 𝐿 𝑃𝑁 𝑂 𝑃 𝑀 𝑁
We call 𝑄 the coe!cient matrix, 𝑂 the target vector, and 𝑀 an unknown vector. Then
we have
𝐿11 𝑀1 + 𝐿12 𝑀2 + · · · + 𝐿1𝑁 𝑀 𝑁
𝐿12 𝑀1 + 𝐿22 𝑀2 + · · · + 𝐿2𝑁 𝑀 𝑁
𝑄𝑀 = ..
.
𝐿 𝑃1 𝑀1 + 𝐿 𝑃2 𝑀2 + · · · + 𝐿 𝑃𝑁 𝑀 𝑁
·
𝑄𝑀 = 𝑂
is equivalent to the linear system in question. When one analyze this equation,
we usually construct the following augmented matrix
𝐿 11 . . . 𝐿1𝑁 𝑂1
[𝑄 | 𝑂] = .. . . . ..
. .
..
. .
𝐿 𝑃1 . . . 𝐿 𝑃𝑁 𝑂𝑃
Note that the vertical bar separating 𝑄 and 𝑂 is purely notational. It is actually
an 𝑃 ↓ (𝑁 + 1) matrix where the first 𝑁 columns are from 𝑄 and the last is 𝑂.
2.2. MATRIX EQUATIONS 16
2.2.2 Analyzing 𝑄𝑀 = 𝑂
We are not only interested in solving 𝑄𝑀 = 𝑂, but also to understand it.
The first and foremost behavior we would like to observe about the equa-
tion 𝑄𝑀 = 𝑂 is the number of solutions it has. We may very roughly speak of
consistent systems (those having a solution) and inconsistent systems (those without
a solution), but we want a more detailed description in this course. This leads us
to consider the three cases:
⇑ (well-posed) 𝑄𝑀 = 𝑂 has a unique solution, ค ต ตอบเด
หลา
-
To convince that all the three cases could happen, let us do the following
exercise.
Exercise 2.5. Let us observe that:
1 0 1 2
(a) Let 𝑄 = 1 0 ⇒1 and 𝑂 = 0 .
0 1 0 1
Then 𝑄𝑀 = 𝑂 has a unique solution, which is 𝑀 ≃ = (1, 1, 1). **= = E
- . - .
1 0 ⇒1 0 x1- x1=0
(b) Let 𝑄 = and 𝑂 = .
⇒1 1 0 1
Then 𝑄𝑀 = 𝑂 has multiple solutions. For example, 𝑀 ≃ = (0, 1, 0) and 𝑀 ≃≃ =
(1, 2, 1) are both solutions for this system. verify
*** = 1 = 9
1 1 2
(c) Let 𝑄 = 0 2 and 𝑂 = 1 . At =
b)+free=
⇒1 4 0
Then 𝑄𝑀 = 𝑂 has no solution.
At =
1 1 2 4
<
Act 3 =
+1+
·
2x2 + 31 : S
0 𝜑 . . .
·
0 0 → zero Now
0 . . . 0 zerO NOW
hon
𝑔 =
0 ...
. . . . . .
,
0 𝜑 ...
→
0 0 ... . . . 0
we conclude that the rows #2 and #4 are zero rows of this matrix, while he circled
entries (𝜑’s are any nonzero numbers) are the leading entries of their rows.
Definition 2.7. This matrix 𝑓 is in a row echelon form if the following two conditions
are satisfied:
(1) All zero rows are stacked at the bottom.
(2) In each non-zero row, its leading entry is on the left of all the leading entries
below it.
One may simply observe this visually by stacking zero rows at the bottom and
see that the leading entries are arranged in a staircase manner (see an example
ˆ
below with 𝑔).
Notice that the above matrix 𝑔 is not in an echelon form (why?). However, we
may use row operations (swapping rows) to acheive an equivalent matrix in the
following echelon form
𝜑 . . . . . . . . .
น
0 → ตาม
𝜑 . . .
𝑔 =
0 0 0 →
0 . . . . . . 0
ˆ .
0
0 0 . . . . . . 0 zzero
row
prep
Now let us practice checking if a given matrix is in a row echelon form or the
reduced row echelon form.
ต้
ป็
2 .
CNS
A: ? 1
(0)
B=
0
②4 -
Relater
4. กแทนท
RE
:Credit
Room
29, :
&3- REA
ที
ถู
วี
2.4. GAUSS ELIMINATION 19
Exercise 2.9. Determine whether or not the matrices given in the following are in
row echelon and reduced row echelon form.
1 2 0 →1 Hof 0 1 2 0 0 9 nof
& &
REF REA
(a) 𝐿 = &
3 2 0 0
(b) 𝑀 = 0 & 2 →2 5 HOP
0 →1
&PRREF
RREF
& 0 1 1 0 0
2 4 0 1 0 &
0 1 0 →1 0 REF
& 0 REf 0 &
1 1 1 0 0 0 1 0 0 RREF
0 5 HDPRREF 0 0 &
(c) 𝑁 = (d) 𝑂 = 0 1
0 →1
& 2 →2
0
0 0 0 0 &
0 0 0 &1 0 0 0 0 0 0 0
0 0 0 0 0 0 Zero row
0 0 0 0 0 0
Let us state some facts that could be useful in future considerations.
Theorem 2.10. The following facts hold true:
↑ Every matrix can be turned into a row echelon form using elementary row operations. เมทร ิกมอๆ ล ด ปเ
ได
↑ A single matrix may be turned into several row echelon forms. ได้เม ทรร ิก าง น เ
↑ every matrix can be reduced into a unique reduced row echelon form. ลด
หน้า ตา จะเห อ
ง RREF
Exercise 2.11. Use elementary row operations to find row echelon forms of the
matrices from Exercise 2.9.
นต อ นการแ ache
Gauss elimination
2. Eliminate nonzero entries below the chosen entry from the previous step. ท ท ไ าง HonZ
ให เ น ZE
3. Find the next column with nonzero entry after the row 𝑃. Pick that nonzero
entry and swap to the row 𝑃 + 1. เ อนไป ท col อไ ป
อ ก ท um m จะล มแด วและห Oper e
4. Eliminate all the nonzero entries below the chosen entry from the previous
step.
ดึ
ก้
ห้
ลั
ป็
ั่
รู
ต้
ลื่
ต่
ขั้
ำ
ขั้
ลั
ป็
ำ
กั
ที่
ล่
ที่
มื
ต่
ำ
2.5. GAUSS-JORDAN ELIMINATION 20
Exercise 2.12. Use Gauss elimination to turn the following matrices into a row
echelon form.
1 0 →1
1 2 0 →1 1
1 1 0
(a) 𝐿 = 3 2 0 0 / (b) 𝑀 =
2
2 4 0 1 2 4 1 1
3 6 2 1
0 0 →1 2 2
1 0 0 1
1 1 0 1 0
(c) 𝑁 = (d) 𝑂 =
0 0 1 1
0 →2 0 1 0 0 0 0 0
0 0 0 1 1 0 1 1 0
*ใ
สดว
The process of Gauss elimination reduces any given matrix into a row echelon
form. However, if we would like to go further in obtaining a reduced row echelon
form, we need a small extra computation in the Gauss elimination steps. This
modified algorithm is known as the Gauss-Jordan elimination whose steps are listed
as follows:
1. Start with the first nonzero column. Pick a nonzero entry, make it into 1 and
swap that row to the top. Set 𝑃 = 1.
2. Eliminate all nonzero entries in that column except the 1 from the previous step.
3. Find the next column with nonzero entry after the row 𝑃. Pick that nonzero
entry, make it into 1 and swap to the row 𝑃 + 1.
4. Eliminate all the nonzero entries in that column except the 1 from the previous
step.
Exercise 2.13. Use Gauss-Jordan elimination to obtain the reduced row echelon
form of the following matrices.
ำ
Ex 2.12
a =!
ไ
-
(b) B= ①
More ด
&4
2 I
&6
~
. ever, Co dia ↓
R -
*
&st2Re :
Ry * 1
&- 1
& 0- 1
0 1 -
!Re:
~ &4 * Retro
Ex 2.
16
·for
Ref &res
Lo"Clinic B)= 3 at ::
อ
mas
0:
&-
-
1) &2
& &&
=ว inch nice. o so
VanK( DC = 2
ห ว R
3
!อ
·carReRe:
add-on
:อ-อ
& ศว:อ
REF
NARKCB) = &
ติ
ลั
วิ
2.6. RANK AND SOLUTIONS OF 𝐿𝑀 = 𝑁 21
→2 0
0 0 0 0 0 1 3
2 0
(a) 𝐿 = (b) 𝑂 =
1 3
0 1 2 3 0 0
1 0 →1 2 3 1 →1 0
1 1 1 3
Before we define the rank of a matrix, let us point out the following fact.
With the consistence of nonzero rows in the above observation, one may define
a rank of a matrix to be the number of nonzero rows in a row echelon form. That
is, the rank is the number of genuine information that a matrix carries.
Exercise 2.16. Find the rank of the matrices from the previous exercises.
be observed from the row echelon form of the augmented matrix [𝐿 | 𝑁]. More pre-
cisely, the number of solutions of 𝐿𝑀 = 𝑁 can be concluded from the rank([𝐿 | 𝑁])
as presented in the theorem below.
The following flow chart helps the explaining the use of rank to determine the
number of solutions of 𝐿𝑀 = 𝑁.
No
rank(𝐿) = rank([𝐿 | 𝑁]) Stop: No solution.
Yes
No
rank(𝐿) = 𝑃 Stop: Multiple solutions.
Yes
Figure 2.1: The flow chart for determining the number of solutions of 𝐿𝑀 = 𝑁.
A practical aspect
Consider again the system represented by 𝐿𝑀 = 𝑁 with 𝑃 variables and 𝑄
equations. In practice, to see if rank(𝐿) < rank([𝐿 | 𝑁]) happens, we do not need
2.6. RANK AND SOLUTIONS OF 𝐿𝑀 = 𝑁 23
Yes
Contains [0 . . . 0|↗]
# Stop: No solution.
No
Yes
#nonzero rows = #var. Stop: Unique solution.
No
Stop: Multiple solutions.
Figure 2.2: A practical flow chart for determining the number of solutions of 𝐿𝑀 =
𝑁.
3𝑀 1 + 𝑀 2 → 𝑀 3 = 3
𝑀1 → 𝑀2 + 𝑀3 = 1
A= = 2𝑀 2 → 2𝑀 3 = 0
-
AIB =
3
&for = enAR- 3R Totten arest Red
2.7. FINDING SOLUTIONS OF 𝐿𝑀 = 𝑁. 24
2𝑀 1 + 𝑀 2 → 𝑀 3 = 2
𝑀1 + 𝑀2 = 2
𝑀2 + 𝑀3 = 0
𝑀1 + 𝑀2 + 𝑀3 + 𝑀4 =4
&
2𝑀 1 + 3𝑀 2 → 𝑀 3 → 𝑀 4 =3
𝑀2 + 𝑀3 =2
2𝑀 1 → 𝑀 2 + 𝑀 3 → 𝑀 4 =1
𝑀1 + 𝑀 2 → 𝑀 3 → 2𝑀 4 =0
𝑀1 + 𝑀2 + 𝑀3 + 𝑀4 =4
2𝑀 1 + 3𝑀 2 → 𝑀 3 → 𝑀 4 =3
𝑀2 + 𝑀3 =2
2𝑀 1 → 𝑀 2 + 𝑀 3 → 𝑀 4 =1
𝑀1 + 𝑀2 → 𝑀3 → 𝑀4 =0
𝑀1 + 𝑀2 → 𝑀3 = 6
𝑀1 → 𝑀 2 + 𝑀 3 = →2
2𝑀 1 → 2𝑀 2 + 3𝑀 3 = →5
-&
-
-
่ 1 หา ค ตอบ ตรง ๆ ก จ
11 = 2
แทน +1 = 2 ลงใน -X 2+ X
=- P-&
งไน @ - 2X243 +3 = - C
&- : - X3 = 1
แทน X 3 = - 1 ใน El x 2 = 3
... ระบบ สมการ ้ค
น
ี ตอมเ ย ว อ4=(
2 ลด ป เ น REF / RR
่
=in be
/B = I I called
&
Re Re
Love is /
·
RCE
&stro- can
↓
-14 Xettz:
-2X2+2X3 = -%
<3 = - 1
· ·์ ac-es
o
aRe
วิธีที
ลุ
ดี
ำ
วิธี
ป็
ที
มี
รู
ำ
ำ
คื
7
1
A =
AIS ) =
· -
· Nanktib
# ฬ&MER
by Trunks
functio-
กี
ตั้
2.7. FINDING SOLUTIONS OF 𝐿𝑀 = 𝑁. 25
𝑀1 + 𝑀2 → 𝑀3 → 𝑀4 =0
𝑀1 → 𝑀2 + 𝑀3 + 𝑀4 =2
𝑀2 → 2𝑀 3 = →1
𝑀1 + 𝑀 2 + 3𝑀 3 + 2𝑀 4 =7
2𝑀 1 + 𝑀 2 → 3𝑀 3 = 1
𝑀1 → 𝑀2 + 𝑀3 = 1
3𝑀 1 → 2𝑀 3 = 2
𝑀1 + 2𝑀 2 → 𝑀 3 + 𝑀 4 = 3
2𝑀 1 → 2𝑀 2 + 2𝑀 3 → 𝑀 5 = 2
2𝑀 1 → 3𝑀 3 = →1
Chapter 3
Let us motivate the study of a vector space, again, from the equation 𝐿𝑀 = 𝑁
that corresponds to a system of 𝑂 variables and 𝑃 equations. Let us begin with
the special case where 𝑁 = 0.
It turns out that when 𝐿𝑀 = 0 has more than one solution, it has infinitely
many of them. Let us demonstrate this fact. Let 𝑀 ↑ and 𝑀 ↑↑ both be solutions
of 𝐿𝑀 = 0. Take any numbers 𝜑 and 𝜒. Then we get
This means from two di!erent solutions, we can generate infinitely many more by
choosing di!erent values of 𝜑 and 𝜒.
Let S be the set that contains all the solutions of 𝐿𝑀 = 0. It turns out that the
shape S belongs to a particular class, e.g. a single dot, a straight line, a 2D flat
plane, a 3D space, etc. We actually observe that all of them are linear in nature. In
fact, we shall see subsequently that a solution set of the equation 𝐿𝑀 = 0, if not
empty, is a vector space (or a linear space).
Not limited to this, the concept of a linear space is also a backbone of modern
mathematics which applies to power series expansion, Fourier series and trans-
forms, Laplace transforms, di!erential equations, etc.
In this chapter, we introduce a general definition of a vector space but we will
emphasize on the Euclidean space R𝑂 and its subspaces. We shall also discuss
notions related to a vector space including, among others, basis and dimension.
26
3.1. VECTOR SPACES 27
Definition 3.1 (General vector space). Let 𝑄 be a nonempty set (whose elements
we call vectors) and 𝑅 be a scalar field (whose elements we call scalars and 𝑅 is
usually either R or C). Let + and · be the vector addition (adding two vectors in 𝑄
yields a vector in 𝑄) and scalar multiplication (multiplying a scalar in 𝑅 and a vector
in 𝑄 yields a vector in 𝑄). Then the set 𝑄 together with the operations + and ·
(precisely written as the tuple (𝑄 , +, ·)) is said to be a vector space over the scalar
field 𝑅 if the following conditions are satisfied for all 𝑆, 𝑇, 𝑈 ↓ 𝑄 and all 𝜑, 𝜒 ↓ 𝑅:
(V1) 𝑆 + 𝑇 = 𝑇 + 𝑆;
(V2) (𝑆 + 𝑇) + 𝑈 = 𝑆 + (𝑇 + 𝑈);
(V4) for each 𝑆 ↓ 𝑄, there is a vector in 𝑄, denoted by →𝑆 and called the negative
of 𝑆, such that 𝑆 + (→𝑆) = (→𝑆) + 𝑆 = 0;
(V8) 1𝑆 = 𝑆.
↔ We avoid to use ‘·’ to denote multiplication because this could be confused with
the dot product that we shall study later.
ดเ กน
3.2. THE SPACE R𝑂 AND ITS SUBSPACES 28
RMAM =
Smoothie
Of
แถม
(E2) (𝑆 + 𝑇) + 𝑈 = 𝑆 + (𝑇 + 𝑈);
(E4) for each 𝑆 ↓ R𝑂 , there is a vector in R𝑂 , denoted by →𝑆 and called the negative
of 𝑆, such that 𝑆 + (→𝑆) = (→𝑆) + 𝑆 = 0;
(E8) 1𝑆 = 𝑆.
Therefore, R𝑂 (with its usual vector addition and scalar multiplication) is a vector
space. In what follows, the space R𝑂 (called the Euclidean space) is always equipped
with these classical operations unless explicitly stated otherwise.
One may observe the following development as 𝑂 starts o! from 𝑂 = 1. We
have:
↔ The space R1 = R which looks is a straight line (a 1D object).
↔ The spaces R𝑂 with 𝑂 ↗ 3 are understood intuitively (adding one more axis
to R3 and so on). They are beyond our ability to draw.
Vector spaces เ นตร งโ โก้ง fin er SPN
Vector
* * sub
Space
S
9 . * #
IR
พู
ซ้
ม่
ล็
ส้
3.3. VECTOR SUBSPACES 29
C2117 C
E = <CMY1 EIR"I
E
x =
(110) #
ก ห นดให
้
F และะ &,B G
ue,r E
& HtBREET
U=C UniUL) ) Re:2 H2
·:: U, PEE =>
ได
จะ ้ Cu +BY = a +
=CUN, Pr =
CPU , #BES
& %
2
%
CMULTOVI) =
=2 & ULPCBV2 = 24
ป า & U+BF
·: :. ส G
*เ น รห ง Space S ของI
ไ เ D Spac
ท
&UtBVG
#
· หา U, VEE ่U+P E
, f
และ &U = ( 2,2) &
#
:"' to ไ เ น SubSPace S
2
Ex 3.7
(b) D #o X = #12 / / 2 =
&xytb
(a) * - Sirirail xztax, จารณา Vector
0-x2 = dx,+b = · * ไ เ
r o = 28,8
ก หน ดให
้ H = Cuy,U2) Ex => Ustd จะะเ น า
= (CU1+BK1) = &XI
~
*
+
·. . QU+&V E * และะได้ า เป็น S ubspace
ด้
ที
ที
ด้
พิ
ป็
ช่
ลื
ว่
ม่
ำ
ว่
ห็
ม่
ช้
ห็
ำ
จ่
ห็
ว่
รุ
ห็
ป็
ป็
ป็
ม่
ว่
รุ
ว่
ม่
ป็
A spac E เพร าะวง
ไม่เ ว Su
3.3. VECTOR SUBSPACES 30
&2 of
(d) 𝑄 = {(𝑀, 𝑀 2 ) |
&>
𝑀 → R}.
ยกก
Exercise 3.10. Which of the following are vector spaces.
(a) 𝐿 = {(𝑀, ↑2𝑀 + 2𝑈, 𝑈) | 𝑀, 𝑈 → R}. * 1 ·
เ
* NY = x2 ไ เฉพาะ x +
·
We next consider in the upcoming exercises the two important vector spaces
that are generated by a given matrix.
คุ
ชิ
ตั
กั
ตั
ำ
มี
ส้
ด้
ำ
EX
(a)
3.
W = &CAgIX) ( x
ERR
as
V #
(1) X= ECricXIX203 %
(2) Y = <2 x, y)
/Y =*
3 หา a=-1
&
4 = =(1, -2) EX { =1 1 Y =2 Y= # X & code
Ch = ( 112) ↑* < <= = = = = = 2 Year <Is &
:x ไ เ น Subsprce ขอ ง IRY
(C) เ อก &= -
CN) M = dAneX2) 1x nd อ าว อย 1 ต
EX 3.9
เ อก u = =(110) (EFire- o
=adm
V =
10,1) ( EP Fitc = o
3,1 A elpmen
KINCAL = EXPIRYDATE&3 is a subspice of "
&, BE /K
3.12 At /RMAN
=- ACOW) + ASBET
#BES
=A
. . IPEIR": &U + BP = A4
·อ
ด้
ด้
ห็
ป็
ลื
ว่
ลื
ำ
ม่
ำ
รุ
ป็
ม่
ม่
ป็
ม็
ม่
น้
3.4. LINEAR COMBINATION AND LINEAR SPAN 31
Exercise 3.12. Let 𝐿 be any 𝑀 → 𝑁 matrix. Then the set of all products 𝐿𝑂 is a
vector subspace of R𝑀 . This set is actually called the image of 𝐿, or im(𝐿).
Example 3.14. Consider the vectors 𝑅 = (4, 0, 3), 𝑅1 = (1, 0, 0), 𝑅2 = (0, 1, 0) and 𝑅 3 =
(0, 0, 1) from R3 . Then 𝑅 is a linear combination of 𝑅1 and 𝑅 3 , but not of 𝑅1 and 𝑅 2 .
Exercise 3.15. Let 𝑅 = (5, 5, ↓5, 3), 𝑅 1 = (1, 2, 0, 0), 𝑅2 = (↓1, 1, 1, 1) and 𝑅3 =
(↓2, 0, 3, ↓1). Is 𝑅 a linear combination of the other vectors 𝑅1 , 𝑅2 , 𝑅3 ?
Exercise 3.16. Let 𝑅 = (2, 3, ↓1, 1), 𝑅 1 = (1, 1, 3, 2), 𝑅2 = (↓1, 2, 1, 0) and 𝑅3 =
(2, 0, 0, ↓1). Is 𝑅 a linear combination of the other vectors 𝑅1 , 𝑅2 , 𝑅3 ?
A nice way to generate a vector subspace from a few vectors is to use the linear
space, which is nothing else but all the possible linear combinations of such given
vectors.
Definition 3.17 (Linear span). Let 𝑃 be a vector space over the field 𝑄 ↑ { R, C}
and 𝑇 = {𝑅1 , 𝑅2 , . . . , 𝑅 𝑆 } ↔ 𝑃. Then the linear span (or simply the span) of 𝑇 is
! #
"
𝑆
span(𝑇) = span(𝑅1 , . . . , 𝑅 𝑆 ) = 𝜑 𝑈 𝑅 𝑈 | 𝜑1 , . . . , 𝜑 𝑆 ↑ 𝑄 ,
𝑈=1
all linear combi
3 ก
of VINV21 .... Ve
ทุ
Ex 3.10 V=(
ข
ๆ = 31,0,0)
4,03) # การ เ ค า V เป็น Linear Com by ของ าง ว 1. *
ข2 = 28,790) kwa Add .... sx = Cde co-/
ิ Io ... .. * ไม่
V3 = 8,0,1) * row ม ค
<in
ส เ น
linearr comboii ของ และบ
② จารณากา รร ค ตอบข
อง At = 3 + คา Mor ostowLinear 0..... 3103 ค ตอ
อ งสามาร รถหา &1 A2 IR-
&3 G
*
เ นจริง
V =&
1
V
1 + &3 3
·
↓
: = #
Afriv d =3 = : ·-
Ax=1 อง: ค
CAID =3 #-
=
A==
+= e d = + = 3
า Alb = ด / re
Retro TriYes,
จารณ
starry on REF /
:ไ
:1
มี NOW ใน ปแ บน CO. . . Old
เ องจา ก Ax=
S
! ค งใ ว
:· Ax
:
-
6
#Nobester o isselected !
ตอ บ
A1 &3
1
P = &evet& gVg
:· F เ น Linear combination ขอ
งขา &V &* /PostPrePost
cii) Vไ เ น Linea-Camb i ขอ ง ขา แล RMF Retrod -
ะ
Ax=b ไ ่ ค ไม ิดเต
่ม
A: =
<= 11 1= :
i.e. the set of all linear combinations of vectors in 𝐿. We also say that the
set 𝑀 = span(𝐿) is generated by 𝑁 1 , . . . , 𝑁 𝑂 , or that 𝑁1 , . . . , 𝑁 𝑂 are generating vectors
for 𝑀.
Figure 3.1: The linear span (pink plane) generated by the vectors 𝑁 1 (red)
and 𝑁2 (green).
At this point, one may also observe that a single vector 𝑁 may be written
as a linear combination of vectors 𝑁 1 , . . . , 𝑁 𝑂 in more than one way. Hence the
representation of 𝑁 as
𝑁 = 𝜑1 𝑁1 + · · · + 𝜑 𝑂 𝑁 𝑂
may not be unique due to the available choices of the coe"cients 𝜑 𝑄 ’s. Let us
investigate this non-unique characteristic in the following example.
EX 3.10 = EVIIV 11 ... ข
spomCFY = 2air 19 ; EIRB
ก หน ดให้ U E GPr
m CEY ==> &1,... , &k u=GIY t , .... ,
F E SPom (FY => 1 ....... , * P= &V + .... ,
&, PEIR
้ า Gu
จะะได
+Br = G CG + .... . +, kedve) + BCIt,.... + &g
= &
&MV +. . . . . & &VR + Ba +. . . . + B &
End
·3 QU+BP เ น linear ข
Comb 80 * V
1. CUTBP
ESPOMCFY
3. +
a) W= 541,87, <OM
V. Ne
SPAM( U) = SPOM ( ( 7,07,0,17
= IR
= , (110) + &221, 11 14 1,
&2EIR3
= (GR2, 92 &1,92
ที่
ป็
ป็
ว่
ำ
มึ
มี
มี
ที่
ที่
3.4. LINEAR COMBINATION AND LINEAR SPAN 33
Example 3.20. Consider 𝐿1 = (1, 1), 𝐿2 = (1, 0) and 𝐿3 = (0, 1). Then the vector 𝐿 =
(2, 2) can be obtained as a linear combination of 𝐿1 , 𝐿2 , 𝐿3 by either
𝐿 = 0𝐿1 + 2𝐿 2 + 2𝐿 3
or
𝐿 = 1𝐿1 + 1𝐿 2 + 1𝐿 3
or
𝐿 = 4𝐿1 → 2𝐿 2 → 2𝐿 3
et cetera.
In this example, if we delete one of the vectors 𝐿1 , 𝐿 2 or 𝐿 3 , then 𝐿 can still be
written as a linear combination of the remaining vectors, and, in a unique way.
Let us do this as the next exercise.
Exercise 3.21. From the previous example...
(a) Find span({𝐿1 , 𝐿2 , 𝐿3 }).
(b) Show that 𝐿 ↑ span({𝐿 1 , 𝐿2 , 𝐿3 }).
(c) Show that if one of the vectors 𝐿 1 , 𝐿2 , 𝐿3 is dropped, then the new linear span
equals the original one. Moreover, 𝐿 can be written as a linear combination
of the remaining vectors in a unique way.
(d) If we drop one more vector, then the generated span is a di!erent one.
In this previous exercise, we see several worthy remarks. Let us list the impor-
tant ones:
↓ R2 itself is a linear span.
↓ A subspace can be written as a linear span in several di!erent ways.
↓ Some of the generating vectors are superfluous, and hence can be dropped.
This means we may write the same linear span with less generating vectors.
↓ We cannot drop too many generating vectors while maintaining the same linear
span. The minimal vectors left are the most important ones. In fact, these are
basis vectors that we will later discuss.
3.5. LINEAR INDEPENDENCE 34
We still need one more notion, the linear independence, to get ourselves ready
for the discussion of basis vectors.
Definition 3.22 (Linear independence). Let 𝑀 be a vector space. The nonzero vec-
tors 𝐿 1 , . . . , 𝐿 𝑁 ↑ 𝑀 are said to be linearly independent if the only coe"cients 𝜑1 , . . . , 𝜑 𝑁
that makes * V1 , . . . . Via linerly indep <=> Ax & ค ตอบเก
𝜑1 𝐿1 + · · · + 𝜑 𝑁 𝐿 𝑁 = 0
X =
=
are given by 𝜑 1 = 𝜑2 = · · · = 𝜑 𝑁 = 0.
If 𝐿 1 , . . . , 𝐿 𝑁 are not linearly independent, we say that they are linearly dependent.
Exercise 3.23. Show that the vectors 𝐿 1 = (1, 0) and 𝐿2 = (0, 1) are linearly inde-
pendent.
Exercise 3.24. Show that the vectors 𝐿1 = (1, 1, 1), 𝐿 2 = (1, 1, 0) and 𝐿3 = (1, 0, 0)
are linearly independent.
Exercise 3.25. Show that the vectors 𝐿1 = (1, 1), 𝐿2 = (1, 0) and 𝐿3 = (0, 1) are
linearly dependent (i.e. not linearly independent).
Exercise 3.26. Show that if 𝐿1 , . . . , 𝐿 𝑁 are linearly dependent, then at least one of
these vectors can be written as a linear combination of the remaining ones with
some nonzero coe"cients.
V19 .... ,
V /17
&
A = = = = = 19 CREF แ ีV
วจะม ; ียนใน
เข ป Liner Combin &ti& a ของเเวกเตอ
NonRCA) = 2 # Vide
า Vic... , V a ไ เ
Pro สม น line rly i
:. Vy, Va เ น ส ระเ ง เ น
ข :วา
สมกา ค
Ax = 0 ละะม ตอ
มx=
EX 3.2 P
Vy = ( 1,117) V2 = ( 1,198) <11 &
3:
จะะม ี Xiอ าง
·
ร & อย หน ง ว
A: Vs V า = ? RE
/
V I
NonKGAD = 3
ง
V3,52,7 เ น liner.l y i n dep
3.25
v , = 1,1) V2 = (110) V3 = ( 01
A:
Criver = 1
RERIT In 9 REG
⑨
·
VAR
rank CA) = 2 =
:- V11V21V3 ไ เ น liner/
y ind
ด้
ที่
ติว่
ป็
ว่
จึ
ส้
ป็
ป็
ตั
นึ่
ม่
ม่
ำ
ล้
ย่
ชิ
รู
ป็
ม่
อิ
น้
3.6. BASIS AND DIMENSION 35
→ span({𝐿1 , . . . , 𝐿 𝑀 }) = 𝑁,
→ 𝐿1 , . . . , 𝐿 𝑀 are linearly independent.
The set {𝐿 1 , . . . , 𝐿 𝑀 } is called a basis of 𝑁.
The next exercise gives an important insight, saying that a vector space of
dimension 𝑂 does not contain a proper subspace of equal dimension.
Exercise 3.33. Let 𝑁 be a vector space with dimension dim(𝑁) = 𝑂. If 𝑅 ↔ 𝑁 is a
subspace of 𝑁 with dim(𝑅) = 𝑂, then 𝑅 = 𝑁.
- 1 & ↑
En = ext . . . . . In = ( 11 . .... 1
if
Fic ..., on finetly indep
trial
spomifa, .... fal = &fifact ... &1 . . . . . . &ERY
+
a)
an
=Santation
/ /Cr. ....
&2 t....
:
+&n
&nGR {
=1
ป็
ห้
ริ
3.31 V= &21 2) EIRY/ 21 - =30, X1 +322 = 0
งเก ต า V เเ ค
น เซต ของ ตอของ ระบบส
9 X3 = 2X 1
& x2 = x 1 ⑤
x = = = = =<1 3 INTER
= 3, CEIR
&
-(a) Spon ( 195312) =
-(P) ( 11512)เ น -linerlyy inde
Ve<โดย
เพราะะม เ
𝑂 = 𝜑1 𝑀1 + 𝜑2 𝑀2 + · · · + 𝜑 𝑁 𝑀 𝑁 .
Exercise 3.34. Let us equip R2 with the basis B = {(1, 0), (1, 1)}. Then write down
the vectors 𝑂 = (3, 2) and 𝑄 = (↑2, 5) in the representation of the basis B.
Definition 3.36. Once again that we would like to emphasize that every basis of a
vector space 𝐿 contains the same number of basis vectors. This consistent number
is referred to as the dimension of 𝐿, or briefly as dim(𝐿).
↑
Example 3.37. Recall from the above exercises that dim(R𝑁 ) = 𝑁, dim(𝐿) = 1
and dim(𝑅) = 2.
มิ
มิ
ติ
3.7. CHANGE OF BASIS 37
𝑂 = 𝜑1 𝑁1 + 𝜑2 𝑁2 + · · · + 𝜑 𝑀 𝑁 𝑀 .
and solve for the unknown coe!cients 𝜑→1 , · · · , 𝜑→𝑀 . Putting the two equations
above together and let
𝑃 = 𝑁 1 𝑁 2 · · · 𝑁 𝑀 𝑃→ = 𝑁1→ 𝑁 2→ · · · 𝑁 𝑀→
𝜑1 𝜑→
1
𝑄 = ... 𝑅 = ... ,
𝜑 𝑀 𝜑→
𝑀
we arrive at the casual linear system
Since the vectors 𝑁1→ , · · · , 𝑁 𝑀→ form a basis, they are linearly independent and so
rank(𝑃→) = 𝑀 which means (𝑃→)↓1 exists. Finally, we may obtain the unknown
coe!cients from
𝑅 = (𝑃→)↓1 𝑃𝑄.
3.8. RANK-NULLITY THEOREM 38
where
[B→ ↔ B] = (𝑃→)↓1 𝑃
Exercise 3.38. Let 𝐿 be a vector space and B, B→, B→→ are three bases of 𝐿. Show
that [B→→ ↔ B] = [B→→ ↔ B→][B→ ↔ B].
Exercise 3.39. Suppose that S is the standard basis of R𝑀 and B be any basis of R𝑀 .
Find the change-of-basis matrices between the two bases S and B.
Exercise 3.40. Consider R2 . Let B be the standard basis on R2 and B→ = {(1, 1), (↓1, 1)}
be another basis on R2 .
(a) Find the change-of-basis matrices [B→ ↔ B] and [B ↔ B→].
Exercise 3.44. Re-assess exercises 3.31 and 3.32 in terms of dimensions using the
rank-nullity theorem.
3𝑅 1 + 2𝑅 2 ↓ 3𝑅 4 = 0
{ 2𝑅 2 + 𝑅 4 = 0
2𝑅 2 ↓ 2𝑅 3 ↓ 𝑅 4 = 0
Use the rank-nullity theorem to conclude the dimension of the solution set of the
above system.
The
from sin die
This means the solution set of 𝑆𝑅 = 𝑁 is a translation of ker(𝑆), so that they have
the same dimension and shape.
*
KevCAl
*
{xIAx=P
· ~
# sub S ไ เ D Spe
*
# น SU
ตั
ม่
ป็
Ex 3.93
hall Casa
-
rankacAl
A:
Los
RER- Re 28REA
Nank ( A = 3, MER
3𝑁 1 + 2𝑁 2 → 3𝑁 4 = 2
2𝑁 2 + 𝑁 4 = →1 ** Ax = $
2𝑁 2 → 2𝑁 3 → 𝑁 4 = 0
Use the rank-nullity theorem to draw conclusion about the geometry of the solu-
tion set of the above system.
* เซตร าตอ บ ก ณะอ า งใช dimons
เซต
ต าตอ กขอ ระบ บสมการน เ ด การ เ ่อนขน านของ
ึ
ง นะเ นเ
:. เซ ต ค ตอนขอ งระบ ผสมการ
ค จ กษ
dimension: 1
มี
ต้
ย่
ษั
ี้
กิ
ลื่
วิ
ด้
ำ
ลั
ลั
ข้
ป็
3.9. THE GEOMETRY OF THE SOLUTION SET OF 𝐿 = 𝑀 41
Practice problems
1. Show that the vectors in each of the following items are linearly dependent.
2. Show that the vectors in each of the following items are not linearly independent.
3. Find a basis for the following vector spaces and determine their dimensions.
↑ 𝑃 = {𝑁 ↓ R3 | 𝑁1 = →𝑁3 , 𝑁 2 = →𝑁1 }.
!" #$
1 0 1
↑ 𝑃 = 𝑄𝑅𝑆 .
0 1 1
↑ 𝑃 = {(𝑁 1 + 𝑁 3 , →2𝑁2 ) | 𝑁 1 , 𝑁2 , 𝑁3 ↓ R}.
↑ 𝑃 = {(3𝑁 1 , 𝑁1 + 𝑁 2 → 𝑁 3 , 𝑁3 ) | 𝑁 1 , 𝑁2 , 𝑁3 ↓ R}.
↑ 𝑃 = {𝑁 ↓ R3 | 2𝑁1 → 3𝑁 2 = 0, 𝑁 1 + 2𝑁 3 = 0}.
5. Determine the dimension of the solution set of the following linear system:
2𝑁 1 + 𝑁3 = 2
𝑁2 + 𝑁3 → 𝑁4 = 2
𝑁1 → 𝑁 4 = 0.
4.1 Norms
A norm is a function defined on a vector space with certain properties. A norm
us usually interpreted as the size or length of an element in the underlying vector
space.
Definition 4.1 (Norm). Let 𝑃 be a real vector space. A norm is any function ↔ · ↔ :
𝑃 ↗ R such that the following properties hold true for any vectors 𝑁, 𝑇 ↓ 𝑃 and
scalar 𝜑 ↓ R:
(1) ↔ 𝑁↔ ↘ 0 and ↔ 𝑁↔ = 0 ≃⇐ 𝑁 = 0,
(3) ↔ 𝑁 + 𝑇↔ ⇒ ↔ 𝑁↔ + ↔ 𝑇↔ .
4.1.1 Norms on R𝑈
Let us take a look at some common choices of norms on the vector space R𝑈 .
43
4.1. NORMS 44
Among these 𝑊-norms, the case 𝑊 = 2 is the most important and ↔ 𝑁↔ 2 is also
known as the Euclidean norm on R𝑈 .
Remark. Since the Euclidean norm is the most common one used in the literature,
we shall write just ↔ 𝑁↔ instead of ↔ 𝑁↔ 2 for simplicity.
Exercise 4.3. Show in R2 and R3 that the value ↔ 𝑁↔ 2 of the Euclidean norm is exactly
the length of the vector 𝑁.
Exercise 4.4. Let 𝑋 = (3, 0, 1) and 𝑂 = (→2, 1, 2) be two vectors in R3 .
(a) Find the lengths of the two vectors 𝑋 and 𝑂.
(b) Find ↔ 𝑋↔ 1 and ↔ 𝑂↔ ⇓ .
The 2-norm is also known as the Frobenius norm and sometimes written as ↔ 𝐿↔ 𝑏 .
4.2. DOT PRODUCTS AND ORTHOGONALITY 45
" #
1 2 →1 1
Exercise 4.6. Compute the Frobenius norm of a matrix 𝐿 = .
→2 →2 0 →1
The following process of scaling a nonzero vector into a unit vector of the same
direction is called normalization.
Exercise 4.8 (Normalization). Show that for any nonzero vector 𝑋 ↓ R𝑈 , the vec-
tor 𝑋 ↑ = ↔ 𝑋↔
𝑋
is unit. Here, we say that the vector 𝑋 is normalized into 𝑋 ↑ .
The following theorem summarizes the useful properties when one computes
the dot products. We also highlight the connections between the dot product and
the Euclidean norm in the following theorem.
Theorem 4.10. The following holds for any vectors 𝑋, 𝑂, 𝑐 ↓ R𝑈 and scalars 𝜑 ↓ R:
↑ 𝑋 · 𝑂 = 𝑂 · 𝑋,
↑ 𝑋 · (𝑂 + 𝑐) = 𝑋 · 𝑂 + 𝑋 · 𝑐,
4.2. DOT PRODUCTS AND ORTHOGONALITY 46
↑ 𝑋 · 𝑋 = 0 ≃⇐ 𝑋 = 0,
𝑈 2
↑ 𝑋·𝑋 = 𝑌=1 𝑋𝑌 = ↔ 𝑋↔ 2 ↘ 0.
Exercise 4.11. Let 𝑋 = (1, →1, 2, 4) and 𝑂 = (2, 4, →1, 𝑎), where 𝑎 is a constant. What
constant 𝑎 makes 𝑋 · 𝑂 = 0 ?
Another important relationship between the dot product and the Euclidean
norm is the following theorem, which provides an easy formula to compute the
angle between two nonzero vectors.
𝑋 · 𝑂 = ↔ 𝑋↔↔ 𝑂↔ cos 𝜒,
Exercise 4.13. Find the angle between the two vectors 𝑋 = (1, 1, 1) and 𝑂 = (0, 1, 0).
4.2.2 Orthogonality
In many situations, we are only interested to know whether the two vectors
are orthogonal (or perpendicular). In such a case, we simply observe whether the
dot product vanishes. More generally, the sign of the dot product provides some
rough information about the angle between two nonzero vectors.
Theorem 4.14. If 𝑋, 𝑂 ↓ R𝑈 are two nonzero vectors and 𝜒 the angle between them, then
↑ 𝑋 · 𝑂 = 0 if and only if 𝜒 = 0,
Exercise 4.15. Let 𝑋 = (1, 1), 𝑂 = (2, →1), 𝑁 = (→2, 1) and 𝑇 = (3, 6). Find out all the
orthogonal pairs among these vectors.
𝑂 𝑌 · 𝑂 𝑍 = 0, (𝑌 ω 𝑍)
for all 𝑌, 𝑍 = 1, . . . , 𝑉.
Example 4.17. Show that U = {(1, →2, 0), (4, 2, 1), (2, 1, →10)} is an orthogonal fam-
ily.
A more practical way to verify that U is an orthogonal family follows from the
following theorem.
Exercise 4.21. Let 𝑋 = (1, 0) and 𝑂 = (1, 1). Find proj𝑂 (𝑋).
Exercise 4.22. Let 𝑋 = (→1, 1, 0) and 𝑂 = (1, →1, 2). Verify that both proj𝑂 (𝑋)
and proj𝑋 (𝑂) are both the zero vector.
The following fact provides the instrumental idea for the development of the
Gram-Schmidt orthogonalization process in the next section.
Exercise 4.23. If 𝑋, 𝑂 ↓ R𝑈 are nonzero vectors, show that 𝑋 →proj𝑂 (𝑋) is orthogonal
to 𝑂.
Exercise 4.25. Let 𝑃 = span((1, 0, →1), (0, 1, 0)). Find the orthogonal projection of
the vector 𝑋 = (1, 1, 1) onto 𝑃.
4.4. GRAM-SCHMIDT ORTHOGONALIZATION PROCESS 49
𝑂 1↖ = 𝑂1
𝑂 2↖ = 𝑂2 → proj𝑂 ↖ (𝑂 2 )
1
𝑂 3↖ = 𝑂3 → proj𝑂 ↖ (𝑂 3 ) → proj𝑂 ↖ (𝑂 3 )
2 1
..
.
𝑂 ↖𝑌 = 𝑂 𝑌 → proj𝑂 ↖ (𝑂 𝑌 ) → · · · → proj𝑂 ↖ (𝑂 𝑌 )
𝑌→1 1
..
.
𝑂 𝑈↖ = 𝑂 𝑈 → proj𝑂 ↖ (𝑂 𝑈 ) → · · · → proj𝑂 ↖ (𝑂 𝑈 ).
𝑈→1 1
Exercise 4.27. Consider R2 with the basis U = {(1, →3), (→1, 0)}. Use the Gram-
Schmidt process to create an orthogonal basis from U.
Exercise 4.28. Consider R3 with the basis B = {(1, 0, 0), (1, 0, 1), (0, →2, 0)}. Or-
thogonalize B using the Gram-Schmidt process.
4.4. GRAM-SCHMIDT ORTHOGONALIZATION PROCESS 50
Practice problems
1. Find the lengthiest and shortest vectors among the following:
↑ 𝑂1 = (3, 2, →1),
↑ 𝑂2 = (1, →3, 4),
↑ 𝑂3 = (→2, 3, 1),
↑ 𝑂4 = (1, 0, 4).
2. Let 𝑋 = (1, →2, 0) and 𝑂 = (0, 1, 1). Find the angle between the two vectors 𝑋
and 𝑂.
Linear transformations
There is a special class of functions that maps between two vector spaces, called
linear transformation. We will discover later that this class is special because it can
be fully described with matrices in the Euclidean setting. This characterization
also brings about a new interpretation to the equation 𝐿𝑁 = 𝑀.
Definition 5.1. Let 𝑃 and 𝑓 be two vector spaces over the field 𝑔 ↓ { R, C}. A
function 𝑒 : 𝑃 ↗ 𝑓 is said to be a linear transformation if the condition
𝑒(𝜑𝑁 + 𝜔𝑇) = 𝜑𝑒(𝑁) + 𝜔𝑒(𝑇)
holds true for all 𝑁, 𝑇 ↓ 𝑃 and 𝜑, 𝜔 ↓ 𝑔.
51
5.1. MATRIX REPRESENTATION 52
is a linear transformation. With this fact, we can now view the matrix 𝐿 as a
function that transforms 𝑁 ↓ R𝑈 into 𝐿𝑁 ↓ R𝑉 .
We may use the converse of the above fact to disprove linearity of a function:
If 𝑒(0) ω 0, then 𝑒 is not a linear transformation.
Exercise 5.5. Show that the following functions are not linear transformations.
(a) 𝑒 : R ↗ R defined by 𝑒(𝑁) = 3𝑁 + 1.
Exercise 5.6. Determine whether or not the following functions are linear trans-
formations.
(a) 𝑒(𝑁1 , 𝑁2 ) = sin2 (𝑁 1 ) + cos2 (𝑁2 ).
𝑒(𝑁) = 𝐿𝑒 𝑁 (↙𝑁 ↓ R𝑈 ).
This matrix 𝐿𝑒 is called the matrix representation of 𝑒 (or shortly the matrix of 𝑒)
and can be formulated by
𝐿𝑒 = 𝑒(𝑅1 ) 𝑒(𝑅2 ) . . . 𝑒(𝑅 𝑈 )
where 𝑅1 , . . . , 𝑁 𝑈 are vectors in the standard basis of R𝑈 .
Exercise 5.7. Find the matrix representations of all the linear transformations from
Exercise 5.2.
It can be noticed that ker(𝑒) = ker(𝐿𝑒 ) and ran(𝑒) = im(𝐿𝑒 ), hence they both
are linear subspaces. Moreover, we may
↑ compute the kernel ker(𝑒) by solving the linear system 𝐿𝑒 𝑁 = 0,
𝑒(𝑁1 , 𝑁2 , 𝑁3 ) = (2𝑁1 → 𝑁 2 , 𝑁1 + 𝑁 2 ).
Theorem 5.10. Let 𝑃 and 𝑓 be two vector spaces over the field 𝑔 ↓ { R, C}. We define
Then L (𝑃 , 𝑓) is a vector space over the field 𝑔 under the above albegra.
Exercise 5.12. Suppose that 𝑑 , 𝑃 , 𝑓 are three vector spaces and let 𝑒 : 𝑑 ↗ 𝑃
and : 𝑃 ↗ 𝑓 be two linear transformation. Show that the composition ↑ 𝑒 :
𝑑 ↗ 𝑓, defined by
↑ 𝑒(𝑁) = (𝑒(𝑁)),
5.4.1 2D Flippings
Flipping refers to the situation where a point is mirrored across a given linear
plane. The most basic ones are the flippings across the 𝑁- and 𝑇-axis, respectively.
The following figure illustrates the flipping of points in R2 across the plane 𝑁 + 𝑇 =
0.
5.4. LINEAR TRANSFORMATION IN COMPUTER GRAPHICS 57
Figure 5.1: Green points flipped across the plane 𝑁 + 𝑇 = 0 into red points.
5.4.2 2D rotations
Here, we consider an operator that rotates a point (𝑁, 𝑇) ↓ R2 about the origin
by a certain angle 𝜒 in the counter-clowise direction. Let us write R𝜒 : R2 ↗ R2 to
denote the 2D rotation. To derive the formula of R𝜒 , we write (𝑁, 𝑇) in the polar
coordinate so that
and also
Hence we have
This shows that R𝜒 is a linear transformation and its matrix representation is given
by
" #
cos(𝜒) → sin(𝜒)
𝑗𝜒 = .
sin(𝜒) cos(𝜒)
5.4. LINEAR TRANSFORMATION IN COMPUTER GRAPHICS 59
Practice problems
1. Determine whether the following functions are linear transformations.
𝑒(𝑁) = 𝐿𝑁.
↑ 𝑒(𝑁1 , 𝑁2 ) = (𝑁1 , 𝑁2 , 𝑁1 , 𝑁2 ).
↑ 𝑒(𝑁1 , 𝑁2 , 𝑁3 ) = 𝑁1 + 𝑁 2 + 𝑁 3 .
↑ 𝑒(𝑁1 , 𝑁3 , 𝑁3 , 𝑁4 ) = (𝑁1 + 𝑁 3 , →𝑁2 → 3𝑁 4 ).
6.1.1 2 ⇑ 2 matrices
Let 𝐿 be a 2 ⇑ 2 matrix. Then its determinant can be computed by
60
6.2. GENERAL DEFINITION 61
6.1.2 3 ⇑ 3 matrices
Let 𝐿 be a 3 ⇑ 3 matrix. Then its determinant can be computed by
This formula is known as the 3 ⇑ 3 Sarrus rule. The following mnemonic device
is useful for this rule:
→ → →
𝑎11 𝑎12 𝑎13 𝑎11 𝑎12
𝑜(𝐿) = [𝑜 𝑌𝑍 ]𝑈⇑𝑈
𝑜 𝑌𝑍 = 𝑘𝑅𝑙(𝐿→𝑌𝑍 ).
6.2. GENERAL DEFINITION 62
𝑛(𝐿) = [𝑛 𝑌𝑍 ]𝑈⇑𝑈
We are now ready for the formal definition of the determinant of any 𝑈 ⇑ 𝑈
matrix.
Definition 6.5 (Determinant). The determinant of 𝐿 can be computed by fixing any
row 𝑌 and calculate
/
𝑈
𝑘𝑅𝑙(𝐿) = 𝑎 𝑌𝑍 𝑛 𝑌𝑍 = 𝑎 𝑌1 𝑛 𝑌1 + 𝑎 𝑌2 𝑛 𝑌2 + · · · + 𝑎 𝑌𝑈 𝑛 𝑌𝑈 ,
𝑍=1
One should notice now the inductive nature of minors and cofactors of 𝐿. For
instance, to compute the minor (and the cofactor) of a 4 ⇑ 4 matrix, we need to
compute determinants of 3 ⇑ 3 matrices. Similarly, computing the minor (and the
cofactor) of a 5 ⇑ 5 matrix requires the determinants of 4 ⇑ 4 matrices, etc.
Let us warm up with a 3 ⇑ 3 matrix wihtout using the Sarrus rule.
Exercise 6.6. Let
2 →1 0
→1 0 3 .
0 2 3
Find 𝑘𝑅𝑙(𝐿) using di!erent rows/columns.
2 0 3 →2
1 0 0 4 0
1 0 →3 1
0 1 0 →3 1
(a) 𝐿 = (b) 𝑚 = 3 0 3 1
→1 →2 3
0
3 →1 0 0 2
1 1 2 0 →1
1 0 2 0 4
Let us now state some useful properties of the determinant.
↑ 𝑘𝑅𝑙(𝐿𝑚) = 𝑘𝑅𝑙(𝐿)𝑘𝑅𝑙(𝑚)
↑ 𝑘𝑅𝑙(𝐿𝑒 ) = 𝑘𝑅𝑙(𝐿)
From the last property, it implies that 𝑘𝑅𝑙(→𝐿) = (→1)𝑈 𝑘𝑅𝑙(𝐿) so that we have
𝑘𝑅𝑙(→𝐿) = →𝑘𝑅𝑙(𝐿) when 𝑈 is odd and 𝑘𝑅𝑙(→𝐿) = 𝑘𝑅𝑙(𝐿) when 𝑈 is even.
Also note that the determinant is not distributed under summation, that
is, 𝑘𝑅𝑙(𝐿 + 𝑚) and 𝑘𝑅𝑙(𝐿) + 𝑘𝑅𝑙(𝑚) are independent.
1 3 1 →3 0
0 0 0
0 3 →4 2 0
Exercise 6.9. Let 𝐿 =
11 28 0
11 385 →98 0
and 𝑚 = . Find 𝑘𝑅𝑙(2𝐿𝑚).
0 0 42 11
0 0 0 →1 13 0 →56 2
Exercise 6.10. Find two matrices 𝐿 and 𝑚 such that 𝑘𝑅𝑙(𝐿 + 𝑚) ω 𝑘𝑅𝑙(𝐿) + 𝑘𝑅𝑙(𝑚).
Exercise 6.11. Find two matrices 𝐿 and 𝑚 such that 𝑘𝑅𝑙(𝐿 + 𝑚) = 𝑘𝑅𝑙(𝐿) + 𝑘𝑅𝑙(𝑚).
6.3. BLOCK TRIANGULAR MATRICES 64
↑ 𝐿 is invertible.
↑ 𝑘𝑅𝑙(𝐿) ω 0.
In the case where 𝐿 is invertible (which is actually where 𝑘𝑅𝑙(𝐿) ω 0), the inverse matrix
of 𝐿 can be calculated by
1
𝐿→1 = 𝑎𝑘𝑍(𝐿),
𝑘𝑅𝑙(𝐿)
where 𝑎𝑘𝑍(𝐿) = 𝑛(𝐿)𝑒 is called the adjoint of 𝐿.
Exercise 6.16. Let 𝐿 be a 2 ⇑ 2 invertible matrix. Find a general formula for 𝐿→1 .
↑ If both 𝐿 and 𝑚 are invertible, then the product 𝐿𝑚 is also invertible and
Exercise 6.19. Find a solution of the following linear system by using the inverse
of the coe"cient matrix.
2𝑁 1 = 4
𝑁1 → 2𝑁 3 = →3
𝑁 2 = 1.
" # " #
1 0 →2 1
Exercise 6.20. Let 𝐿 = and 𝑚 = . Find (𝐿𝑚)→1 .
1 4 2 0
The most important property that we need to address is that the inverse 𝑒 →1 is
also a linear transformation. This fact follows from the following result.
• The sign of 𝑘𝑅𝑙(𝐿) tells about the change of orientation of the transformation.
If 𝑘𝑅𝑙(𝐿) is negative, then the transformation does not preserve the orientation
of the axes.
6.6. GEOMETRY OF DETERMINANT 68
Practice problems
1. Compute the determinants of the following matrices.
2 7 2
↑ 𝐿 = 0 0 1 .
1 0 0
2 7 0 6 3
0 1 0 2 3
↑ 𝑚 = 0 0 1 1 4 .
0 0 →1 →2 3
0 0 0 0 →1
1 0
12 0 0
0 0
3 0 0
↑ 𝑛 = →1 5 0 1 2 .
→11 2 1 1 0
1 1 1 1
→4
𝑒(𝑁 1 , 𝑁2 ) = (2𝑁1 → 𝑁 2 , 𝑁2 → 2𝑁 1 )
is not invertible.
𝑒(𝑁1 , 𝑁2 , 𝑁3 , 𝑁4 ) = (𝑁4 , 𝑁2 , 𝑁3 , 𝑁1 ).
Chapter 7
Eigenvalues and eigenvectors are important concepts that has long list of ap-
plications. For example, it can be used to transform a di!erential equation into a
polynomial. In data analytics, eigenvectors represents important information that
is extracted from a square matrix. This technique is known as principal compo-
nent analysis, which is one of the main tool to extract information from a large
pool of data. In this course, we will see only an immediate use of eigenvectors
in the construction of basis that can be used for storing large matrix with limited
memory.
69
7.1. EIGENVALUES AND EIGENVECTORS 70
scope of this lecture note. In this course, we shall only focus on real eigenpairs.
Before we proceed to finding eigenvalues and the associated eigenvectors of a
matrix, let us show that eigenvectors associated to each eigenvalue, together with
the zero vector, form a vector space.
Exercise 7.2. Let 𝐿 be an 𝑈 ⇑ 𝑈 matrix and 𝜕 ↓ R be an eigenvalue of 𝐿. Then the
set
𝑖𝜕 = {0} ∋ {All eigenvectors of 𝜕.} = {𝑂 ↓ R𝑈 | 𝐿𝑂 = 𝜕𝑂}
is a vector space, which is called the eigenspace associated to 𝜕.
" #
1 1
Exercise 7.3. Let 𝐿 = . Then 𝜕 = 1 is an eigenvalue of 𝐿 and the associated
0 1
eigenvectors are any vectors along the 𝑁-axis. Also describe this geometrically.
Now, let us turn to a practical aspect of finding eigenvalues and their associated
eigenvectors. When one tries to solve the eigenvalue-eigenvector equation
𝐿𝑂 = 𝜕𝑂,
a di"culty arises from the fact that both scalar 𝜕 and nonzero vector 𝑂 are un-
knowns. Hence the right-hand-side product 𝜕𝑂 implies that the above equation
itself is nonlinear. However, we can rearrange the said equation into the following
form
(𝐿 → 𝜕𝑠)𝑂 = 0. (7.1)
In order to obtain 𝑂 ω 0, it is necessary to have
𝑘𝑅𝑙(𝐿 → 𝜕𝑠) = 0. (7.2)
Notice that the above equation is free of the unknown vector 𝑂. Writing down
the determinant further shows that (7.2) is in fact a polynomial, known as the
characteristic polynomial of 𝐿. The fundamental theorem of algebra then gurantees that
(7.2) always has repeatable 𝑈 complex solutions (provided that 𝐿 is of dimension
𝑈 ⇑ 𝑈).
Once eigenvalues 𝜕 are sorted out from the characteristic polynomial (7.2), we
return to (7.1) with the known 𝜕’s. This makes (7.1) simply a linear system for
each eigenvalues 𝜕.
Finally, let us write down a summary of steps to find all eigenvalues and
eigenvectors of a matrix 𝐿:
7.1. EIGENVALUES AND EIGENVECTORS 71
Step 2. Finding eigenvectors 𝑂’s associated to each 𝜕 by solving the linear systems
(𝐿 → 𝜕𝑠)𝑂 = 0.
Let us practice finding the eigenvalues and eigenvectors using the above pro-
cedures.
" #
0 1
Exercise 7.4. Let 𝐿 = . Then 𝐿 has no real eigenvalues.
→1 0
" #
→1 0
Exercise 7.5. Find all eigenvalues and eigenvectors of a matrix 𝐿 = .
2 0
Exercise 7.6. Find all eigenvalues and eigenvectors of the following matrices.
5 →10 →5 5 →6 →6
(a) 𝐿 =
2 14 2 (b) 𝑚 = →1 4 2
→4 →8 6 3 →6 →4
We end the section with a list of fundamental properties of the eigenvalues
and eigenvectors that could be useful for future use.
7.2 Eigenbasis
One of the most important features from the eigenpairs is the possiblity to con-
struct a new meaningful basis, called the eigenbasis, that simplifies the computation
related to a given matrix.
Definition 7.8 (Eigenbasis). Let 𝐿 be a square matrix of dimension 𝑈 ⇑ 𝑈. If 𝐿 has
linearly independent real eigenvectors 𝑂1 , . . . , 𝑂 𝑈 , then these eigenvectors form a
basis S = {𝑂 1 , . . . , 𝑂 𝑈 }. This special basis is called the eigenbasis generated by 𝐿.
Remark. According to the previous section, if 𝐿 has 𝑈 distinct real eigenvalues,
then the eigenvectors associated to each eigenvalues will automatically be linearly
independent.
Exercise 7.9. Find the eigenbases associated to each of the following matrices.
" # 1 0 →1 5 →10 →5
(b) 𝑚 = 0 2 0 (c) 𝑛 = 2 14 2
1 →3
(a) 𝐿 =
3 0 →1 0 →1 →4 →8 6
A stronger result could be drawn when 𝐿 is symmetric, and this is known as
the spectral theorem.
Theorem 7.10 (Spectral theorem). If 𝐿 is an 𝑈 ⇑ 𝑈 symmetric matrix, then 𝐿 has
eigenvectors 𝑂1 , . . . , 𝑂 𝑈 that form an orthonormal basis on R𝑈 . In simpler words, the
matrix 𝐿 has an orthonormal eigenbasis.
Let us confirm the spectral theorem with one of the matrices above.
1 0 →1
Exercise 7.11. Construct an orthonormal eigenbasis for 𝑚 = 0 2 0 .
→1 0 →1
7.3. DIAGONALIZATION 73
7.3 Diagonalization
Diagonalization is the process that changes the basis under which a square
matrix becomes a diagonal matrix. While it is not always possible to diagonalize
every matrix, there could be more than one way to diagonalize a matrix. However,
it turns out that a matrix is always diagonalized under its own eigenbasis. Let us
formally state these ideas below using a more tractable approach.
𝐿 = 𝑑𝑡𝑑 →1 .
𝑡 = [U △ S]𝐿[S △ U] = 𝐿U
U.
𝐿 = 𝑃ε𝑃 →1 ,
and recall that ε 𝑄 = diag(𝜕1𝑄 , . . . , 𝜕𝑈𝑄 ). Note that matrix power is widely used to
approximate the matrix exponential that appears frequently in system of ordinary
di!erential equations.
2 0 1
Exercise 7.15. Let 𝐿 = . Find 𝐿10 .
0 1 0
0 0 →1
𝐿 = 𝑑ϑ𝑃 ⇔ ,
where
▽
↑ ϑ = diag(𝜖1 , . . . , 𝜖𝑈 )𝑉⇑𝑈 , with 𝜖𝑌 = 𝜕 𝑌 and 𝜕1 ↘ 𝜕2 ↘ · · · ↘ 𝜕𝑈 ↘ 0 are the
eigenvalues of 𝐿⇔ 𝐿,
↑ 𝑃 is an 𝑈 ⇑ 𝑈 matrix whose 𝑌 th column, 𝑂 𝑌 , is the normalized eigenvector of 𝐿⇔ 𝐿
associated to 𝜕 𝑌 ,
1
↑ 𝑑 is an 𝑉 ⇑ 𝑉 matrix whose 𝑌 th column, 𝑋𝑌 , is given by 𝑋𝑌 = 𝜖𝑌 𝑂 𝑌 at 𝑌 in which 𝜖𝑌 >
0, and 𝑋𝑌 = 0 at 𝑌 in which 𝜖𝑌 = 0.
Remark. Some remarks are in order.
↑ The number of nonzero eigenvalues of 𝐿⇔ 𝐿 equals the rank of 𝐿.
7.5. QUADRATIC FORMS 75
The following fact highlights the reason why SVD is considered an important
factorization technique.
Theorem 7.17. Any matrix can be factorized using SVD.
Following this line, we now state the formal definition of a quadratic form of 𝑈
variables.
Definition 7.19 (Quadratic forms). A function 𝑞 : R𝑈 ↗ R is called a quadratic form
on R𝑈 if
/
𝑈 /
𝑈
𝑞(𝑁) = 𝑞(𝑁1 , . . . , 𝑁 𝑈 ) = 𝑝 𝑌𝑍 𝑁 𝑌 𝑁 𝑍 ,
𝑌=1 𝑍=𝑌
7.5. QUADRATIC FORMS 76
𝑞(𝑁) = 𝑁 ⇔ 𝐿𝑁.
𝑞(𝑁, 𝑇) = 2𝑁 2 + 3𝑁𝑇 + 𝑇 2 .
𝑞(𝑁1 , 𝑁2 , 𝑁3 ) = 2𝑁12 → 𝑁 2 𝑁3 + 𝑁 1 𝑁3 + 𝑁 32
Looking at Figure 7.1, one may make infer that a convex quadratic form is
suitable for minimization, a concave quadratic form is suitable for maximization,
and an indefinite one does not work well with both.
When a quadratic form 𝑞(𝑁) is converted into its matrix-vector form 𝑞(𝑁) =
𝑁 ⇔ 𝐿𝑁using the formula (7.3), such convexity could be observed through eigen-
values of 𝐿. Before we go to the main result, we first define the signs of a symmetric
matrix using the signs of its eigenvalues.
Remark. From the definition, one may observe that positive definiteness implies
positive semidefiniteness and similar to the negative counterpart.
The following result characterizes the convexity of a quadratic form using the
sign of its underlying matrix.
↑ indefinite ≃⇐ 𝐿 is indefinite.
Exercise 7.25. Classify the quadratic form 𝑞(𝑁) = 𝑁 ⇔ 𝐿𝑁, where 𝐿 is given as
follows.
" # 1 2 1
(b) 𝐿 = 2 →1 0
3 →2
(a) 𝐿 =
→2 3 1 0 0
When writing 𝑞(𝑁) as a matrix-vector form 𝑞(𝑁) = 𝑁 ⇔ 𝐿𝑁, the diagonal entries
are responsible for the pure terms’ coe"cients and the o!-diagonal entries are
corresponding to the cross terms.
At this stage, one may apply the diagonalization technique studied in the
Section 7.3 to the matrix 𝐿. Recall that 𝐿 is symmetric, so the spectral theorem
ensures that it has an orthonormal eigenbasis {𝑂 1 , . . . , 𝑂 𝑈 }, where 𝑂 𝑌 is an eigen-
vector of 𝐿 associated to an eigenvalue 𝜕 𝑌 . Let 𝑃 and ε be defined accordingly to
the diagonalization 𝐿 = 𝑃ε𝑃 →1 . From the orthonormality, we have
𝑃𝑃 ⇔ = 𝑠 = 𝑃 ⇔𝑃
𝐿 = 𝑃ε𝑃 ⇔
7.5. QUADRATIC FORMS 79
If we put 𝑞ˆ (𝑇) = 𝑇 ⇔ ε𝑇, then 𝑞ˆ is a quadratic form that has no cross terms.
We have just showed that the diagonalization technique could always be ap-
plied to find a new basis (in this case the orthonormal eigenbasis) under which
the cross terms are eliminated.
Exercise 7.26. Use the diagonalization technique to eliminate the cross terms of
the quadratic form 𝑞(𝑁) = 𝑁 ⇔ 𝐿𝑁, where 𝐿 is given below.
" # 1 2 1
(b) 𝐿 = 2 →1 0
3 →2
(a) 𝐿 =
→2 3 1 0 0
7.5. QUADRATIC FORMS 80
Practice problems
1. Find all eigenvalues and eigenvectors of the following matrices:
3 0 →2 1 0 3
↑ 𝐿 = 0 1 0 ↑ 𝑚 = 0 2 0
1 →1 0 3 0 →1
1 0 0 →2 0 0
↑ 𝑛 = 0 3 4 ↑ 𝑡 = 0 3 0
0 0 1 1 3 2
2. Find the eigenbasis, whenever possible, from the matrices 𝐿, 𝑚, 𝑛, 𝑡 above.
Chapter 8
Applications
𝑣 (𝑁) = 𝑁 ⇔ 𝐿𝑁 + 𝑀 ⇔ 𝑁 + 𝑝,
𝑀
𝐿𝑁 = → .
2
81
8.2. LEAST-SQUARES SOLUTIONS OF LINEAR SYSTEMS 82
Figure 8.1: A convex and concave quadratic function with their extreme points.
Exercise 8.3. Find all minimizers of the convex quadratic function 𝑣 (𝑁) = 𝑁 ⇔ 𝐿𝑁 +
𝑀 ⇔ + 𝑝 with
" # " #
1 0 →2
𝐿= , 𝑀= , 𝑝 = →1.
0 0 0
The first important fact is that we can always find a least-squares solution even
if the linear system has no solution in the classical sense.
8.2. LEAST-SQUARES SOLUTIONS OF LINEAR SYSTEMS 83
𝑗(𝑁) = ↔ 𝐿𝑁 → 𝑀↔ 2
= (𝐿𝑁 → 𝑀)⇔ (𝐿𝑁 → 𝑀)
= (𝑁 ⇔ 𝐿⇔ → 𝑀 ⇔ )(𝐿𝑁 → 𝑀)
= 𝑁 ⇔ 𝐿⇔ 𝐿𝑁 → 𝑀 ⇔ 𝐿𝑁 → 𝑁 ⇔ 𝐿⇔ 𝑀 + 𝑀 ⇔ 𝑀
= 𝑁 ⇔ (𝐿⇔ 𝐿)𝑁 → 2(𝐿⇔ 𝑀)⇔ 𝑁 + 𝑀 ⇔ 𝑀.
𝐿⇔ 𝐿𝑁 = 𝐿⇔ 𝑀.
Let us first show that the least-squares solutions coincide with the classical
solutions for consistent systems.
Theorem 8.8. If a linear system 𝐿𝑁 = 𝑀 is consistent, then the least-squares solutions are
exactly the classical solutions.
2𝑁 1 + 3𝑁 2 = 2
𝑁1 → 𝑁2 = 1
𝑁1 + 4𝑁 2 = 0
8.3. LINEAR REGRESSION 84
Exercise 8.10. Show that the following system has no classical solution and find
the least-squares solution
𝑁1 + 𝑁2 =0
2𝑁 1 + 𝑁 3 =2
𝑁2 → 𝑁3 = →1
𝑁1 + 𝑁3 = 1.
Exercise 8.11. A scientist is experimenting a new drug that slows down the growth
of certain species of bacteria under a controlled environment. The procedures are
as follows: The initial colony of 1 CFU (colony-forming unit) is deployed in an
agar plate. For 60 minutes, the scientist will observe the number of bacterial cells
every 5 minutes. The following is the observed data
Write the linear system for the linear regression that estimate the data in the
above table.
X̂ = { 𝑁ˆ 1 , . . . , 𝑁ˆ 𝑉 } ∞ R𝑈 .
One of the naïve methods to reduce the data dimension is to delete some of the
features from the dataset. However, this does not retain the most information
possible. Instead, we seek an orthogonal projection onto a lower-dimensional
8.4. PRINCIPAL COMPONENT ANALYSIS 87
X = {𝑁1 , . . . , 𝑁 𝑉 },
1 /
𝑉
𝑁 𝑌 = 𝑁ˆ 𝑌 → 𝑁,
¯ 𝑁¯ = 𝑁ˆ 𝑌 .
𝑉
𝑌=1
1 /
𝑉
1
= 𝑁𝑌 𝑁⇔
𝑌 = 𝑥𝑥 ⇔ ,
𝑉 𝑉
𝑌=1
𝜕1 ↘ 𝜕2 ↘ · · · ↘ 𝜕 𝑈 ↘ 0
for all 𝑍 = 1, . . . , 𝑄.
X∈ = {𝑁1∈ , . . . , 𝑁 𝑉
∈
} ∞ 𝑃,
𝑁 ∈𝑌 = proj𝑃 (𝑁 𝑌 ), 𝑌 = 1, . . . , 𝑉.
8.5. IMAGE COMPRESSION 88
Figure 8.3: The orthogonal projection of 3-dimensional data onto the first two
principal components.
𝐿 = 𝑑ϑ𝑃 ⇔ ,
where we recall that 𝑑 ↓ R𝑉⇑𝑉 , ϑ ↓ R𝑉⇑𝑈 and 𝑃 ↓ R𝑈⇑𝑈 . Also, remember that
the information is stored in 𝑑 and 𝑃 at columns 𝑌’s such that 𝜖𝑌 > 0. Moreover,
8.5. IMAGE COMPRESSION 89
𝐿 ′ 𝐿 𝑄 = 𝑑 𝑄 ϑ 𝑄 𝑃𝑄⇔ ,
↑ ϑ 𝑄 = diag(𝜖1 , . . . , 𝜖 𝑄 ) 𝑄⇑𝑄 ,
↑ 𝑃𝑄 = [𝑂1 𝑂2 . . . 𝑂 𝑄 ]𝑈⇑𝑄 .
This method is sometimes called the low-rank approximation or rank 𝑄 approximation,
due to the fact that the full image is approximated up to the rank 𝑄 matrix 𝐿 𝑄 .
Note that 𝐿 𝑄 maintains the dimension 𝑉 ⇑ 𝑈 of the original data.
Figure 8.4: The original image and its rank 𝑄 approximations for 𝑄 = 5, 20, 50, 100.
You’re now on your own, kid!
Outroduction.
I truly hope you did learned some boring mathematics but, in the back of your
head, aware how creative stu!s are made out of it.
Linear algebra, like many other branches of mathematics, are milestones in
bleeding-edge technologies around us.
Good engineers know how things work.
Great engineers know how to make them better!