Sunteți pe pagina 1din 52

FN211 Basic Matrices

Part 1

Dr. Winai Homsombat


Bachelor of Economics, International Program
Thammasat University
Outline
• Introduction and Types of Matrices
• Matrix Operations
• Inverse of a Matrix
• Application*

Reading:
Chapter 8
2
Introduction and Types of Matrices
(1) Column matrix or vector (2) Row matrix or vector
(3) Rectangular matrix (4) Square matrix
(5) Diagonal matrix (6) Unit or Identity matrix - I
(7) Null (zero) matrix – 0 (8) Triangular matrix
(9) Scalar matrix

3
Matrices - Introduction
• Matrix algebra has at least two advantages:
• Reduces complicated systems of equations to simple expressions
• Adaptable to systematic method of mathematical treatment and well
suited to computers
Definition:
A matrix is a set or group of numbers arranged in a square or
rectangular array enclosed by two brackets

 4 2 a b 
1  1  3 0 c d 
    4
Matrices - Introduction
• Properties:
• A specified number of rows and a specified number of columns
• Two numbers (rows x columns) describe the dimensions or size of the
matrix.
Examples:
3x3 matrix 1 2 4 
4  1 5 1 1
  
3  3
1  1
2x4 matrix 3 3 3 0 0 3 2 
1x2 matrix
5
Matrices - Introduction
• A matrix is denoted by a bold capital letter and the elements within the
matrix are denoted by lower case letters
• e.g. matrix [A] with elements aij

Amxn=
 a11 a12 ... aij ain 
a a22 ... aij a2 n 
m A n
 21
     
  i goes from 1 to m
am1 am 2 aij amn 
j goes from 1 to n
6
Types of Matrices
1.Column matrix or vector 2. Row matrix or vector
• The number of rows may be any • Any number of columns but only
integer but the number of columns one row
is always 1

1 
 4 1
 a11 
 a21  1 1 6 0 3 5 2
   3  
   
2
am1  a11 a12 a13  a1n 

7
Types of Matrices
3. Rectangular matrix 4. Square matrix
• Contains more than one • The number of rows is equal to
element and number of rows is the number of columns
not equal to the number of (a square matrix A m x m
columns has an order of m)
1 1  1 1 1 1 1
3 7  1 1 1 0 0  9 9 0
   2 0 3 3 0 3 0  
7  7      6 6 1
 
 7 6  mn The principal or main diagonal of a
square matrix is composed of all
elements aij for which i=j 8
Types of Matrices
5. Diagonal matrix 6. Unit or Identity matrix - I
• A square matrix where all the • A diagonal matrix with ones on
elements are zero except those the main diagonal
on the main diagonal
1 0 0 0 1 0
3 0 0 0 0 1 0 0 0 1 
1 0 0   
0 2 0  0 3 0 0
   0 0 1 0
0 0 1 0 0 5 0   aij 0 
  0 0 0 1 0 a 
0 0 0 9  ij 

i.e. aij =0 for all i not equal j i.e. aij =0 for all i not equal j
aij = 0 for some or all i = j aij = 1 for some or all i = j
9
Types of Matrices
7. Null (zero) matrix - 0 8. Triangular matrix
• All elements in the matrix are zero • A square matrix whose elements
above or below the main diagonal
0  0 0 0 
are all zero
0  0 0 0 
    1 0 0  1 0 0  1 8 9
0 0 0 0  2 1 0  2 1 0 0 1 6 
     
5 2 3 5 2 3 0 0 3
aij  0 For all i,j

10
Types of Matrices
8a. Upper triangular matrix 8b. Lower triangular matrix
A square matrix whose elements A square matrix whose elements
below the main diagonal are all zero above the main diagonal are all zero
aij aij aij  1 8 7 
  0 1 8  aij 0 0 1 0 0 
0 aij aij       2 1 0
0 0 aij  0 0 3 aij aij 0
 
 aij aij aij  5 2 3

