Download as pdf or txt
Download as pdf or txt
You are on page 1of 83

ĐẠI HỌC FPT CẦN THƠ

Chapter 2
Matrix Algebra

MSc. Nguyen Cam Nhiem


Email: nhiemnc@fe.edu.vn

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Contents
2.1 Matrix Addition, Scalar Multiplication, and Transposition

2.2 Matrix Multiplication (2.3 7e)

2.3 Matrix Inverses (2.4 7e)

2.5 Matrix Transformations (2.2 & 2.6 7e)

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

2.1. Matrix Addition, scalar


multiplication and transposition

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Definitions
 An mxn matrix (or a matrix of size mxn) is
a rectangular array of numbers with m
rows and n columns
3 columns
the (1,3)-entry of A

 2 3 5 
A  2 rows
1 0 4 
A is a 2x3 matrix (or a matrix of size 2x3)
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

The mxn matrix


 The (i,j)-entry of A (denoted by aij) lies in
row i and column j
 A is denoted simply as A=[aij]

 a11 a12 ... a1n  2 refers to the row

a a22 
... a2 n 
A  21

 ... ... ... ...  n refers to the column

 
 am1 am 2 ... amn 

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Definitions
 An mxm matrix is called a square matrix (ma
trận vuông) of size m.
 If A=[aij] is any mxn matrix, then a11,a22,a33,…, are
called the main diagonal (đường chéo chính) of
A.
 The zero matrix (ma trận không) of size mxn
