0% found this document useful (0 votes)
17 views17 pages

IE221 Lesson

This document provides an introduction to matrices and matrix operations, covering definitions, types of matrices, and fundamental operations such as addition, scalar multiplication, and multiplication. It also explains the concepts of matrix determinants and inverses, along with properties and examples of each operation. Additionally, it discusses the transpose of a matrix and introduces symmetric and skew-symmetric matrices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views17 pages

IE221 Lesson

This document provides an introduction to matrices and matrix operations, covering definitions, types of matrices, and fundamental operations such as addition, scalar multiplication, and multiplication. It also explains the concepts of matrix determinants and inverses, along with properties and examples of each operation. Additionally, it discusses the transpose of a matrix and introduces symmetric and skew-symmetric matrices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

LESSON 1

Matrices and Matrix Operations

Learning Objectives:

At the end of the lesson, you will be able to:


1. discuss the concept of matrices
2. perform matrix operations
3. apply the properties of matrices and matrix operations
4. compute the determinants of a matrix
5. determine the inverses of invertible matrices

1.0 Introduction

Matrices are considered to be a powerful tool in solving problems in statistics,


operations research, data analytics, computing, programming, engineering, physical
sciences, etc.

Definition: A matrix is a rectangular array of numbers arranged in rows and columns.

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.

A matrix in which all entries are 0s is called a zero matrix.

1.1 Matrix Addition

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).

Definition: Matrix Addition (Subtraction)


IfA = [aij] and B = [bij] are matrices of size m × n , then their sum (or difference) id
the m × n matrix given by A + B = [aij + bij].
The sum of two matrices of different sizes is undefined.
Example:

[ 0 1] [−1 2] [0 + (−1) 1 + 2] [−1 3]


−1 2 1 3 −1 + 1 2 + 3 0 5
a. + = =

[1 2 3 ] [−1 0 −4] [0 2 −1]


0 1 −2 1 2 3 1 3 1
b. + =

1 −1 0
[−2] [ 2 ] [0]
c. −2 + 2 = 0

[4 0 −1] [−1 3]
2 1 0 0 1
d. + is undefined

Properties of Matrix Addition

Let A, B and C be m × n matrices.

a. Commutative Law: A + B =B+A


b. Associative Law: (A + B) + C = A + (B + C )
c. Additive Identity: There exists a zero matrix, 0, such that A + 0 = A
d. Additive Inverse: There exists a matrix −A such that A + (−A) = 0

1.2 Scalar Multiplication

To multiply a matrix A by a scalar c, multiply each entry in A by c.

A = [aij] is a m × n matrix and c is a scalar, then the scalar multiple of A by c is the


If

m × n matrix given by cA = [caij].

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

Properties of Scalar Multiplication

Let A, B be matrices and k, p be scalars. Then,

a. Distributive Law over Matrix Addition: k(A + B) = k A + k B


b. Distributive Law over Scalar Addition: (k + p) A = k A + pA
c. Associative Law for Scalar Multiplication: k (pA) = (k p) A

1.3 Matrix Multiplication

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:

If A = [aij] is an m × n matrix and B = [bij] is an n × p matrix, then the product A B is


n
× p matrix A B = [cij] such that cij =
∑ ik kj
an m a b .
k=1

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

c11 = − 1 (−3) + 3 (−4) = − 9 c11 = − 1 (−3) + 3 (−4) = − 9


c11 = − 1 (−3) + 3 (−4) = − 9 c11 = − 1 (−3) + 3 (−4) = − 9
c11 = − 1 (−3) + 3 (−4) = − 9 c11 = − 1 (−3) + 3 (−4) = − 9

b. BA is undefined since matrix B is not conformable with matrix A.

Properties of Matrix Multiplication

Let A, B, C be conformable matrices and r, s be scalars.


a. A (rB + sC ) = r (A B) + s (AC )
b. (B + C ) A = BA + CA
c. A (BC ) = (A B) C

Note: Matrix multiplication is not commutative.

1.4 Transpose of a Matrix

Let A be an m × n matrix. Then, A T , the transpose of A , is an n × m matrix given by


A T = [aij] = [aji].
T

In other words, the ij− th entry of A becomes the ji− th entry of A T.

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

Let A be an m × n matrix, B an n × p matrix, and r, s be scalars. Then,


(A ) = A
T T
a.
T
b. (A B) = B T A T
T
c. (rA + sB) = rA T + sB T

Symmetric and Skew Symmetric Matrices

An m × n matrix A is said to be symmetric if A = A T . An m × n matrix A is said to be


skew symmetric if A = − A T.

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.

1.5 Determinant of a Matrix

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

det (A) = | A | = a11a22 − a21a12.


Example:

[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.

Computing Determinant of n × n Matrix by Cofactor Expansion

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.

a11 a12 a13


Let A = a 21 a 22 a 23 .
a31 a32 a33

a21 a23 1+2


The minor of a12 is M12 = a and the cofactor is C12 = (−1) M12 = − M12.
31 a 33

a12 a13 3+1


The minor of a31 is M31 = a and the cofactor is C31 = (−1) M31 = M31.
22 a 23

0 2 1
[4 0 1]
Example: Let A = 3 −1 2 .

Element Minor Cofactor

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

Theorem: Let A be a square matrix of order n . Then the determinant of A is given by


n n

∑ ∑
|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 .

Using the first-row expansion, we get


3


|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

Example: Compute the determinant of the following matrices.


1 0 0 0 0
1 −2 3 0
−1 1 0 0 0
−1 1 0 2
a. A = b. B = 0 2 3 0 0
0 2 0 3
1 3 4 −3 0
3 4 1 −2
1 3 4 5 −7
Solution:
a. By inspection, two entries of the third column are zeros. Using the third column for the
cofactor expansion will make the work easier. That is,

| A | = 3C13 + 0C23 + 0C33 + C43


| A | = 3C13 + C43

The required cofactors are

−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 (1) (−16) + 0 + 3 (1) (−1)


= 13

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 (1) (−1) + (−1) (−1) (−6) + 0]


=7

Thus, | A | = 3C13 + C43 = 3 (13) + 7 = 46


b. By inspection, we can easily compute the determinant by using the fifth column
cofactor expansion. That is, | B | = − 7C55 . And you can repeat the process shown in
the previous example and get | B | = 63.
However, there is another way to determine the determinant of a lower triagular matrix
B (or any triangular matrix). Simply multiply the elements of the main diagonal to get
the value of the determinant. Thus,

| B | = 1 (1) (3) (−3) (−7) = 63

Finding a Determinant Using Elementary Row Operations

Let A and B be square matrices.


a. When B is obtained by interchanging any two rows of A, then det(B) = − det(A).
b. When B is obtained by adding a multiple of a row to another row of A, then
det(B) = det(A).
c. When B is obtained by multiplying a row of A by a nonzero constant, then
det(B) = c det(A).

Example: Use elementary row operations to compute the determinant of


1 −2 3 0
−1 1 0 2
A= .
0 2 0 3
3 4 1 −2
Solution:

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).

Example: For the following matrices, det(A)


= 0.
1 −2 −3
a. Let A = 0 −3 4 . Note that the 3rd row is a multiple of the first row (that is, 3rd
3 −6 −9
row is 3 times the 1st row).

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).

1.6 Inverse of a Square Matrix

The inverse of a 2 × 2 matrix

[ 21 a22]
a11 a12
Let A= a be an invertible matrix. The inverse of A , denoted by A −1 is

determined using the following steps.

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:

[−1 −2] [−1 −3] [0 1] [−1 −3] [−1 −2]


3 5 2 5 1 0 2 5 3 5
BB −1 = = = = B −1B

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)

Definition: The adjoint of A, a d j(A), is the transpose of the matrix of cofactors of A.


The inverse of a n × n matrix
Steps:
Let A be an invertible matrix.
1. Compute the det(A).
2. Determine the adjoint of A.
3. Divide the elements of the adjoint of A by det(A).

Example:

1 −2 3 0
−1 1 0 2
Let A = .
0 2 0 3
3 4 1 −2

Step1: Note that det(A) = 46.

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

Then, the adjoint A is


T
1 −3 13 2 1 −54 34 −3
−54 24 34 −16 −3 24 −10 9
a d j(A) = = .
34 −10 −18 22 13 34 −18 7
−3 9 7 −6 2 −16 22 −6

So, the inverse of A is

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

Another method to get the inverse of an n × n matrix A is by using the identity A X = I,


x11 x12 x13 … x1n
x21 x22 x23 … x2n
where X = A −1 = and I is the identity matrix.
⋮ ⋮ ⋮ ⋱ ⋮
xn1 xn2 xn3 … xnn
Example:

[−1 −2]
3 5
Let B = . Then, we use the fact that BX = I.

[−1 −2] [ 21 22] [0 1]


3 5 x11 x12 1 0
x x =

[−x11 − 2x21 −x12 − 2x22] [0 1]


3x11 + 5x21 3x12 + 5x22 1 0
= Apply matrix multiplication

The following equations can be derived.

3x11 + 5x21 = 1 3x12 + 5x22 = 0

−x11 − 2x21 = 0 −x12 − 2x22 = 1


Solving these equations simultaneously gives the elements of the desired inverse.

[ 21 x22] [−1 −3]


x11 x12 2 5
B −1 = x =

1.7 Applications: Markov Chains

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:

0.1 0.7 0.2


P = 0.1 0.4 0.5
0.4 0.3 0.3
For a three-step transition

0.229 0.405 0.366


3
P = 0.211 0.438 0.351
0.196 0.425 0.379

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

You might also like