1 7 4 4
0 1 7 4
 i.e. aij = 0 for all i < j
0 0 7 8
 
0 0 0 3 i.e. aij = 0 for all i > j
11
Types of Matrices
9. Scalar matrix
• A diagonal matrix whose main diagonal elements are equal to the same
scalar
• A scalar is defined as a single number or constant
aij 0 0 1 0 0 6 0 0 0
  0 1 0  0
0 aij 0    6 0 0
0 aij  0 0 1 0
 0 0 6 0
 
0 0 0 6
i.e. aij = 0 for all i not equal j
aij = a for all i = j
12
Matrix Operations
(1) Equality of matrices
(2) Addition and subtraction of matrices
(3) Scalar multiplication of matrices
(4) Multiplication of matrices
(5) Transpose of a Matrix
13
(1) EQUALITY OF MATRICES
• Two matrices are said to be equal only when all corresponding elements
are equal
• Therefore their size or dimensions are equal as well

1 0 0  1 0 0 
A=  2 1 0 B=  2 1 0 A=B
   
5 2 3 5 2 3

14
(1) EQUALITY OF MATRICES
• Some properties of equality:
• IIf A = B, then B = A for all A and B
• IIf A = B, and B = C, then A = C for all A, B and C

1 0 0  b11 b12 b13 


 2 1 0 B = b
A=
   21 b22 b23 
5 2 3 b31 b32 b33 

If A = B then aij  bij


15
(2) ADDITION AND SUBTRACTION OF MATRICES
• The sum or difference of two matrices, A and B of the same size yields a
matrix C of the same size

cij  aij  bij


• Matrices of different sizes cannot be added or subtracted
• Commutative Law: A+B=B+A
• Associative Law: A + (B + C) = (A + B) + C = A + B + C

16
(2) ADDITION AND SUBTRACTION OF MATRICES
Example
7 3  1  1 5 6  8 8 5
 2  5 6     4  2 3    2  7 9 
     
A B C
2x3 2x3 2x3

Example 6 4 2 1 2 0 5 2 2 
3 2 7   1 0 8  2 2  1
     
17
(2) ADDITION AND SUBTRACTION OF MATRICES
•A + 0 = 0 + A = A
• A + (-A) = 0 (where –A is the matrix composed of –aij as elements)

18
(3) SCALAR MULTIPLICATION OF MATRICES
• Matrices can be multiplied by a scalar (constant or single element)
• Let k be a scalar quantity; then kA = Ak

 3  1
2 1 
Ex. If k=4 and A    , then
2  3
 
4 1 

19
(3) SCALAR MULTIPLICATION OF MATRICES
• Properties:
• k (A + B) = kA + kB
• (k + g)A = kA + gA
• k(AB) = (kA)B = A(k)B
• k(gA) = (kg)A

20
(4) MULTIPLICATION OF MATRICES
• The product of two matrices is another matrix
• Two matrices A and B must be conformable for multiplication to be
possible i.e. the number of columns of A must equal the number of rows
of B
Example: B x A =
A x B = C (2x1) (4x2)
A x B =
(1x3) (3x1) (1x1) (6x2) (6x3)
A x B =
(2x3) (3x2)
21
(4) MULTIPLICATION OF MATRICES
b11 b12 
 a11 a12 a13     c11 c12 
a   b21 b22    
 21 b31 b32   21 22 
a22 a23  c c

(a11  b11 )  (a12  b21 )  (a13  b31 )  c11


(a11  b12 )  (a12  b22 )  (a13  b32 )  c12
(a21  b11 )  (a22  b21 )  (a23  b31 )  c21
(a21  b12 )  (a22  b22 )  (a23  b32 )  c22

• Successive multiplication of row i of A with column j of B – row by column


multiplication
22
(4) MULTIPLICATION OF MATRICES
• Example 4 8 
1 2 3     (1 4)  (2  6)  (3  5) (1 8)  (2  2)  (3  3) 
4 2 7  6 2  (4  4)  (2  6)  (7  5) (4  8)  (2  2)  (7  3)
  5 3  
 

