Introduction To Linear Algebra

You might also like

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

Introduction to Linear Algebra

The Cyber motion SR3 security robot on patrol

Thursday, February 22, ProfDrMFRCIED 1


2018
Matrices, Determinants and
System of Equation
• Matrix definitions and notations
• Matrix operations
• Matrix and Determinant
Identities
• System of equations
Thursday, February 22, ProfDrMFRCIED 2
2018
Matrix definitions and notations
• Matrix: an m x n matrix is a
rectangular or square array of elements
with m rows and n columns.
• aij, i = the row and j = the column
• If m = n  square matrix
 a11 a12  a1n 
a a  a 
A  21 22 2n 

     
 
am1 am 2  amn 
Thursday, February 22, ProfDrMFRCIED 3
2018
Matrix definitions and
notations
• Vector: If a matrix has just one
row, it is called a row vector
• Example of row vector

B  b11 b12  b1n 


Thursday, February 22, ProfDrMFRCIED 4
2018
Matrix definitions and
notations
• Vector: If a matrix has just one
column, it is called a column vector
• Example of column vector
 c11 
c 
C  21 

  
 
Thursday, February 22,
cm1 
ProfDrMFRCIED 5
2018
Matrix definitions and
notations
• Partitioned matrix : A matrix can be
partitioned into component matrices or
vectors
• Example
 a11 a12 a13 a14   a11 a12 a13 a14 
a a22 a23 a24  a21 a22 a23 a24   A11 A12 
A  21
 
 a31 a32 a33 a34   a31 a32 a33 a34   A21 A22 
   
a41 a42 a43 a44  a41 a42 a43 a44 
Thursday, February 22, ProfDrMFRCIED 6
2018
Matrix definitions and
notations
 a11 a12 
• Where
A11  a21 a22 
 a31 a32 
 a13 a14 
A12  a23 a24 
 a33 a34 
A21  a41 a42 
A22  a43 a44 
Thursday, February 22, ProfDrMFRCIED 7
2018
Matrix definitions and
notations
• Null matrix : A matrix with all elements
equal to zero is called the null matrix.
• aij = 0 for all i and j
• example
0 0 0    0 
0 0 0    0 
A 
      
 
0 0 0 0 0 0 0 
Thursday, February 22, ProfDrMFRCIED 8
2018
Matrix definitions and notations

• Diagonal matrix : a square matrix with all


elements off of the diagonal equal to zero
• aij = 0 for i  j
• example a11 0 0  0
 0 a22 0  0 

A 0 0 a33  0
 
      
 0 0 0  ann 
Thursday, February 22, ProfDrMFRCIED 9
2018
Matrix definitions and notations
• Identity matrix : A diagonal matrix with all
diagonal elements equal to unity is called
an identity matrix
• Denoted by I : aij = 1 for i = j and aij = 0 for
ij
• example 1 0 0  0 
0 1 0  0 
A 
    
 
0 0 0  1 
Thursday, February 22, ProfDrMFRCIED 10
2018
Matrix definitions and notations

• Symmetric matrix : A square matrix for


which aij = aji is called a symmetric matrix.
• example
3 8 7 
 
A  8 9 2 
7 2 4
Thursday, February 22, ProfDrMFRCIED 11
2018
Matrix definitions and notations
• Matrix Transpose : The transpose of
matrix A ie AT is formed by interchanging
the rows and columns of A.
• If A is an m x n matrix with elements aij,
the transpose is an n x m matrix with
elements aji
• example 1 7 9 
 2 6  3 1 2 4  1 
A ; AT  7 6 8 3 
4 8 5   
  9  3 5  2
  1 3  2
Thursday, February 22, ProfDrMFRCIED 12
2018
Matrix definitions and notations

• Determinant of a square matrix


• Denoted by det A
 a11 a12  a1n 
a a22 
 a2 n 
A  21

     
 
am1 am 2  amn 
Thursday, February 22, ProfDrMFRCIED 13
2018
Matrix definitions and notations

• The determinant of a 2 x 2 matrix,


 a11 a12 
A 
a21 a22 
• Is evaluated as

a11 a12
det(A)   a11a22  a21a12
a21 a22
Thursday, February 22, ProfDrMFRCIED 14
2018
Matrix definitions and notations

• Minor of a element - The minor, Mij, of


element aij of det A is the determinant
formed by removing the ith row and the
jth column from det A. As an example,
consider the following determinant :
3 8 7
det A  6 9 2
5 1 4
Thursday, February 22, ProfDrMFRCIED 15
2018
Matrix definitions and notations

• The minor M32 is the determinant formed


by removing the third row and the second
column from det A. Thus,
3 7
M 32   36
6 2

Thursday, February 22, ProfDrMFRCIED 16


2018
Matrix definitions and notations

