You are on page 1of 34

EE1009-A

工程數學-線性代數
(Engineering Mathematics-Linear Algebra)

Lecture 2

Teacher : 吳俊緯 (Jim-Wei Wu) 博士


Office : 電機系E1-318 (EE Building, E1-318)
E-Mail : jimweiwu@ee.ncu.edu.tw

NCUEE, Jim-Wei Wu, 110_1 1


Chapter 1 Matrixes and Systems of Equations
(矩陣與方程式系統)

1.1 Systems of Linear Equations (線性方程式系統)


1.2 Row Echelon Form (列梯形式)
1.3 Matrix Arithmetic (矩陣算術)
1.4 Matrix Algebra (矩陣代數)
1.5 Elementary Matrices (基本矩陣)
1.6 Partitioned Matrices (矩陣分割)

NCUEE, Jim-Wei Wu, 110_1 2


P42

1.3 Matrix Arithmetic (矩陣算術)


• Matrix Notation (矩陣記號)
A m×n matrix A can be represented as
 a11 a12  a1n 
a a  a  𝑖 = 1~𝑚
A   21 22 2n
 A = (aij) ቊ
𝑗 = 1~𝑛
  
a  
 m1 a m2 a mn 
aij : 表示矩陣A在第i列(row)第j行(column)
的元素(entry)。
Entry (元素) : scalars (real or complex number)

• Vector (向量)
(1) Row vector (列向量): a 1×n matrix, e.g., [a1, a2, …, an]
 a1 
(2) Column vector (行向量): a n×1 matrix , e.g., a 
 2 Rn 歐幾里德 n 度空間
 (Euclidean n-space)
a 
 n
NCUEE, Jim-Wei Wu, 110_1 3

 a11 a12  a1n   a1  P43
a a22  a2 n   a 
A   21 
A 2 or A = (a1, a2, ..., an)
  
a 
 m1 am 2  amn  a 
 m

a) The ith row vector of a m×n matrix A : i  (ai1 , ai 2 ,  , ain )
a

b) The jth column vector of a m×n matrix A :


aj

Example 1

 3 2 5
A 
  1 8 4 
 
and a1  (3, 2, 5), a 2  ( 1, 8, 4)
A = (a1, a2, a3) =
NCUEE, Jim-Wei Wu, 110_1 4
P44
Definition of Equal (相等的)
Two m×n matrices A and B are said to be equal if aij = bij for
each i and j.
𝑎11 𝑎12 𝑎13 𝑏11 𝑏12 𝑏13
𝐴= 𝑎 𝐵=
需相同維度 21 𝑎22 𝑎23 𝑏21 𝑏22 𝑏23

Definition of Scalar Multiplication (純量乘法)


If A is an m×n matrix and 𝛼 is a scalar, then 𝛼A is the m×n matrix
whose (i, j) entry is 𝛼aij.
𝛼a12

Example : 1  2 4 1
a12 then A 
2 3 4 5 
4 8 2
If A 
 6 8 10   12 24 6 
and 3 A   
18 24 30
NCUEE, Jim-Wei Wu, 110_1 5
P44
Definition of Matrix Addition (矩陣加法)
If A = (aij) and B = (bij) are both m×n matrices, then the sum A+B is
the m×n matrix whose (i, j) entry is aij+bij for each ordered pair (i, j).
需相同維度

a12+b12 = 4
Example :
2×3 matrix A 2×3 matrix B

 3 2 1  2 2 2   5 4 3
 4 5 6   1 2 3   5 7 9
     
3×1 matrix A 3×1 matrix B
 2   8  6 
1    3    4 
     
 8   2  10 
NCUEE, Jim-Wei Wu, 110_1 6
P45
Matrix Multiplication (矩陣乘法)
CASE 1 : One Equation in N Unknowns
• For a linear equation of n unknowns of the form:
a1x1 + a2x2 + ... + anxn = b
 x1 
If we let A = [a1, a2, ..., an] and x =  x2 
 

x 
Ax = a x + a x + . . . + a x
1 1 2 2 n n  n

then the system can be written in the form Ax = b.

Example : 3x1 + 2 x2 + 5 x3 = 4

 x1 
Ax  3 2 5  x2   3 x1  2 x2  5 x3 = 4
 
 x3 
NCUEE, Jim-Wei Wu, 110_1 7
P46
CASE 2 M Equations in N Unknowns
• Consider a m×n linear system

a11x1 + a12x2 + … + a1nxn = b1


a21x1 + a22x2 + … + a2nxn = b2
. Ax = b
.
.
am1x1+ am2x2 + …+ amnxn = bm

 a11 a12  a1n   x1   b1   a11 x1  a12 x2  ...  a1n xn 


a a22  a2 n  x  b   a x  a x  ...  a x 
A   21 , x   , b   2 
2
Ax   21 1 22 2 2n n 
      