Remember also: IA = A

1 0 31 21
0 1 63 57 
   
23
(4) MULTIPLICATION OF MATRICES
• Assuming that matrices A, B and C are conformable for the operations
indicated, the following are true:
1. AI = IA = A
2. A(BC) = (AB)C = ABC - (associative law)
3. A(B+C) = AB + AC - (first distributive law)
4. (A+B)C = AC + BC - (second distributive law)

Caution!
1. AB not generally equal to BA, BA may not be conformable
2. If AB = 0, neither A nor B necessarily = 0
3. If AB = AC, B not necessarily = C

24
(4) MULTIPLICATION OF MATRICES
• AB not generally equal to BA, BA may not be conformable
1 2
T  
 5 0 
3 4
S 
 0 2 
1 2 3 4  3 8
TS    0  
5 0  2 15 20
3 4 1 2 23 6
ST    5  
 0 2  0 10 0
25
(4) MULTIPLICATION OF MATRICES
• If AB = 0, neither A nor B necessarily = 0
Example: 1 1  2 3  0 0
0 0  2  3  0 0
    

26
(5) TRANSPOSE OF A MATRIX

• If : 2 4 7 
A 2 A  
3

2x3  5 3 1 
 2 5
• Then transpose of A, denoted AT is: A 2 A
T 3T
 4 3
7 1

aij  a Tji For all i and j

27
(5) TRANSPOSE OF A MATRIX
• To transpose:
• Interchange rows and columns
• The dimensions of AT are the reverse of the dimensions of A
2 4 7 
A 2 A  
3
 2x3
 5 3 1 

 2 5
A 3 A
T T2
 4 3 3x2
7 1 28
(5) TRANSPOSE OF A MATRIX
• Properties of transposed matrices:
1. (A+B)T = AT + BT
2. (AB)T = BT AT
3. (kA)T = kAT
4. (AT)T = A

29
(5) TRANSPOSE OF A MATRIX
• Properties of transposed matrices:
1. (A+B)T = AT + BT

7 3  1  1 5 6  8 8 5 8  2
 
 2  5 6    4  2 3   2  7 9  8  7 
       
5 9 
7 2  1  4 8  2
 3  5  5  2  8  7 
     
 1 6  6 3  5 9 

30
(5) TRANSPOSE OF A MATRIX
• Properties of transposed matrices:
2. (AB)T = BT AT
1 
1 1 0   2
0 2 3 1   8   2 8
   2  
 
1 0
1 1 21 2  2 8
0 3
31
Inverse of a Matrix

32
INVERSE OF A MATRIX
• Consider a scalar k. The inverse is the reciprocal or division of 1 by the
scalar.
Example: k=7 the inverse of k or k-1 = 1/k = 1/7

• Division of matrices is not defined since there may be AB = AC while


B is not equal to C.
• Instead matrix inversion is used.
• The inverse of a square matrix, A, if it exists, is the unique matrix A-1
where:
AA-1 = A-1 A = I
33
INVERSE OF A MATRIX
• The inverse of a square matrix, A, if it exists, is the unique matrix A-1
where:
AA-1 = A-1 A = I
Example:
3 1  1  1 3 1 1 0
A 2 A  
2

2 1 Because:  2 3  2 1  0 1


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

34
INVERSE OF A MATRIX
• Properties of the inverse: ( AB ) 1  B 1 A1
( A1 ) 1  A
( AT ) 1  ( A1 )T
1 1
1
(kA)  A
Note: k
• A square matrix that has an inverse is called a nonsingular matrix
• A matrix that does not have an inverse is called a singular matrix
• Square matrices have inverses except when the determinant is zero
• When the determinant of a matrix is zero, the matrix is singular
35
INVERSE OF A MATRIX

adjA
• The inverse of a square matrix: 1
A 
A

(A) Adjoint of matrix


(B) Determination of matrix