• Cofactor of an element - the cofactor, Cij,


of element aij of det A is defined to be

Cij  (1) (i j )


Mij
• For example, given the determinant A
before
8 7
C21  (1) M 21  (1)
(21) 3
 25
1 4
Thursday, February 22, ProfDrMFRCIED 17
2018
Matrix definitions and notations
• Evaluating the determinant of a square matrix -
the determinant of a square matrix can be
evaluated by expanding minors along any row or
column. Expanding along any row, we find
n
det A   aik Cik
k1
• Where, n = number of columns of A; i is the ith
row selected to expand by minors; and Cik is the
cofactor of aik

Thursday, February 22, ProfDrMFRCIED 18
2018
Matrix definitions and notations

• Expanding along any column, we find


m
det A   akjCkj
k1

• Where, m = number of rows of A; j is the


jth column selected to expand by minors;
and
 Ckj is the cofactor of akj

Thursday, February 22, ProfDrMFRCIED 19


2018
Matrix definitions and notations
1 3 2
A   5 6  7 
• For example, if  8 5 4 
• Then, expanding by minors on the third
column, we find
5 6 1 3 1 3
det A  2  (7) 4  195
8 5 8 5 5 6

• expanding by minors on the second row,


we find
 3 2 1 2 1 3
det A  (5) 6  (7)  195
5 4 8 4 8 5
Thursday, February 22, ProfDrMFRCIED 20
2018
Matrix definitions and notations

• Singular matrix - a matrix is singular if its


determinant equals zero

Thursday, February 22, ProfDrMFRCIED 21


2018
Matrix definitions and notations

• Non-singular matrix - a matrix is


nonsingular if its determinant does not
equal to zero

Thursday, February 22, ProfDrMFRCIED 22


2018
Matrix definitions and notations
• Adjoint of a matrix - the adjoint of a
square matrix, A, written adj A, is the
matrix formed from the transpose of the
matrix A after all elements have been
replaced by their cofactors. Thus,
T
C11 C12  C1n 
C C  C 
adjA   21 22 2n 

     
 
Cn1 Cn 2  Cnn 
Thursday, February 22, ProfDrMFRCIED 23
2018
Matrix definitions and notations
• For example, consider the following matrix

 1 2 3
A   1 4 5
 6 8 7 
Hence,
T
 4 5 1 5 1 4 
  
 8 7 6 7 6 8
  12 10  2
 2 3 1 3 1 2  37  11  8 
adjA       
 8 7 6 7 6 8
 32 4 6 
 2 3 1 3 1 2
 4 
 5 1 5  1 4 

Thursday, February 22, ProfDrMFRCIED 24


2018
Matrix definitions and notations
• Rank of a Matrix - the rank of a matrix, A,
equals the number of linearly
independent rows or columns. The rank
can be found by finding the highest-order
square submatrix that is nonsingular.
• For example, consider the following :

 1 5 2 

A 4 
7  5
 3 15  6
Thursday, February 22, ProfDrMFRCIED 25
2018
Matrix definitions and notations
• The determinant of A = 0. Since the
determinant is zero, the 3 x 3 matrix is
singular. Choosing the submatrix

1  5
A 
4 7 
• Whose determinant equals 27, we
conclude that A is of rank 2.
Thursday, February 22, ProfDrMFRCIED 26
2018
Matrix Operations
• Addition - the sum of two matrices, written
A+B=C, is defined by aij+bij=cij.
• For example

2  1  7  5  9  6
3 5    4 3    1 8 
     
Thursday, February 22, ProfDrMFRCIED 27
2018
Matrix Operations
• Subtraction - the difference between two
matrices, written A - B = C, is defined by aij
- bij = cij.
• For example,

2  1  7  5  5 4
 
 3 5    4 3   7 2
     
Thursday, February 22, ProfDrMFRCIED 28
2018
Matrix Operations
• Multiplication - the product of two matrices,
written AB = C, is defined by
n
c ij   aik bkj
k1
• Notice that multiplication is defined only if the
number of columns of A equals the number of
rows of B
Thursday, February 22, ProfDrMFRCIED 29
2018
Matrix Operations
• For example,

b11 b12 b13 


 a11 a13 
; B  b21 b22 b23 
a12
A 
a21 a22 a23 
b31 b32 b33 
 (a11b11  a12b21  a13b31 ) (a11b12  a12b22  a13b32 )
(a11b13  a12b23  a13b33 ) 
C  AB   
(a21b11  a22b21  a23b31 ) (a21b12  a22b22  a23b32 ) (a21b13  a22b23  a23b33 )

Thursday, February 22, ProfDrMFRCIED 30


2018
Matrix Operations
• Multiplication by a constant - a matrix can
be multiplied by a constant by multiplying
every element of the matrix by that
constant. For example, if

 a11 a12 