a  amn  x  b   
 m1 am 2    m x 
 m1 1 m 2 2
a a x  ...  a mn n 
x
n

coefficient matrix
NCUEE, Jim-Wei Wu, 110_1 8
P47

Example :
 x1 
 4 2 1 x   4 x1  2 x2  x3 
A  , x   Ax   
 5 3 7   2
 1
5 x  3 x  7 x3
 x3 
2

2×3 matrix 2×1 matrix


3×1 matrix

Example :

 3 1  3  2  1 4   2 
  2
A 2 5 , x   Ax   2  2  5  4    24 
     
 4
 4  2  2  4  16 
 4 2 
3×2 matrix 2×1 matrix 3×1 matrix

NCUEE, Jim-Wei Wu, 110_1 9


P48

• The product Ax can also be expressed as a sum of column vectors:

 a11 x1  a12 x2    a1n xn   a11 x1   a12 x2   a1n xn 


 a x  a x  a x  a x   a x  a x 
Ax   21 1 22 2 2n n
   21 1    22 2     2n n 
        
a x  a x    a x       
 m1 1 m 2 2 mn n   m1 1   m 2 2 
a x a x  mn n 
a x

 a11   a12   a1n 


a  a  a 
 x1  21   x2  22    xn  2 n 
     
     
 m1 
a  am 2   amn 
 x1a1  x2a 2   xna n (6)

NCUEE, Jim-Wei Wu, 110_1 10


P48
Definition of Linear Combination (線性組合) Rm : m×1 matrix

If a1, a2, …, an are vectors in Rm and c1, c2, …, cn are scalars, then
a sum of the form
c1a1 + c2a2 + . . . + cnan
is said to be a linear combination of the vectors of a1, a2, …, an.
• A linear system is :
2 x1  3 x2  2 x3 5  2 3   2  5 
x1    x2    x3     
5 x1  4 x2  2 x3 6 5    4  2  6 

We choose x1 = 2, x2 = 3, and x3 = 4
2
5   2  3    2
 6   2  5   3  4   4  2   x  3 是線性系統的解
         
4
是三個column vectors的線性組合
NCUEE, Jim-Wei Wu, 110_1 11
P49

Theorem 1.3.1
A linear system Ax = b is consistent if and only if b can be written
as a linear combination of the column vectors of A.

Example :
x1  2 x2  1 1  2  x1  2 x2 
 x1    x2     
2 x1  4 x2  1  
2    1
4 2 x  4 x 2

由於向量
1 不能寫成column vector
1 2 的線性組合
1 找不到(𝑥1 , 𝑥2 )可以滿足
2 4

Ax = b is inconsistent (no solution)


NCUEE, Jim-Wei Wu, 110_1 12
P50
Definition of Matrix Multiplication (矩陣乘法)
If A = (aij) is a m×n matrix and B = (bij) is a n×r matrix, then the
product AB = C = (cij) is the m×r matrix whose entries are defined
by  n
cij  a i b j   aik bkj
k 1

3 × 2 matrix
2 × 3 matrix
 3 2 
 2 1 3
If A   2 4  and B   
   4 1 6 
1 3
3  (2)  (2)  4 3 1  (2) 1 3  3  ( 2)  6 
AB   2  (2)  4  4 2 1  4 1 23  46 
 
1  (2)  (3)  4 1 1  (3) 1 1  3  (3)  6 
 14 1 3
  𝐴𝐵 = 3 × 3 matrix
 12 6 30
  𝐵𝐴 = 2 × 2 matrix
 14 2 15 NCUEE, Jim-Wei Wu, 110_1 13
矩陣乘法不符合交換律 P51
Note :
Multiplication of matrices is not commutative (i.e., AB ≠ BA).

Example :
1 1  1 1 
If A    and B   
 0 0   2 2 

1 1   1 1  3 3
then AB    2  
 0 0  2  0 0
 1 1  1 1  1 1
and BA    0  
 2 2  0  2 2
Hence, AB  BA.
NCUEE, Jim-Wei Wu, 110_1 14
P51

Example :

3 4   1 3  2 1 
If A    , B  , C 
1 2   2 1   3 2 

3 4   7 7  10 11
then A  BC       
1 2   1 4   0 6 

9 12  1 3 10 15
and 3 A  B    +  = 
 3 6   2 1   5 7 

NCUEE, Jim-Wei Wu, 110_1 15


P56
The Transpose of a Matrix (矩陣轉置)
Definition of Matrix Transpose (矩陣轉置)
The transpose of a m × n matrix A is the n × m matrix B defined
by
bji = aij
for j = 1, . . . , n and i = 1, . . . ,m. The transpose of A is denoted
by AT .
2×3 matrix 3×2 matrix
1 4 
1 2 3
(a) If A    , then AT   2 5  .
4 5 6  
 3 6  Row vector