(denoted by (0mxn)is the matrix that its all entries
are 0
 If A=[aij] is an mxn matrix then -A refers to the
negative matrix (ma trận đối) of A and defined by
-A=[-aij]

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Identity matrices (ma trận đơn vị)

1 0 0 
1 0  
I2    , I 3   0 1 0  ,...
0 1 0 0 1 
An identity matrix I is a square matrix with 1’s on the
main diagonal and zeros elsewhere

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Triangular matrices
 Upper triangular matrix: all entries below and to the
left the main diagonal are zeros
 Lower triangular matrix: its transposition is upper
triangle matrix, that means every entry above and to
the right the main diagonal is zero
 Matrix A is called triangular if it is upper or lower
triangular
 For example, every row-echelon matrix is upper
triangular 2 0 0 0
 0 5 3 0 
 2 0 0 0
U   L   2 0 0 0 
0 0 0 0
   7 8 5 0 
 0 0 0 0 
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Two matrices are called equal if


 They have the same size
 Corresponding entries are equal
If A=[aij], B=[bij] then A=B means aij=bij for
all i and j

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Matrix Addition of same size


matrices
 If A=[aij], B=[bij] then the sum matrix A+B is
defined by A+B=[aij+bij]
 The difference A-B is a matrix defined by
A-B=A+(-B)=[aij-bij] for all mxn matrices A
and B

Note that A-A=0, A+0=A (0 is zero matrix)


for all mxn matrix A
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Properties
If A ,B and C are any matrices of the same
size, then
 A+B=B+A (commutative law: giao hoán)
 A+(B+C)=(A+B)+C (associative law: kết
hợp)

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Scalar Multiplication
(phép nhân vô hướng)
 Suppose A=[aij] is an mxn matrix and k is
a real munber, the scalar multiple kA is
a matrix defined by kA=[kaij]
 kA=0 (either k=0 or A=0)
 (k=0 or A=0)kA=0

Scalar: a quantity that has magnitude, but not direction; -- distinguished from a
vector, which has both magnitude and direction (Webster Dictionary)  One
value

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Transpose
 If A=[aij]is any mxn matrix,the
transpose of A, written AT, is an nxm
matrix defined by AT=[aji]

 The row i of A is the column i of AT


 The column j of A is the row j of AT

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Theorem 2
 (AT)T=A
 (kA)T=k(AT)
 (A+B)T=AT+BT

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Definitions
 If A=[aij]
is any mxn matrix, then
a11,a22,a33,…, are called the main
diagonal (đường chéo chính) of A
 If A=AT then A is called symmetric
(đối xứng). In this case, A is a
square matrix

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Dot product (tích vô hướng)


Example

 3
 
1 2 3   2   1 3  2  2  3 1  10
1
 

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

2.2 Matrix Multiplication


 Suppose A=[aij] is an mxk matrix and B=[bij] is an
kxn matrix, then the product AB=[cij] is an mxn
matrix whose the (i,j)-entry is the dot product of
row i of A and column j of B
 cij=(row i of A).(column j of B)
 Note that AmxkBkxn is a mxn matrix
 1 2 1.1+2.1
3 4 1 2 
  1 0  1 2   
 0  1      -1 -2 -1 0 
  2 0  1 2 1 0   -2 0 2 -4 
   
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
1 1 a b
A  ; B   
0 0  1 0
Find B such that:
 B commutes with A
 B2 is zero matrix

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Matrix and system of linear


equations
 Consider the system
a11 x1  a12 x2  ...  a1n xn  b1
a x  a x  ...  a x  b
 21 1 22 2 2n n 2

.........................................
am1 x1  am 2 x2  ...  amn xn  bm

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

AX  B

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

two parameters
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

linear combination of X1,X2

basic solutions

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

basic solutions

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Theorem 3
Let A be an mxn matrix of rank r, AX=0 is an homogeneous in n
variables. Then:
 The system has exactly n-r basic solutions, one for each
parameter.
 Every solution is a linear combination (tổ hợp tuyến tính) of
these basic solutions.
basic solutions

linear combination
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Exercises 11, 12 p67

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Directed Graph
 Points=vertices
 Vertices are connected by arrows called
edges
 If a directed graph has n vertices
v1,v2,…,vn, the adjacency matrix A=[aij] is
the nxn matrix
 The (i,j)-entry is only 1 or 0
 If there is an edge from vj to vertex vi then
aij=1 else aij=0
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Directed Graph
 a11=1 means v1v1
 a23=1 means v3v2
 a32=0 means have no edges from
vertex 2 to vertex 3
 A path of length r (or an r-path) from
vertex j to vertex i is a sequence of r 1 1 0 
edges leading from vj to vi. 1 0 1 
 
 v1v2v1v3v2 is a 4-path from v1 1 0 0 
to v2

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Theorem 6
 If A is the adjacency matrix of a
directed graph with n vertices, then
the (i,j)-entry of Ar is the number of
r-paths vjvi  1 1 0
 
For example, in A , (2,1)-entry is 3, A  1
3 0 1


so there are three 3-paths from v1
1 0 0 
to v2
 There are one 3-paths from v2 to 4 2 1
v3 as (3,2)-entry of A3 is 1 
A  3 2 1
3 
 2 1 1 
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Exercises 26 - p68

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

2.3 Matrix Inverse

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Definition
 If A is a square matrix, a matrix B is called an
inverse (nghịch đảo) of A if and only if AB=I
and BA=I
 A matrix A that has an inverse is called an
invertible (khả nghịch) matrix.

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
 Show that A3=I and find A-1 if

0 1
A 
1 1

 Solve the system AX=B with B=[1 2]T

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
 We have
 1 1 
A  AA  
2

 1 0 

 1 1  0 1 1 0
A  A A
3 2
      I2
 1 0 1 1 0 1 

 And, A3= A2A=AA2=I2


 So, A-1=A2

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
AX  B  A AX  A B
1 1

 1 1  1   1 
 X A B
1
    
 1 0  2   1

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Theorem 2
Suppose AX=B is a system of n
equations in n variables and A is an
invertible matrix. Then the system has
the unique solution
X=A-1B

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

The inverse of an 2x2 matrix


 Consider the matrix a b 
A 
 c d 

 The determinant of A is detA=ad-bc


 d b 
 The adjugate matrix of A is defined by adjA   
  c a 

1 1  d b 
A 
1
adjA   
det A det A  c a 
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

The inverse of 2x2 matrix


a b 
If A 
c d 
 
1 1  d b 
then A  adjA 
1

det A  
det A  c a 
3 2
A 
 1 1
1  1 2  1 2 
 1 2 A  
1
  
adjA    1  1 3   1 3
 1 3 
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Find the inverse of the following matrices

 4 3  2 1
A  B 
 6 5  7 5
1 2  a 2
C  D 
4 8  1 a 
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Matrix Inversion Algorithm


elementary row operations
 A I         I A -1

input
output

Theorem 3.
Either any square matrix can be reduced to I or not.
In the first case, the algorithm produces A-1;
in the second, A-1 does not exist.
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Example
 Find the inverse of the matrix

 1 0 1

A 3 2 0  
 1 1 0 

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
 1 0 1 1 0 0 r2  r2 3 r1
r3  r3  r1
1 0 1  1 0 0
 3 2 0  0 1 0   0 2 3   3 1 0 
     
 1 1 0  0 0 1  0 1 1  1 0 1 

 1 0 1  1 0 0
r r
2


3
 0 1 1 1   0 1 
  
0 2 3   3 1 0 
1 0 1  1 0 0 1 0 1  1 0 0 
r  r r r  2 r
 0 1 1   1 0 1  0 1 1   1 0 1
2 2 3 3 2

     
0 2 3   3 1 0  0 0 1   1 1 2 
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Example
r2 r2  r3
r1  r1  r3
1 0 0   0 1 2 
 0 1 0   0 1 3
  
0 0 1   1 1 2 

0 1 2
A1   0 1 3
 1 1 2 

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Properties
Theorem 4
 (A-1)-1=A
 (AB)-1=B-1A-1
 (AT)-1=(A-1)T
 (A1A2…Ak)-1=Ak-1…A2-1A1-1
 (Ak)-1=(A-1)k
 (aA)-1=A-1/a
 I-1=I

Corollary. A square matrix A is invertible iff AT is invertible

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
 Find A if
 2 1
A  2I 
1
T
 
 1 0

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
 Find A if
 2 1
A  2I 
1
T
 
 1 0

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Theorem 5
The following conditions are equivalent for an nxn
matrix A
 1. A is invertible
 2. The homogeneous system AX=0 has only the trivial
solution X=0
 3. A can be carried to In by elementary row operations
 4. The system AX=B has unique solution for every
choice of column B
 5. There exist an nxn matrix C such that AC=In

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

2.5. Matrix Transformations


(phép biến đổi ma trận)

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Definitions
 (a1,a2,…,an): ordered n-tuple
 a1 
 Rn: the set of all ordered
a 
n-tuples
 2
 Every (a1,a2,…,an) in Rn is called
 ... 
a vector or n-vector
 
a n 

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Transformations
Rn Rm
X T T(X)

Two transformations T and S are called equal iff


T(X)=S(X) , for all X in Rn
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Transformations

 x
 y
 

 x 
 y 
 
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Formula of the Transformation


 T[x1 x2 x3]T=[x1 x1-x2 x2-x3 x3-x1]T defines
a transformation T:R3R4
 Suppose A is an mxn matrix, then
T[x1 x2 … xn]T=A[x1 x2 … xn]T ( T(X)=AX ) is a
transformation T: RnRm called the matrix
transformation induced by A
 A is zero matrix: the zero transformation T=0
 A is identity matrix In: the identity
transformation T= 1 n

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Transformation induced by a matrix A

Matrix Multiplication (T)


X T(X)=AX

Matrix transformation induced by A

0: n
 m
1 : n
n
 m

X 0X  0 X In X  X
T(X)=0X=0 T(X)=IX=X
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Example
1 2 4
A 
0 3 5 
 x1   x1 
  1 2 4    x1  2 x2  4 x3 
X   x2  T(X)=AX
0 3 5   x2   0 x  3x  5 x 
  x   1 3  21
 x3 
2
 3

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
a 0  x  a>1:X-expansion of R2
A  X  
0 1  y
 0<a<1:X-compression of R2
 x  TX  AX  a 0  x   ax 
 y  0 1  y    y 
      

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
1 0   x
A  X  
 0 b   y

 x  TX  AX 1 0  x   x 
 y 0 b   y   by 
      

 b>1:Y-expansion of R2
 0<b<1:Y-compression of R2

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
1 a   x
A  X    a>0: Positive
0 1   y X-shear of R2

 x  TX  AX 1 a   x   x  ay 
0 1   y    y 
 a<0: Negative
 y
       X-shear of R2

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
 Rθ: the matrix cos  sin  
transformation that A 
rotates R2  sin  cos 
counterclockwise
 x cos  sin    x 
(ngược chiều KĐH)  y  sin 
about the origin    cos   y 
through the angle θ

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Example
 The rotation of R3 about the Z axis through an angle θ
from the X axis to Y axis

cos   sin  0

A   sin  cos  0 
 0 0 1 

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Translation
 There are transformation that are not matrix
transformations
 For example, the translation (phép tịnh tiến)
is not a matrix transformation A fixed vector

X T X+Y

A fixed vector

The matrix does not exist if Y is not zero vector


Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

2.6. Linear Transformation


T: RnRm is called a linear transformation
(phép biến đổi tuyến tính) if it satisfies:
 1. T(X+Y)=T(X)+T(Y) for all vectors X and Y
 2. T(aX)=aT(X) for all vector X and all scalar a

If T is a linear transformation then


 T(0)=0
 T(-X)=-T(X)

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Linear Combination
(tổ hợp tuyến tính)
 Y=a1X1+a2X2+…+anXn is called a linear
combination of vectors X1,X2,…,Xn

 Theorem 1. If T: RnRm is linear


transformation, then
T(a1X1+a2X2+…+anXn)
= a1 T(X1)+a2T(X2)+…+anT(Xn)
for all vectors Xi, and all scalar ai
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Linear transformation

Let T:R2R2 be linear transformation such that


 1   2 3  4
T      ,T     
 1  3  0  5 

 1  3  5
Find T  2    3    and T  
  1 0   2

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Linear transformation
Example
 5   3 1
 2  0  2  1
     

5   3  1 
T   T    2 
 2   0  1 
 3  1  4  2   0 
 T    2T       2     
0   1  5   3  11

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

How to find the matrix of an linear


transformation?
Theorem 2. Let T: RnRm be a transformation
 1. T is linear iff it is a matrix transformation
 2. If T is linear, then T is induced by a unique
matrix A, given in terms of its columns by
A=[T(E1) T(E2) … T(En)] where E1, E2,…, En is
the standard basis of Rn

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Linear transformation
Example
Let T:R2R2 be linear such that

 x  1x  1y 
T  
 y  1x  3 y 

2
Find the matrix of T and find T  
 1
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Example
Standard basis of R2

1   1  0  1 0  0  1   1


T     T    
0 1  3.0 1 1  0  3.1  3 

1 1  2  1 1  2   3 
A  T      
1 3   1 1 3   1  1

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Composition
 T:RnRm and S:RmRk
 The composite of S and T is a transformation
defined by (S°T)(X)=S[T(X)] for all vector X in Rn
 Theorem 3. If T and S are linear then S°T is
also linear. And if S has matrix A and T has
matrix B, then S°T has matrix AB
Transformation S T S°T
Matrix A B AB
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Example
 The reflection in the X axis followed by
rotation through pi/2 is reflection in the line
y=x (ex. 9 p.78)
M''

M'
1

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Inverse
 T:RnRn is a transformation that has matrix A
 Suppose A is invertible then there exist A-1
 Let T’:RnRn is a transformation that has
matrix A-1
 T’[T(X)]=A-1[AX]=IX=X
 T[T’(X)]=A[A-1X]=IX=X
 T’ is called an inverse of T if T T '  1  T ' T
n

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

Inverse
Theorem 5. Let T:RnRn denote a linear
transformation with matrix A. Then A is
invertible if and only if T has an inverse. In
this case, T is has exactly one inverse (which
we denote as T-1) and T-1 has matrix A-1
T
X Y
matrix A

T-1
X matrix A-1
Y
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Linear transformation
Example
Let T:R2R2 be a linear such that
 x  x  y 
T  
 y x  3y

2
1
Find the matrix of T and find T  
 1
Mathematics for Engineering
ĐẠI HỌC FPT CẦN THƠ

Example
1 1 1 1  3 1
A  A   
1 3  4  1 1

2
1 1  2  1  3 1  2  1  5 
T  A         
 1  1 4  1 1  1 4  3

Mathematics for Engineering


ĐẠI HỌC FPT CẦN THƠ

P40: 3,4,15
P67: 2-5, 11-13, 25, 26
P80: 1-6, 16,17
P101: 1-3,8,12

Mathematics for Engineering

You might also like