A
a21 a22 
then
 ka11 ka12 
kA   
ka21 ka22 
Thursday, February 22, ProfDrMFRCIED 31
2018
Matrix Operations
• Inverse - an n x n square matrix, A, has an
inverse, denoted by A-1, which is defined
by 1
AA  I
• Where I is an n x n identity matrix. The
inverse of A is given by
adjA
1
A 
 det A
Thursday, February 22, ProfDrMFRCIED 32
2018
Matrix Operations
• example
 1 2 3
A    1 4 5
 
 6 8 7
  12 10  2
adjA   37  11  8
 
  32 4 6 
4 5 2 3 2 3
det A  1  ( 1) 6  34
8 7 8 7 4 5
  12 10  2
 37  11  8
   0.353  0.294 0.059 
adj ( A)   32 4 6  
1
A     1.088 0.324 0.235 
det( A)  34  
 0.941  0.118  0.176
Thursday, February 22, ProfDrMFRCIED 33
2018
Matrix and determinant identities

• Matrix identities
• Commutative law

A B  B  A
AB  BA
Thursday, February 22, ProfDrMFRCIED 34
2018
Matrix and determinant identities

• Matrix identities
• Associative law

A  ( B  C )  ( A  B)  C
A( BC )  ( AB )C

Thursday, February 22, ProfDrMFRCIED 35


2018
Matrix and determinant identities

• Matrix identities
• Transpose of sum

( A  B)  A  B
T T T

Thursday, February 22, ProfDrMFRCIED 36


2018
Matrix and determinant identities

• Matrix identities
• Transpose of product

( AB )  B A
T T T

Thursday, February 22, ProfDrMFRCIED 37


2018
Matrix and determinant identities
• Determinant Identities
• Multiplication of a single row or single
column of a matrix, A, by a constant
• From single row or single column of a
matrix, A, is multiplied by a constant, k,
~
forming the matrix, A , then

~
det A  k det A
Thursday, February 22, ProfDrMFRCIED 38
2018
Matrix and determinant identities
• Determinant Identities
• Multiplication of all elements of an n x n
matrix, A, by a constant

det(kA)  k det A n

• Determinant Identities
• Transpose
det A  det A
T

Thursday, February 22, ProfDrMFRCIED 39


2018
Matrix and determinant identities

• Determinant Identities
• Determinant of the product of square
matrices

det AB  det A det B


det AB  det BA
Thursday, February 22, ProfDrMFRCIED 40
2018
System of equations
• Representation
• Assume the following system of n linear
equations :
a11 x1  a12 x2    a1n  b1
a21 x1  a22 x2    a2 n  b2

an1 x1  an 2 x2    ann  bn
or
Ax  B
Thursday, February 22, ProfDrMFRCIED 41
2018
System of equations
• Where,

 a11 a12  a1n   b1   x1 


a a22 
 a2 n  b   x 
A  21
;B   2  ;x   2

       
     
an1 an 2  ann  bn   xn 

Thursday, February 22, ProfDrMFRCIED 42


2018
System of equations
• For example, the following system of
equations,
5 x1  7 x2  3
 8 x1  4 x2  9
• Can be represented in vector matrix form
as Ax = B, or
 5 7   x1   3 
 8 4. x    9
   2  
Thursday, February 22, ProfDrMFRCIED 43
2018
System of equations
• Solution via matrix inverse – if A is
nonsingular, we can premultiply previous
equation by A-1, yielding the solution x.
Thus

1
xA B
Thursday, February 22, ProfDrMFRCIED 44
2018
System of equations
• For example, pre-multiplying both sides of
previous equation by A-1, where
1
 5 7
1 0.0526  0.0921
A    
  8 4 0.1053 0.0658 
• We solve for x=A-1B as follows :

 x1  0.0526  0.0921  3   0.987 


 x   0.1053 0.0658 . 9   0.276
 2     

Thursday, February 22, ProfDrMFRCIED 45


2018
System of equations
• Solution via Cramer’s Rule – equation x =
A-1B allows us to solve for all unknowns,
xi, where i = 1 to n.
• If we are interested in a single unknown,
xk, then Cramer’s rule can be used
• Cramer’s rule states that det Ak
xk 
det A
Thursday, February 22, ProfDrMFRCIED 46
2018
System of equations
• Where Ak is a matrix formed by replacing
the kth column of A by B.
• For example, solve equation below with
Ax  B
 5 7  x1   3 

  8 4  x    9
.
   2  
Thursday, February 22, ProfDrMFRCIED 47
2018
System of equations
 5 7 3
A  ;B   
  8 4  9
3 7
 9 4 75
x1    0.987
5 7 76
8 4
5 3
 8  9  21
x2    0.276
5 7 76
8 4
Thursday, February 22, ProfDrMFRCIED 48
2018

You might also like