變成
 3 2 1   3 4 1  Column vector
(b) If B   4 3 2  , then BT   2 3 2  .
   
 1 2 5   1 2 5 
NCUEE, Jim-Wei Wu, 110_1 16
P56
Definition of symmetric matrix (對稱矩陣)
An n × n matrix A is said to be symmetric if AT = A.

2 3 4 0 1 2  AT = A
1 0   , 1 1 2 
Example: ,
0 4   3 1 5
    
 4 5 3   2 2 3 symmetric matrix

Section 1.3 Exercises


Page 60

Answers to Selected Exercises (Page 536)


NCUEE, Jim-Wei Wu, 110_1 17
1.3 重點回顧與整理

NCUEE, Jim-Wei Wu, 110_1 18


P62

1.4 Matrix Algebra (矩陣代數)


Rules :
a and b : scalars (純量)
A, B, and C : any matrices

1. A + B = B + A 6. (ab)A = a(bA)
2. (A + B) + C = A + (B + C) 7. a(AB) = (aA)B = A(aB)
3. (AB)C = A(BC) 8. (a + b)A = aA + bA
4. A(B + C) = AB + AC 9. a(A+B) = aA + aB
5. (A + B)C = AC + BC

NCUEE, Jim-Wei Wu, 110_1 19


P62

A  (aij ) m×n matrix


Proof of Rule 4
B  (bij ) n×r matrix
C  (cij ) n×r matrix

(1) D  A( B  C ) m×r matrix


𝑑11 … 𝑑1𝑟 𝑎11 … 𝑎1𝑛 𝑏11 … 𝑏1𝑟 𝑐11 … 𝑐1𝑟
⋮ ⋱ ⋮ = ⋮ ⋱ ⋮ ⋮ ⋱ ⋮ + ⋮ ⋱ ⋮
𝑑𝑚1 … 𝑑𝑚𝑟 𝑎𝑚1 … 𝑎𝑚𝑛 𝑏𝑛1 … 𝑏𝑛𝑟 𝑐𝑛1 … 𝑐𝑛𝑟
n
d ij   aik (bkj  ckj )
k 1
(2) E  AB  AC m×r matrix
𝑒11 … 𝑒1𝑟 𝑎11 … 𝑎1𝑛 𝑏11 … 𝑏1𝑟 𝑎11 … 𝑎1𝑛 𝑐11 … 𝑐1𝑟
⋮ ⋱ ⋮ = ⋮ ⋱ ⋮ ⋮ ⋱ ⋮ + ⋮ ⋱ ⋮ ⋮ ⋱ ⋮
𝑒𝑚1 … 𝑒𝑚𝑟 𝑎𝑚1 … 𝑎𝑚𝑛 𝑏𝑛1 … 𝑏𝑛𝑟 𝑎𝑚1 … 𝑎𝑚𝑛 𝑐𝑛1 … 𝑐𝑛𝑟
n n
eij   aik bkj   aik ckj d ij  eij A(B + C) = AB + AC
k 1 k 1 NCUEE, Jim-Wei Wu, 109_1 20
Equal (P44)
P63
Proof of Rule 3
A : m×n matrix
B : n×r matrix (AB)C = A(BC)
C : r×s matrix
entry entry
r r
 n 
 d il clj     aik bkl clj
n
D  AB d il   aik bkl DC
A row 乘 B column k 1 l 1 l 1  k 1 
D row 乘 C column
entry r entry
ekj   bkl clj
n n
 r 
E  BC
l 1
AE 
k 1
aik ekj   aik   bkl clj 
k 1  l 1 
B row 乘 C column A row 乘 E column
n×s
r
 n  r
 n  n  r 
   aik bkl clj     aik bkl clj    aik   bkl clj 
l 1  k 1  l 1  k 1  k 1  l 1 

NCUEE, Jim-Wei Wu, 110_1 21


P63
Example 1
1 2  2 1 1 0 
A  ,B  , and C   
3 4    3 2   2 1 
BC
1 2 4 1   6 5 
 A(BC )       
3 4 1 2 16 11
AB A(BC) = (AB)C
  4 5  1 0   6 5 
 ( AB)C       
  6 11 2 1 16 11

B+C

AC A(B + C) = AB + AC

NCUEE, Jim-Wei Wu, 110_1 22


P64

Notation (記號):
• If A is an n×n matrix and k is a positive integer (正整數):
Ak  
AA A
k times

1 1 1 1 1 1 2 2
If A    , A 
2
    
1 1 1 1 1 1  2 2 

1 1 2 2 4 4
A  AAA  AA  
3 2
    
1 1 2 2   4 4 
Ak  
AA A 2 𝑘−1
= 𝑘−1 2𝑘−1
k times 2 2𝑘−1
NCUEE, Jim-Wei Wu, 110_1 23
P67

