IE221 Lesson
IE221 Lesson
Learning Objectives:
1.0 Introduction
Example: The following m × n matrices have different numbers of rows (m) and columns
(n).
1
1 −1 2 0 0 3
2
[6 0 ]
2 3 −4 8 3 2 0 5
A= B= C= 3 D = [3 5 6]
2 0 1 0 24 4
4
−3 6 8 5 9 0
5
MatrixA is a square matrix with 2 rows and 2 columns. If a matrix has the same number
of rows and columns, it is called a square matrix. Matrices B , C , and D are nonsquare
matrices since the numbers of rows and columns are different.
Each matrix is named using a capital letter. The rectangular array of numbers is
surrounded or enclosed by brackets. The different positions or values in a matrix are
called elements. Each element is denoted by a lowercase letter with subscripts, aij. The
subscripts, ij, are called indices.
For instance, in the 4 × 6 matrix B, the element b35 corresponds to the value in the
intersection of the third row and fourth column which is 24.
Matrix C and D are also called column and row matrices, respectively. Obviously, a
column matrix has several rows and only one column while the row matrix has one row
with several columns.
Example: Here are some of the special types of square matrices that are commonly
used in various applications.
1
2
0 0 0 1 0 0 … 0 0
0 1 0 0 0 1 0 … 0 0
E= I=
0 0 0 0 ⋮ ⋮ ⋮ ⋱ ⋮ ⋮
0 0 0 4 0 0 0 … 0 1
1 1
3 0 1 0 0 0
3 1
5 0 0
J= 0 5 0 1 K= 3
0 0 2 −1 3 0 4 0
0 0 0 −2 1 0 −2 3
MatrixE and I are called diagonal matrices. A diagonal matrix is a square matrix with
zero entries except possibly on the main diagonal. Matrix I is called the identity matrix.
An identity matrix is a diagonal matrix with 1’s in the main diagonal.
MatixJ and K are called triangular matrices. Matrix J is an upper triangular matrix in
which all entries below the main diagonal are zero. Matrix K is a lower triangular matrix
in which all entries above the main diagonal are zero.
Adding (or subtracting) matrices requires that the two matrices involved have
the same dimensions. The process of adding and subtracting two matrices involves
performing the respective operation on each pair of corresponding elements
(component-wise).
1 −1 0
[−2] [ 2 ] [0]
c. −2 + 2 = 0
[4 0 −1] [−1 3]
2 1 0 0 1
d. + is undefined
Example:
1 2 4 2 0 0
[2 1 2] [−1 3 2]
Let A = −3 0 −1 and B = 1 −4 3
1 2 4 3 (1) 3 (2) 3 (4) 3 6 12
[2 1 2]
a. 3A = 3 −3 0 −1 = 3 (−3) 3 (0) 3 (−1) = −9 0 −3
3 (2) 3 (1) 3 (2) 6 3 6
2 0 0 −2 0 0
[−1 3 2] [ 1 −3 −2]
b. −B = (−1) 1 −4 3 = −1 4 −3
3 6 12 −2 0 0 1 6 12
[ 1 −3 −2]
c. 3A − B = −9 0 −3 + −1 4 −3 = −10 4 −6
6 3 6 7 0 4
When the number of columns of matrix A is equal to the number of rows of matrix
B, the two matrices are said to be conformable and the product A B is obtained as
follows:
Example:
−1 3
[5 [ −4 1]
0]
−3 2
Let A = 4 −2 and B =
c11 c12 −9 1
a. Matrix A is conformable with matrix B. So, A B = c21 c22 = −4 6
c31 c32 −15 10
Example:
1 3
[3 5 4 ]
1 2 −6
a. Let A = . Then, A T =
2 5 .
−6 4
3 4 5 3 −1 3
[5 0 −1]
T
b. Let B = −1 −2 0 . Then, A = 4 −2 2 .
3 2 −1
Properties of the Transpose of a Matrix
Example:
2 1 3
a. A = 1 5 −3 is symmetric since A = A T.
3 −3 7
0 1 3
[−3 −2 0]
b. B = −1 0 2 is skew symmetric since A = − A T.
Every square matrix can be associated with a real number called a determinant. The
use of determinants arose from the recognition of special patterns that occur in the
solution of systems of linear equations.
Determinant of a 2 × 2 Matrix
[ 21 a22]
a11 a12
The determinant of the matrix A = a is given by
[4 −1]
2 −3
a. Let A = . Then, | A | = 2 (−1) − 4 (−3) = 10
[ 1 −3]
−2 4
b. Let B = . Then, | B | = − 2 (−3) − 1 (4) = 2
[−3 1]
−3 1
c. Let C = . Then, | C | = − 3 (1) − (−3) (1) = 0.
If A is a square matrix, then the minor Mij of the entry aij is the determinant of the matrix
obtained by deleting the ith row and jth column of A. The cofactor Cij of the entry aij is
Cij = (−1) Mij.
0 2 1
[4 0 1]
Example: Let A = 3 −1 2 .
a11 −1 2
M11 = =−1 C11 = (−1)1+1 (−1) = − 1
0 1
a12 3 2
M12 = =−5 C12 = (−1)1+2 (−5) = 5
4 1
a13 3 −1
M13 = =4 C13 = (−1)1+3 (4) = 4
4 0
Element Minor Cofactor
a21 2 1
M21 = =2 C21 = (−1)2+1 (2) = − 2
0 1
a22 0 1
M22 = =−4 C22 = (−1)2+2 (−4) = − 4
4 1
a23 0 2
M23 = =−8 C23 = (−1)2+3 (−8) = 8
4 0
a31 2 1
M31 = =5 C31 = (−1)3+1 (5) = 5
−1 2
a32 0 1
M32 = =−3 C32 = (−1)3+2 (−3) = 3
3 2
a33 0 2
M33 = =−6 C33 = (−1)3+3 (−6) = − 6
3 −1
∑ ∑
|A| = aijCij for the i th row expansion or |A| = aijCij for the j th column
j=1 i=1
expansion
0 2 1
[4 0 1]
Example: Let A = 3 −1 2 .
∑
|A| = a1jC1j = a11C11 + a12C12 + a13C13
j=1
= 0 (−1) + 2 (5) + 1 (4)
= 14
Using the second-column expansion, we get
3
∑
|A| = ai2Ci2 = a12C12 + a22C22 + a32C32
i=1
= 2 (5) + (−1) (−4) + 0 (3)
= 14
−1 1 2
1+3
C13 = (−1) 0 2 3
3 4 −2
−1 1 2
= 0 2 3 (Expansion by first column)
3 4 −2
2 3 1 2 1 2
= − 1 (−1)1+1 + 0 (−1)2+1 + 3 (−1)3+1
4 −2 4 −2 2 3
1 −2 0
4+3
C43 = (−1) −1 1 2
0 2 3
1 −2 0
= − −1 1 2 (Expansion by first column)
0 2 3
[ 2 2 ]
1 2 −2 0 −2 0
= − 1 (−1)1+1 + (−1) (−1)2+1 + 0 (−1)3+1
2 3 2 3
1 −2 3 0
−1 1 0 2
|A| =
0 2 0 3
3 4 1 −2
Interchange 1st and 2nd rows.
−1 1 0 2
1 −2 3 0
=−
0 2 0 3
3 4 1 −2
Add the 1st row to the 2nd row to get a new 2nd row. Add 3 times the 1st row to the 4th
row to get a new 4th row.
−1 1 0 2
0 −1 3 2
=−
0 2 0 3
0 7 1 4
Add 2 times the 2nd row to the 3rd row to get a new 3rd row. Add 7 times the 2nd row
to the fourth row to get a new 4th row.
−1 1 0 2
0 −1 3 2
=−
0 0 6 7
0 0 22 18
Factor -1 from the 1st and 2nd rows. Factor 6 from the 3rd row. Factor 22 from the 4th
row.
1 −1 0 −2
0 1 −3 −2
= − 132 0 0 1
7
6
9
0 0 1 11
Subtract the 3rd row from the 4th row to get a new 4th row.
1 −1 0 −2
0 1 −3 −2
= − 132 0 0 1 7
6
0 0 0 − 23
66
( 66 )
23
The matrix is triangular. Thus, | A | = − 132 (1) (1) (1) − = 46
Theorem: If A is a square matrix and any one of the following conditions is true, then
det(A) = 0.
a. An entire row (or column) consists of zero entries.
b. Two rows (or columns) are equal.
c. One row (or column) is a multiple of another row (or column).
1 −2 −2
[3 −6 −6]
b. Let A = 0 −3 0 . The 3rd column is -2 times the 1st column.
1 −2 −2
[3 −6 −6]
c. Let A = 0 0 0 . The entries of the 2nd row are all zeros.
1 −2 0
d. Let A = 0 −3 0 . The entries of the 3rd column are all zeros.
3 −6 0
Theorem: If A and B are square matrices of order n, then det(A B) = det(A) det(B).
[ 21 a22]
a11 a12
Let A= a be an invertible matrix. The inverse of A , denoted by A −1 is
Steps:
1. Compute det(A).
2. Interchange a11 and a 22.
3. Change the sign of a12 and a 21
4. Divide the elements of A by the det(A).
Example: Determine the inverse of the following matrices.
[−1 1]
−2 4
a. A =
[−1 −2]
3 5
b. B =
Solution:
1
2 [1 −2]
1 1 −4 2
−2
a. A −1 = = 1
2
−1
[−1 1] [0 1]
−2 4 2
−2 1 0
−1
Checking: A A = = =I
1
2
−1
1
−1 [−1 1] [0 1]
2
−2 −2 4 1 0
A A −1 = 1
= =I
2
−1 [ 1 3 ] [−1 −3]
1 −2 −5 2 5
b. B −1 = =
Checking:
Theorem:
a. A square matrix A is invertible (nonsingular) if and only if det(A) ≠ 0.
1
b. If A is an invertible matrix, then det (A −1) = .
det(A)
c. If A is a square matrix, then det(A) = det (A T ).
1
d. If A is an invertible matrix, then A −1 = a d j(A).
det(A)
Example:
1 −2 3 0
−1 1 0 2
Let A = .
0 2 0 3
3 4 1 −2
1 −3 13 −2
−54 24 34 16
Step 2: The matrix of cofactors of A is .
34 −10 −18 22
−3 9 7 −6
1 0 2 −1 0 2
C11 = (−1)1+1 2 0 3 = 1 C12 = (−1)1+2 0 0 3 =−3
4 1 −2 3 1 −2
−1 1 2 −1 1 0
1+3 1+4
C13 = (−1) 0 2 3 = 13 C14 = (−1) 0 2 0 =2
3 4 −2 3 4 1
−2 3 0 1 3 0
2+1 2+2
C21 = (−1) 2 0 3 = − 54 C22 = (−1) 0 0 3 = 24
4 1 −2 3 1 −2
1 −2 0 1 −2 3
2+3 2+4
C23 = (−1) 0 2 3 = 34 C24 = (−1) 0 2 0 = − 16
3 4 −2 3 4 1
−2 3 0 1 3 0
3+1 3+2
C31 = (−1) 1 0 2 = 34 C32 = (−1) −1 0 2 = − 10
4 1 −2 3 1 −2
1 −2 0 1 −2 3
3+3 3+4
C33 = (−1) −1 1 2 = − 18 C34 = (−1) −1 1 0 = 22
3 4 −2 3 4 1
−2 3 0 1 3 0
4+1 4+2
C41 = (−1) 1 0 2 =−3 C42 = (−1) −1 0 2 = 9
2 0 3 0 0 3
1 −2 0 1 −2 3
4+3 4+4
C43 = (−1) −1 1 2 = 7 C44 = (−1) −1 1 0 = − 6
0 2 3 0 2 0
1 −54 34 −3 1 −27 17 −3
46 46 46 46 46 23 23 46
1 −54 34 −3 −3 24 −10 9 −3 12 −5 9
1 −3 24 −10 9 46 46 46 46 46 23 46 46
A −1 = = =
46 13 34 −18 7 13 34 −18 7 13 17 −9 7
46 46 46 46 46 23 23 46
2 −16 22 −6
2 −16 22 −6 1 −8 11 −3
46 46 46 46 23 23 23 23
[−1 −2]
3 5
Let B = . Then, we use the fact that BX = I.
Markov chain is a mathematical system that experiences transitions from one state to
another according to certain probabilistic rules. The probability of transitioning to any
particular state is dependent solely on the current state and time elapsed.
Many of the basic applications of Markov chains require proficiency with common
matrix methods.
Example: A group of tourists visits Country A which offers mainland tours and or 2 island
tours: Island B and Island C. From survey data, when on the mainland, 70% of tourists
plan to go to Island B, 20% to Island C, and only 10% remain on shore the next day.
When on Island B, 40% continue to stay on Island B, 50% plan to go to Island C, and only
10% return to the mainland the next day. Finally, when on Island C, 30% prolong their
stay on Island C, 30% divert to Island B, and 40% go back to the mainland the next day.
a. Starting from the mainland, what is the probability that the tourists will be on the
mainland at the end of a 3-day trip?
b. Starting from Island B, what is the probability that the tourists will be on the mainland
at the end of a 3-day trip?
c. Starting from Island C, what is the probability that the tourists will be on island B at the
end of a 3-day trip?
Solution:
We begin by drawing a diagram and writing down the associated transition matrix. A
transition matrix contains information on the probability of transitioning between states.
Diagram:
A B
Transition Matrix:
Thus, (a) starting from the mainland, there is 22.9% probability that tourists will be on the
mainland at the end of a 3-day trip, (b) starting from Island B, there is 21.1% probability
that tourists will be on the mainland at the end of a 3-day trip, and (c) starting from
Island C, there is 42.5% probability that tourists will be on island B at the end of a 3-day
trip