TO BE CONTINUED …
36
(A) ADJOINT MATRIX
• The adjoint matrix of A, denoted by adj A, is the transpose of its cofactor
matrix
adjA  C T

• The cofactor Cij of an element aij is defined as:

Cij  (1) i  j mij


• A minor of A, mij , is the determinant of the submatrix when deleting row
and column (i and j), respectively.
• Then, mij is the minor of the element aij in A.

37
(A) ADJOINT MATRIX
MINORS
• If A is an n x n matrix and one row and one column are deleted, the
resulting matrix is an (n-1) x (n-1) submatrix of A.
• The determinant of such a submatrix is called a minor of A.
 a11 a12 a13  Each element in A has a minor
A  a21 a22 a23  Delete first row and column from A . a22 a23
m11 
 a31 a32 a33  The determinant of the remaining a32 a33
2 x 2 submatrix is the minor of a11

38
(A) ADJOINT MATRIX
MINORS
a21 a23
• Therefore the minor of a12 is: m12 
a31 a33

a21 a22
• And the minor for a13 is: m13 
a31 a32

39
(A) ADJOINT MATRIX
 1 0 1
• Example: Given A   0 2 3 , compute its minors.
 1 0 1

40
(A) ADJOINT MATRIX
COFACTORS
The cofactor Cij of an element aij is defined as: Cij  (1)i  j mij

• When the sum of a row number i and column j is even, cij = mij and when
i+j is odd, cij =-mij

c11 (i  1, j  1)  (1)11 m11   m11


c12 (i  1, j  2)  (1)1 2 m12  m12
c13 (i  1, j  3)  (1)13 m13   m13
41
(A) ADJOINT MATRIX
COFACTORS
 1 0 1
Example: Given A   0 2 3 , compute its cofactors.
 1 0 1

42
(A) ADJOINT MATRIX
• The adjoint matrix of A, denoted by adj A, is the transpose of its cofactor
matrix
adjA  C T

 1 0 1
Example: Given A   0 2 3 , compute the adjoint matrix.
 
 1 0 1

43
(B) DETERMINANT OF A MATRIX
• To compute the inverse of a matrix, the determinant is required
• Each square matrix A has a unit scalar value called the determinant of A,
denoted by det A or |A|

1 2
If A 
 6 5 
1 2
then A
6 5

44
(B) DETERMINANT OF A MATRIX
• If A = [A] is a single element (1x1), then the determinant is defined as the
value of the element
• Then |A| =det A = a11
• If A is (n x n), its determinant may be defined in terms of order (n-1) or
less.

45
(B) DETERMINANT OF A MATRIX
• The determinant of an n x n matrix A can now be defined as

A  det A  a11c11  a12 c12    a1n c1n

• The determinant of A is therefore the sum of the products of the


elements of the first row of A and their corresponding cofactors.
• (It is possible to define |A| in terms of any other row or column but for
simplicity, the first row only is used)

46
(B) DETERMINANT OF A MATRIX
Example: For matrix 2x2:
 a11 a12  3 1 
A What if A   ?
a21 a22  1 2 

Has cofactors : c11  m11  a22  a22


c12  m12   a21  a21

And the determinant of A is: A  a11c11  a12 c12  a11a22  a12 a21

47
(B) DETERMINANT OF A MATRIX
 1 0 1
Example: Given A   0 2 3 , compute its determinant.
 1 0 1

48
Note: ADJOINT MATRIX AND DETERMINANT
• It can be shown that: A(adj A) = (adjA) A = |A| I

3 1 
Example: A  … show the above expression is true.
1 2

49
INVERSE OF A MATRIX - USING THE ADJOINT MATRIX
• From AA-1 = A-1 A = I,
and A(adj A) = (adjA) A = |A| I,

1 adjA
then, A 
A

50
INVERSE OF A MATRIX - USING THE ADJOINT MATRIX
Example: Find the inverse of the following matrices:

3 1 
(1) A 
1 2 

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

51
Question?

52

S-ar putea să vă placă și