The Identity Matrix (單位矩陣)


Definition of identity matrix
The identity matrix is the n×n matrix I = (𝛿 ij), where
1 if i  j
 ij  
0 if i  j

I=

• The identity matrix I for any matrix A multiplication will serve


as
IA = AI = A
NCUEE, Jim-Wei Wu, 110_1 24
P68

Example :

1 0 0
0 1 0  is a 3×3 identity matrix
 
0 0 1

1 0 0 3 4 1 3 4 1
0 1 0 2 6 3  2 6 3 ( IA  A)
    
0 0 1 0 1 8 0 1 8

3 4 1 1 0 0 3 4 1
2 6 3 0 1 0  2 6 3 ( AI  A)
    
0 1 8 0 0 1 0 1 8

NCUEE, Jim-Wei Wu, 110_1 25


P68
Matrix Inversion (反矩陣)
• A real number a is said to have a multiplicative inverse (乘法
反元素) if there exists a number b such that ab = 1.
• Any nonzero number a has a multiplicative inverse b=1/a.
Definition of Matrix Inversion
An n×n matrix A is said to be nonsingular (非奇異的) or invertible
(可逆的) if there exists a matrix B such that AB = BA = I. The matrix
B is said to be a multiplicative inverse (乘法反元素) of A.

(1) 若 B 與 C 矩陣兩者都是 A 矩陣的乘法反元素,則


B = BI = B(AC) = (BA)C = IC = C
(2) 一個矩陣最多只擁有一個乘法反元素。
(3) A 的乘法反元素即為 A 的反矩陣 (inverse) 且以 A–1 表示。

NCUEE, Jim-Wei Wu, 110_1 26


P69
A B
Example :
1 2 3 1  2 5 
The 3×3 matrices 0 1 4 and 0 1  4
0 0 1  0 0 1 
are inverse
AB = BA = I
A B I
1 2 3 1  2 5  1 0 0
0 1 4  0 1  4   0 1 0 
    
0 0 1  0 0 1  0 0 1
B A I
1  2 5  1 2 3 1 0 0
0 1  4  0 1 4   0 1 0 
    
0 0 1  0 0 1  0 0 1

AB = BA = I A的反矩陣 (inverse)為B= A–1


NCUEE, Jim-Wei Wu, 110_1 27
P69

Example :
1 0 
The matrix A    has no inverse.
 0 0 
1 b11 b12 
Sol: Let A B 
 21 22 
b b

then
I
b11 b12  1 0 b11 0 1 0
BA         
b21 b22  0 0 b21 0 0 1

Definition of Singular Matrix (奇異的矩陣)


乘法反元素
A n×n matrix is said to be singular if it does not have a multiplicative
inverse (A–1).

NCUEE, Jim-Wei Wu, 110_1 28


P69
存在A–1和B–1
Theorem 1.4.2
• If A and B are nonsingular n × n matrices, then AB is
also nonsingular and (AB)–1 = B–1A–1
Proof

(B–1A–1) AB = B–1(A–1A)B = B–1 I B = B–1B = I = (AB)–1AB


AB(B–1A–1) = A(BB–1)A–1 = A I A–1 = AA–1 = I = AB(AB)–1

Note
• If A1, A2,…, Ak are all nonsingular n × n matrices, then
the product A1A2…Ak is nonsingular and
(A1A2…Ak)–1 = Ak–1… A2–1A1–1
NCUEE, Jim-Wei Wu, 110_1 29
P70
The Transpose of a Matrix (矩陣轉置)
Rules of Transposes
1. (AT)T = A
2. (aA)T = aAT
3. (A + B)T = AT + BT
4. (AB)T = BTAT

Why :

A is m × n matrix AB is m × r matrix
BTAT is r × m matrix
B is n × r matrix (AB)T is r × m matrix

NCUEE, Jim-Wei Wu, 110_1 30


P71
Example :
1 2 1 1 0 2 
 3 5 , B   2 1 1 
Let A  3   
2 4 1 5 4 1 
1 2 1 1 0 2 10 6 5 
AB  3 3 5 2 1 1   34 23 14
    
2 4 1 5 4 1  15 8 9 
10 34 15
( AB)T   6 23 8 
 
 5 14 9 
1 2 5 1 3 2 10 34 15
B T AT  0 1 4 2 3 4   6 23 8 
    
2 1 1  1 5 1   5 14 9 
NCUEE, Jim-Wei Wu, 110_1 31
Section 1.4 Exercises
Page 73

Answers to Selected Exercises (Page 537)

NCUEE, Jim-Wei Wu, 110_1 32


1.4 重點回顧與整理

NCUEE, Jim-Wei Wu, 110_1 33


Lecture 2

Q&A?

NCUEE, Jim-Wei Wu, 110_1 34

You might also like