UNIT4 - Matrices
UNIT4 - Matrices
MATRICES 4.0 INTRODUCTION Matrices are sets of numbers that are arranged in rectangular forms. It is a rectangular array of numbers. These numbers are arranged inside a round or square bracket. Look at the examples shown below.
(4
8)
2 5 4
3 5
9 2
7 3
6 9 1 2
1 6 4 3
It is important to study about the fundamentals of matrices first and get a good introduction to how to apply simple algebra operations on matrices. This can help in solving engineering problems. For example, you can use matrices to solve systems of linear simultaneous equations.
4.1
FUNDAMENTALS OF MATRIX The array of numbers inside a matrix is called the elements of the matrix. These
numbers are arranged in rows and columns. Rows are the horizontally arranged elements of the matrix
For example, the shaded region in the matrix below is the second row of the matrix.
1 0 0 2
4 3 2 5
4 4 6 2
For example, the shaded region in the matrix below is the second column of the matrix.
1 0 0 2
4 3 2 5
4 4 6 2
Note: It is common practice to use capital letters like A to represent a matrix, and small letters to represent the elements. 4.2 SIZE OF A MATRIX
TOPIC 4 MATRICES
The size of a matrix is the number of rows and columns that it has. If a matrix has 3 rows and 4 columns, then its size is 3 x 4. Lets look at the following matrix.
1 A= 8 5
4 3 3
4 0 9
7 1 6
How many rows and columns do you see? Do you agree that the size of matrix A is 3 x 4?
4 3 3 7
Solution:
9 6 3 4
1 6 9 0
There are 4 rows and 3 columns. Therefore, the size of this matrix is . For a matrix A of size 3 x 4, you can use the notation A34 to represent the matrix. In general, any matrix can be represented by the notation matrix Aik with i = 1, 2, 3, ., and k = 1, 2, 3, The first subscript, i, represents the rows and the second subscript, j, represents the columns. ACTIVITY 4a 1. State the size of each of the following matrices:
a.
(2
3)
5 8 7
3 b. 4 5
1 c. 3 2
0 1 7
2 4 6
3 d. 1 5
2 9 7
3 2. Referring to matrix B = 0 1
a. b23 b. b21 c. 4.3 b31 TYPES OF MATRIX 4.3.1 Square Matrix
TOPIC 4 MATRICES
A square matrix is a matrix where the number of rows is equal to the number of columns. The following examples are square matrices.
3 3
4 5
3 0 1
5 8 7
3 4 2
3 4 0 1
4.3.2
2 5 21 9
16 12 17 4
9 23 3 15
Diagonal Matrix If all the elements of a square matrix consist of zeros except the diagonal, then this
matrix is called a diagonal matrix. The following examples are diagonal matrices.
a11 0 0
4.3.3
0 a 22 0
0 0 a33
3 0
0 5
3 0 0
0 8 0
0 0 2
Identity Matrix If all the elements of a diagonal matrix consist of the value 1, then the matrix is
1 I = 0 0
0 1 0
0 0 1
I=
1 0
0 1
1 0 I= 0 0
0 1 0 0
0 0 1 0
0 0 0 1
An identity matrix is special because when you multiply a matrix with it or when you multiply it with a matrix, the matrix does not change. For examples:
AI = IA = A, IB = BI = B
TOPIC 4 MATRICES
4.3.4
Transpose of a Matrix When you interchange the rows of a matrix with its columns, you would have
converted a matrix Amn to another matrix Anm. In other words, a matrix of size m x n will now be of size n x m. This new matrix is called the transpose of a matrix. The symbol for a transpose of a matrix A is AT. Lets look at the following example.
a11 If A = a 21 a 31
a11 a 21
a12 a 22
a13 . a 23
2 If A = 2 6
0 1 0
0 6 , then AT = 1
2 0 0
2 1 6
6 0 . 1
The transpose of a transpose is the original matrix. ( AT)T = A Some important properties relating to transpose are: (AB)T = BTAT (ABCZ)T = ZT..BTAT (A + B)T = AT + BT
4.3.5
Symmetric Matrix If the transpose of a matrix is the same as the original matrix, then it is called a
symmetric matrix. Therefore, if A = AT, then A is a symmetric matrix. The following examples are symmetric matrices.
1 2 3
2 0 5
3 5 4
1 6 7
6 2 2
7 3 9
Activity 4b:
TOPIC 4 MATRICES
3 A= 0 1 0 0 1
0 5
2 B= 3
4 2
0 C = 0 1
0 1 0
1 0 0
D=
a)
1 2
2 3
3 6
1 b) 8 5
8 2 0
6 0 3
1 c) 2 3
2 0 5
3 5 4
d)
1 6 7
6 2 3
7 3 9
4.4
MATRIX ADDITION AND SUBTRACTION Matrix addition / subtraction can only be performed on matrices that have the same size.
The result of a matrix addition / subtraction is a new matrix that is of the same size. All we need to do is to match the elements that are at the same position in their matrices.
3 A = 1 7
1 3 1
4 3 5
10 2 3
and
2 B = 4 1
5 1 3
8 3 0
0 0 1
Determine A + B and A B.
Solution:
TOPIC 4 MATRICES
TOPIC 4 MATRICES
4.5
MATRIX MULTIPLICATION In order to be able to multiply two matrices AB, we have to ensure that the number of
columns in matrix A is the same as the number of rows in matrix B. That means we can multiply matrix Amn with matrix Bnk because matrix A has n columns and matrix B has n rows too. The result is a new matrix that has m rows and k columns.
2 3 and B = 1 1
7 . 1
1 A = 2 3
Solution: .
2 0 5
3 5 and B = 4
1 8 5
8 2 0
6 0. 3
TOPIC 4 MATRICES
A=
3 9
7 5
B=
3 3
4 5
C=
4 2
5 1
D=
4 5
2 7
Determine: a. A + B b. A C c. D + (B A) d. B + C
2. Given that A =
2 4
1 0 and B = 2 1
3 9 3
3 3. If P = 0 1
5 8 7
3 1 4 , Q = 7 5 2
b) P2
5 2 7 , R = 1 1
c) QI d) QR
0 4
2 1 . Find 5
4. Given A =
2 3
0 , B = 4
2 1
1 and C = 3
b) ( AB )T
4 1
1 3
a) ( A + B )T
a)
x 1
2 2 x + y 2
1 1 y 5 2 7 1 1 1
3 9 = y 3
1 5 0
5 8
6 5 0 2 0 0
x b) 0 0
4.6
2 5 0 = 1 0 1
DETERMINANT OF A MATRIX
TOPIC 4 MATRICES
The determinant of a square matrix is a special number that can be calculated from the matrix. It is used to represent the real-value of the matrix which can be used to solve simple algebra problems later on. The symbol for the determinant of matrix A is det(A) or A. For a matrix of size 2 x 2, the method to find the determinant is: If A =
a c
b , d
a c b d
then, det(A) = A =
= (ad bc).
a11 If A = a 21 a 31
a12 a 22 a32
a 22 a32
a13 a 23 , a33
a 23 a a 21 12 a33 a13 a 23 a + a31 21 a33 a31 a 22 a32
then A= a11
Example 5: If A = Solution:
5 7
6 , determine det(A). 8
Example 6:
3 3 1
2 0 2
TOPIC 4 MATRICES
a)
6 4
13 12
b)
3 5
8 3
c)
4 6
5 0 2
2 3
3 4 1
2.
2 Given that A = 2 4 4 4 5
1 3 2
6 4 , 7
1 B = 1 7
and C =
1 0 2
a)
2 6 0
b) B c) C
Determine: A
10
TOPIC 4 MATRICES
4.7
MINOR OF A MATRIX The Minor of a matrix is a new matrix where all the elements are determinants. Each
determinant is calculated by removing a row and a column from the original matrix. For example, in order to determine the element at position ij, you will have to remove row i and column j from the matrix. Next, you calculate the determinant of what is left.
a11 If A = a 21 a 31
Where:
a12 a 22 a32
M 11 M 21 M 31
M 12 M 22 M 32
M 13 M 23 M 33
M 11 =
a 22 a 32
a 23 a33
M 12 =
a 21 a 31
a 23 a33
M 23 =
a11 a 31
a12 a 32
and so on Example 7:
1 If A = 7 4
Solution:
3 9 6
5 2 , determine Minor of A. 8
M 11 = M 13 =
M 12 = M 21 =
M 22 =
1 4
5 8
M 23 =
1 4
3 6
= 1(6) 3(4) = -6
11
TOPIC 4 MATRICES
M 31 = M 33 =
3 9 1 7
5 2 3 9
M 32 =
1 7
5 2
60 Therefore, Minor of A = 6 30
ACTIVITY 4e
48 12 33
6 6 12
i)
2 A = 2 4
1 3 2
6 4 7
1 ii) B = 0 2
4 4 5
2 6 0
4.8
COFACTOR OF A MATRIX Once you have found the Minor of a matrix, you can easily determine the Cofactor of the
matrix. All the hard work is already done when you determine the Minor of a matrix. All you need to do now is to multiply each element of the Minor of the matrix with a factor ( 1) Cofactor is done. Lets look at the following descriptions:
i+j
and the
a11 If A = a 21 a 31
a12 a 22 a32
a13 a 23 a33
and
M 11 Minor A = M 21 M 31 K 12 K 22 K 32
M 12 M 22 M 32
M 13 M 23 M 33
K 13 K 23 where K ij = (1) i + j M ij . K 33
12
TOPIC 4 MATRICES
( 1) 2 M 11 3 Cofactor of matrix A = ( 1) M 21 ( 1) 4 M 31
Example 8:
( 1) 3 M 12 ( 1) 4 M 13 ( 1) 4 M 22 ( 1) 5 M 23 ( 1) 5 M 32 ( 1) 6 M 33
1 If A = 7 4
Solution:
3 9 6
48 12 33
6 6 12
i+j
Next, multiply each element by its factor ( 1) Therefore, you get the
( 1) 2 60 3 Cofactor of matrix A = ( 1) 6 ( 1) 4 30
60 = 6 30
ACTIVITY 4f Find the cofactor for the following matrices:
( 1) 3 48 ( 1) 4 6 ( 1) 4 12 ( 1) 5 6 ( 1) 5 33 ( 1) 6 12
48 12 33 6 6 12
i) 4.9
1 A = 7 5
3 9 3
5 7 1
2 ii) B = 1 1
2 3 2
4 4 3
ADJOINT OF MATRIX For a square matrix A with n x n, you can find the adjoint of a matrix when transposing
the cofactors of a matrix A. In this case, for matrix A, Adjoint of a matrix A, written as Adj(A) = KT where K are the cofactor for A.
13
TOPIC 4 MATRICES
a11 Then, if A = a 21 a 31
a12 a 22 a32
M 11 M 21 M 31
M 12 M 22 M 32
M 13 M 23 M 33
K 13 K 32 K 33
1 If A = 7 4
Solution:
3 9 6
Inputs from Example 9 and Example 10, you will find minor for A =
60 6 30
48 12 33
6 6 12 48 12 33 6 6 12 6 12 6 30 33 12
i)
2 A = 0 1
2 3 2
3 4 4
1 ii) B = 2 4
2 3 5
3 1 2
14
TOPIC 4 MATRICES
4.10
INVERSE MATRIX If A is a square matrix, A-1 is called the inverse matrix of A. Then AA-1 = I (Identity matrix).
1 AdjA A Calculate the inverse matrix for each of the matrix below:
1 ACTIVITY 4h
A =
i)
1 A = 2 1
1 1 4
1 1 1
3 ii) B = 3 9
5 2 3
2 1 3
4.11
SYSTEMS OF LINEAR EQUATIONS You have understood the different types of matrices and their operations. You have also
learned to determine the inverse of a matrix. Using the inverse of a matrix, you can solve simultaneous equations using Cramer Rule and the Inverse method. 4.11.1 THE INVERSE METHOD Consider the system of equation:
15
TOPIC 4 MATRICES
a 21 x + a 22 y + a 23 z = b2 a 31 x + a 32 y + a33 z = b3
You have to write it in a matrix form, Ac = b.
a11 a21 a 31
x y z
b1 = b 2 b 3
x y z
b.
To determine c =
x y z
16
TOPIC 4 MATRICES
3 1 3 x 4 2 3 2 y 2 3 1 2 z = 5
4 Determinant for A, A = -1 and Minor of A = 3 3 4 Next, we find the cofactor of A which is 3 3 4 Now the adjoin of A = A is 10 11
T
10 7 8
11 8 9
10 7 8
11 8 9
3 7 8 3 7 8
3 8 9 3 8 9
Therefore
3 4 8 2 9 5
x = 7, y = 14, z = -15
17
TOPIC 4 MATRICES
4.11.2 CRAMERS RULE Another method of solving systems of linear equations is using Cramers Rule where you have to calculate the determinants of the matrices involved.
a 12 a 22 a 32
a 13 a 23 a 33
x1 x 2 x 3
b1 = b2 b 3
a 11 Let A = a 21 a 31
a 12 a 22 a 32
a 13 a 23 . a 33
b1 b2 b 3
a 13 a 23 a 33
b1 Therefore A1 = b 2 b 3
a 12 a 22 a 32
b1 b2 b3
a 13 a 23 and A3 = a 33
a 11 a 21 a 31
a 12 a 22 a 32
b1 b2 b3
x1 =
, x2 =
, and
x3 =
A3 A
18
TOPIC 4 MATRICES
Example 11: Solve for x, y and z 5x - y + 7z = 4 6x - 2y + 9z= 5 2x + 8y 4z= 8 Solution: Writing in a matrix form:
5 6 2
1 2 8
7 x 4 9 y = 5 4 z 8 1 2 8 7 9 . 4 5 A2 = 6 2
A 1 = 44
5 Let A = 6 2 4 A1 = 5 8 1 2 8 7 9 4
4 5 8
7 9 4
and
5 A 3 = 6 2
1 2 8
4 5 8
=2
A 2 = -26
and
A 3 = -34
A1 A
44 = 22 2 26 = 13 2 34 = -17 2
y =
A2 A
A3 A
19
TOPIC 4 MATRICES
ACTIVITY 4i
1. Solve the following system of linear equations using the inverse method. a) 2x + y + z = 8 5x 3y + 2z = 3 7x + y + 3z = 20 b) 3x + 2y + 4z = 3 x+y+z=2 2x y + 3z = -3
2. Solve the following system of linear equations using the Cramers Rule. a) X1 + 2x2 X3 = 4 3X1 4X2 2X3 = 2 5X1 + 3X2 + 5X3 = -1 b) 4a 5b + 6c = 3 8a 7b 3c = 9 7a 8b + 9c = 6
3. Solve the following system of linear equations using the inverse method and Cramers Rule. a) x + y + 2z = 1 2x + 3y + 6z = 1 3x + 2y 4z = 2 b) 3x + 2y z = 10 7x y + 6z = 8 3x + 2z 5 = 0
20