You are on page 1of 26

UNIT ONE: MATRIX ALGEBRA

UNIT CONTENT
2.0 Aim and Objectives
2.1 Introduction
2.2 Definition
2.3 Types of Matrices
2.4 Algebra of Matrices
2.5 Elementary Operations
2.6 The Multiplicative Inverse of a Matrix
2.7 Application of Gauss-Jordan Inversion Method
2.8 Markov Chain
2.9 Input-Output Analysis (Introductory)
2.10 Key Words

2.0 AIM AND OBJECTIVES

The aim of this unit is to acquaint you with the concept of matrix, the algebra of matrix and
applications of matrix algebra.

After completing this unit, you will be able to:


 understand the concept of matrix;
 store and retrieve information in matrix form;
 add, subtract or multiply matrices, when possible;
 solve systems of linear equation,
 run Markov process to identify future states and the steady state;
 understand the input-output model.

2.1 INTRODUCTION

Matrix is a rectangular arrangement of numbers or variables. A matrix has no numerical


value; it simply stores information in a systematic way. In this unit, you will learn the algebra

Hussien E. 2020
of matrix and its applications. With respect to applications, major emphasis is excreted on
solving system of linear equation, Markov process and input-output mode.

2.2 DEFINITION

A matrix is a rectangular array (or arrangement) of numbers (or variables) arranged in such a
way that each number has a definite position allotted to it.

If a matrix has “m” rows and “n” columns, “m x n” is called the order or the dimension of the
matrix. Read “m x n” as m by n.
 a11 a12 a13 .. .. ...a1n 
 
 a 21
The a11, a12 …
a 22 a 23 ... .. ..a 2 n 
 
 
 a a a .. .. . a 
 m1 m 2 m 3 mn 

are called elements of the matrix

This is m x n matrix. It has m number of rows and n number of columns.

Columns

 a11 a1 2 a13 .. .... ... ..a1n 


 
 a 21 a 22 a 23 .. .... ... .a 2 n 
Rows  
 
 
 a m1 am2 a m 3 . ... ... ..a m n 

Note that every element in the matrix has define location. For example a23 is in the second row
and third column. Where is a32 located? At the third row and 2nd column. As a conviction, the
first number represents the row and the second number represents the column.

3 5 7
Question: Given A = 
2 
4  3
 

a) What is the order of A? Answer 2 X 3


b) How much is a13 element ? Answer 7
c) How much is a22 element ? Answer 4

A matrix, by definition, is simply an arrangement of numbers and has no numerical value.

2.3 TYPES OF MATRICES

Hussien E. 2020
2.3.1 Row Matrix –A matrix which has exactly one raw is called a raw matrix or a row
vector; its dimension is 1xn.
Example 1 2 3 4

This is a raw vector of order one by four, (1 X 4). We can simply say “a row vector of order
four.”

Question: If A = (5 6 7), what is the order of A?


Answer: A row vector of order 3.

2.3.2 Column Matrix –A matrix which has exactly one column is called a column matrix or a
column vector; its dimension is m x 1.

 2 
 
Example   1
 5 
is a column matrix (vector) of order three.
 

 5 
 

Question: If B =  7
 



2 


, what is the order of B?
1 

Answer: B is a column matrix (vector) of order 4

2.3.3 Null or Zero Matrix –A matrix each of whose elements is zero is known as a null or
zero matrix.
0 0 0
Example 
 
0 is 2 x 3 null matrix.
0 0 

If 0 denotes zero matrix, then


a) A + 0 = A
b) A – 0 = A
c) 0 – A = -A
d) A.0 = 0.A = 0
Examples:
 2 5  0 0  2  0 5  0  2 5
1.  1 1    0 0   1 0 1 0   1 1 
    

 2 5  0 0  2  0 5  0   2 5 
2.  1 1   0 0  1 0 1 0    1 1
    

 0 0   2 5   0  2 0  5   2  5
3. 0 0  1 1 0   1 0 1  1 1 
    

Hussien E. 2020
 2 5  0 0   20  50 20  50   0 0 
4. 1 1  0 0 10 10  10 0  0 0
     

0 0  2 5  0 2  0   1 0 5  01  0 0
5. 0 0 1 1 02  01 05  01 0 0
     

The properties of matrix addition/subtraction and multiplication are discussed in section 2.4

2.3.4 Square Matrix –A matrix whose number of rows is equal to the number of columns is
called square matrix.
1 2 
Example:
Example: 
0 3
 is a 2 x 2 square matrix. It can simply be referred to as “a square matrix
 

of order two.”
Question: which of the following is not a square matrix?
0 0 1

0 0 

a) 
  b)  0 1 0 
c)
0 0
  0
 0 1

 2 5  1 0 3 
   
 5
 0
3
1


d)  0
 3
2
2
 1
7 
   

Answer: C is not a square matrix because it has three rows but only two columns.

2.3.5 Diagonal Matrix –A square matrix whose every element other than the diagonal
elements is zero is known as a diagonal matrix.
 a11 a12 a13 
 
If A =  a 21

a 22 a 23 
 , elements a11, a22 and a33 are diagonal
 a 31 a 32 a 33 

elements of matrix A.
In order to classify a matrix as a diagonal matrix;
a) It should be a square matrix; that is its number of rows should be equal to its number
of columns, and
b) All the not-diagonal elements should be zero. Note that the diagonal elements
themselves may or may not be zero. What is required is that the non-diagonal elements
be zero.

Example

Hussien E. 2020
1

0 0 
 0 0
A=  0 2 0  , B= 
0 
2 , C =
 0
 0 3 
  

 0 0 0 
 
 0 0 0 
 0 0 0 
 

A, B and C are diagonal matrices

Question: Which of the following matrices are not diagonal matrices?


 1
 2

0
 3 0
A=  0 1 0 
B= 
0 
2 , C =
 0
 0 3 
  

 2 0 0   5 0 0 
 
 
 0
, D=
1 0 
 0 0 3   0 3 0 

 0

  0 0 0 
 0 0   

Answer:
- A is not a diagonal matrix because a13, which is a not-diagonal element is not zero.
- B is a diagonal matrix because it is a square matrix and its every non-diagonal
elements are zero.
- C is not a diagonal matrix because it is not a square matrix.
- D is a diagonal matrix because it is a square matrix and its every not-diagonal
elements are zero.

2.3.6 Scalar Matrix –A diagonal matrix whose diagonal elements are equal is called scalar
matrix.

Therefore, a scalar matrix must be a) a square matrix, b) a diagonal matrix and c) all its
diagonal elements must be equal.
Example:
0 0 0 0
 2 0 0  1 0 0   
 3 0     0 0 0 0
   0 2 0  0 1 0 0
 0 3  0 0  2  0 0 1 0 0 0
     
0 0 0 0 

All the above matrices are scalar matrix. Question: Which of the followings is not a scalar
matrix?
0 0 0  2

0 0 

A= 
  B=  0 2 1 
C =
0 0 0
  0
 0 2 

 5 0 0 
 
 0 5 0 
 0 0 5 
 

Answer: Both A and B are not scalar matrices because A is not a square matrix and a23
element of B is not zero. Matrix C is a scalar matrix.

Hussien E. 2020
2.3.7 Identify (unit) Matrix –A scalar matrix whose every diagonal element is equal to one is
called Identity or Unit matrix. Identity matrix is a) square matrix, b) diagonal matrix, c) scalar
matrix, and d) all its diagonal elements equal to 1. Therefore, there is only one unit matrix for
each square order; thus it is unique.
Example:
1 0 1

0 0 

A= 
0 
1 , B=  0 1 0 
, C =
  
 0 0 1

1 0 0 0 
 
 0 1 0 0 
 0 0 1 0 
 
 0 0 0 1
 

A is called identity matrix of order 2


B is called identity matrix of order 3
C is called identity matrix of order 4

Identity matrix has some similar characteristics as the number 1 in common algebra. If A is a
non-Zero (null) matrix and I is an identity matrix and if A and I are conformable for
multiplication, then
AxI=IxA=A

Example
2 3 1 0
If A = 
5 
1  and I= 
0 
1 , then
   

2 3 1 0  21  3  0  2 0   31  2 3
A.I =     = 
 51  1 0   =  
5
 1 

0
 1
  5 0   11 

5
 1 

1 0 2 3 1 2   0 5 1 3  01 
I.A =     = 
 0 2   1 5  =
0
 1

5
 1 
  0 3  11 

2 3

5 
 1 

Therefore AI = IA = A
Reminder:
Reminder: The rule of matrix multiplication is discussed in 2.4.5 below.

2.3.8 Triangular Matrix –A matrix whose every element above (or below) the diagonal is
equal to zero is called triangular matrix. Specifically, a square matrix whose a ij = 0 wherever

Hussien E. 2020
i<j is called lower triangular matrix.
matrix. Analogously, a square matrix whose aij = 0 whenever i>j
is called upper triangular matrix.
matrix.
Example (1)
 5 0 0  1 0 0 0 
 
 
A= B =  2 3 0 0 
 3 1 0   0 5 0 0 
  2 5 9  
 2


   0 3 1 

2 0
C= 
1 
 2 

 0 0 0  1 0 0 
   
D=  0
 0
0
0
0
0


E=  0

1 0 

   0 0 1

All the above matrices are lower triangular matrixes because their elements above the
diagonal are equal to zero. Note that their a12, a13, a14 … a23, a24, a25 … a34, a35, a36 … are zero.
That is, every element whose row number is less than its column number (a ij, where i<j) is
equal to zero.

Example 2
 3 1 
2
 
A=  0
 0
2
0
5 
 2
, B =
 

 7 11 2 3 
  1 2
C=  
 0 1 5 2 
 0 0  3 4 
0 1


 0 0 0 1


  

 0 0 0  1 0 0 
   
D=  0
 0
0
0
0 
0 
E=  0
 0
1
0
0 
1
   

All the above matrices are upper triangular matrices because their every element below the
diagonal is zero. Note that in each case a21, a31, a32, a41, a42, a43 … are equal to zero. That is aij =
0 whenever i>j.

Note that a square zero matrix (D) and identity matrix (E) can be classified as both upper and
lower triangular matrices because they fulfill both conditions.

Question: Which of the following matrices are not triangular and why?

Hussien E. 2020
 2

0 0 
 1 2
A=  3  1 0  B= 
0 
3 C =
 5
 1 2 
  

 2 3 2 
5 1 2 3 
   
 0
 0
1
0
 1
2
2 
 3
D=  0
 2
5
0
6 
0 
   

Answer:
Answer: A is a lower triangular matrix
B is an upper triangular matrix
C is not a triangular matrix because it is not a square matrix
D is not a triangular matrix because a31 element is not zero.
Therefore, the answer is C and D.

2.4 ALGEBRA OF MATRICES

2.4.1 Equality of Matrices –Two matrices A and B are said to be equal if and only if:
a) A and B are of the same order, and
b) Every corresponding elements in A and B are same.
Therefore, a matrix is equal to itself only.
Examples:
1 2 0  1 2 0 
   
a) If A =  5
 0
3
1
4
2


and B=  5
 0
3
1
4
2


, then
   

A = B because every element of A is equal to the corresponding element of B.


1 3  1 1 3  1 
   
b) If M =  0
 2
1
1
2 
5 
and N=  0
 2
2
4
1 
5
, then
   

M  N because the a22 element of M is l while the corresponding a 22 element of N is 2 and the
a23 element of M is 2 while the corresponding a23 element of N is 1.

Note that although every element of M is also element of N the two are not equal because of
the differences in the locations of the elements.

2.4.2 Addition of Matrices –Two or more matrices can be added if and only if they are of the
same order; otherwise, they are said to be non-conformable for addition. If they are
conformable for addition, their sum will be the matrices formed by adding each corresponding
element. If they are non-conformable for addition, the sum of the matrices does not exist.
Generally, if

Hussien E. 2020
 a11 a12 a13 
 
A=  a 21
 a
a 22 a 23 

and B =
 31 a 32 a 33 

 b11 b12 b13 


 
 b21 b22 b23 
b b32 b33 
 31 

Then
 a11  b11 a12  b12 a13  b13 
 
A+B=  a 21  b21
 a
a 22  b22 a 23  b23 
 31  b31 a 32  b32 a 33  b33 

Examples:
Examples:
 2 5 2 1 3 
1. If M = 
 
3 and N= 
 5

1 0  4 

M + N does not exist because M is 2 x 3 while N is 2 x 2. They are said to be non-


conformable for addition.
 2 5 2 1 3 0
2. If A = 
1  and B =   , A and B are conformable for
 0 3

4
 5 2 

addition
because both are of the same order, 2 x 3.

 2 1 53 2  0 3 8 2
A+B= 
  1 4 05 3 2
 = 
3 5

5
   

If two or more matrices, say A, B and C, are conformable for addition (that is if they are
of the same order), then:
i) Matrix addition is commutative
A+B=B+A
ii) Matrix addition is associative
(A + B) + C = A + (B + C) = A + B + C
iii) If 0 denotes a null matrix of the same order as that of A, then
A+0=0+A=A
Examples:
2 3 1 4  0 1
Let A = 
5  , B=   , C=   , and O =
 1 


 2 3

1
 1

0 0 

0 
 0

 2    1 3 4 1 7
a) A + B = 
5 2  =  
 1 3 

7
 4

Hussien E. 2020
  1  0 4  1   1 5 
b) B + C =     
 2    1 3  1   1 4 

1 7  0 1  1 0 7 1
c) (A + B) + C = 
7  +   =   =
 4

 1
 1

 7    1
 4  1

1 8 

6 
 5

2 3 1 5  2    1 3  5
d) A + (B + C) =   +   = 
 5 1  =
5
 1

 1
 4 
  1 4 

1 8 

6 
 5

2 3 1 4  0 1
e) A + B + C = 
5 
1 + 
 2

3 + 
 1 
1
     

 2    1  0 3  4  1 1 8 
=  5  2    1   
1  3  1 

  6 5

1 8 
Therefore, (A + B) + C = A + (B + C) = A + B + C = 
 
6 5

2 3 0 0  20 3 0 2 3
f) A + O = 
5 
1 + 
0 0
 = 
5  0 
1 0  = 
5 
1
       

0 0  2 3 0 2 0  3 2 3
g) O + A = 
0  +   =   =  
 0
5
 1

05
 0 1 

5
 1

Therefore, A + 0 = 0 + A = A

If A + B = B + A = 0, then A is the additive inverses of B that of A.


Example:
1  3 1 3
Let A = 
  4

5  and B= 
 
 5 , then
   4 

1    1  3  3 0 0 
A+B= 
 4 4  =  
 5   5

0
 0

  11 3    3  0 0 
B+A= 
 4    4  =  
  55  
0
 0

A is additive inverse of B and B is additive inverse of A.

Check Your Progress Questions


1. Which of the following matrices are equivalent?

Hussien E. 2020
5 3  2 

5 0 

A= 
0 1

2 , B=  3 1  , C =
    2
 2 

 2  3 4  4 
 
 2 1 3  2 
  2 2 
 

 2 4 6  1 2 0 
   
2. Let M =  7
  5
8
2
9
0


, N=  0
 0
1
0
3 
1
, and L =
   

1 3 

 
4 5

Then find
i) M + N ii) M + L iii) N + M iv) N + L

1. B and C are equivalent

 3 6 6 
 
2. i) M + N =  7
  5
9
2
12
1


ii) M + L does not exist
 

 3 6 6 
 
iii) N + M =  7
  5
9
2
12 
1 
iv) N + L does not exist
 

2.4.3 Subtraction of Matrices –A matrix can be subtracted from another matrix if both are of
the same order; otherwise, they are said to be non-conformable for subtraction. If they are
conformable for subtraction, the difference between the two matrices will be the matrix
obtained by subtracting each corresponding element.
Generally, if
 a11 a12 a13 
 
A=  a 21
 a
a 22 a 23 

and B =
 31 a 32 a 33 

 b b b 
 11 12 13

 b21 b2 2 b23 
 b b32 b3 3 
 31 
 
 

Then
A – B =
 a11  b a12  b a13  b 
 11 12 13

 a 21  b21 a 22  b22 a 23  b23 
 a  b31 a 32  b32 a 33  b33 
 31 
 
 

Hussien E. 2020
B – A =
 b  a11 b  a12 b  a13 
 11 12 13

 b21  a 21 b22  a 22 b23  a 23 
 b  a 31 b3 2  a 32 b33  a 33 
 31

 
 

Example:
1 9   2 4
Let A = 
 3
 and B= 
 ,
8 then
0   5 

1    2  9  4  3 5 
A–B= 
05  =  
 38 
 5
  5

 2 1 4  9  3  5
B – A =
 50 83 
 = 
 5

5 
   

If 0 denotes a null matrix of the same order as the matrix A, then A – 0 = A and 0 – A = -A
(See the examples under 2.3.3 above.)

2.4.4 Multiplication of a Matrix by a Constant


It is possible to multiply a matrix by a constant number. In doing so, the constant multiplies
every element of the matrix.
If K is a constant number, then:
 a11 a12   Ka11 Ka12 
K= 
a  =  
 21 a 22 

 Ka
 21 Ka 22 

Example:
3 5  2 3 2 5   6 10 
2  = 
 2 2   =  
2
  1
  2  1 

4
  2

Prove yourself that the following statements are correct.


i) K (A+ B) = KA + KB
ii) (K1 + K2) A = K1 A + K2 A
iii) (K1.K2) A = K1 (K2.A)

2.4.5 Multiplication of Matrices

Hussien E. 2020
The product of two matrices, A and B, is defined only if the number columns of A is the same
as the number of rows of B.
B. That is, in order to multiply two matrices, the first matrix must
have as many columns as the second matrix has rows. Matrices that fulfill this condition are
said to be conformable for multiplication.
multiplication. Otherwise, multiplication is impossible and the two
matrices are said to be non-conformable for multiplication.

If A is a matrix of order (m x n) and B is another matrix of order (n x p), then multiplying A


to B is possible because the number of columns of A is “n” which is the same as the number
of rows of B. The product matrix, AB, will be of (m x p) order. That is, the product matrix
will have the same number of rows as the first matrix and the same number of columns as the
second matrix.

Matrices A x B = AB
Orders mxn nx p = mxp

That n, the number of columns of A is the same to n, the number of rows of B confirms is AB
exists and therefore A and B are conformable for multiplications. AB will be a matrix of order
m x p.
Question:
If A is a 3 x 4 matrix and B is a 4 x 5 matrix, then what will be the order of a) AB, and b) that
of BA?

Answer:
a) AB exists because the number of columns of A is 4, which is the same as the number
of rows of B. Therefore, AB will have same number of rows as A (3) and the same
number of columns as B (5), which means the order of AB is 3 x 5.
Matrix A x B = AB
Order 3x4 4x5 3x5

b) BA does not exist because the number of columns of B is 5, which is different from
the number of rows of B(3). Thus, B and A are not conformable for multiplication
Matrix B x A = 
Order 4x5 3x4

Hussien E. 2020
2.4.5.1 Rules of Matrix Multiplication:
Multiplication: In multiplying two matrices (that are conformable
for multiplication), you have to employ the strict rule of adding the products of elements of
the rows of the first matrix and elements of the columns of the second matrix.
matrix. That is, you
“go” along the rows of the first matrix and down the columns of the second matrix. Columns
of the product matrix.

The sum of products of elements of the 1st row of the 1st matrix and elements of the 1st column
of the 2nd matrix forms the 1st row 1st column of the product matrix. Likewise, the sum of
products of elements of 1st row of the 1st matrix and elements of 2nd columns of the 2nd matrix
forms the 1st row-2nd column of the product matrix and so on. The crucial point here is matrix
multiplication is row by column.

 b11 b12 
 a11 a12 a13     c11 c12 
If   x  b21 b22  = 
c  ,
a
 21 a 22 a 23 
  b
 31 b32 
  21 c 22 

then
2x3 2x2 2x2
C11 = a11 (b11) + a12 (b21) + a13 (b31)
C12 = a11 (b12) + a12 (b22) + a13 (b32)
C21 = a21 (b11) + a22 (b21) + a23 (b31)
C22= a21 (b12) + a22 (b22) + a23 (b32)

Note that since the first matrix is of 2 x 3 order and the second of 3 x 2 order, their
product matrix is a 2 x 2 matrix.
Examples:
1 5   2 1
1. Given A = 
3 2
 and B= 
 4 ,
3 find AB and BA
   

Solutions:
1 5   2 1 1 2   5  4  11  5 3 
AB =     = 
  =
3
 2
 4
 3
  3 2   2  4  31  2 3 

  18 16 

 2 
 9

Orders 2 x 2 2x2 2x2

Hussien E. 2020
 2 1 1 5   21  1 3 2 5  1 2  
BA =     = 
  41  3 3  =
 4
 3

3
 2   4 5  3 2  

5 12 

5 
  14 

Order 2x2 2x2 2x2


2 3  X    4
2. Given 
5    =   , Solve for X and Y.
 2

Y



1


2x2 2x1 2x1


Solution:
2 3  X    4 2( x )  3 y    4
If     =   ,
5 x   2 y   1
5 2 Y  1 
     

2x2 2x1 2x1

2x  3y   4
By solving 5x  2 y 1
simultaneously, we get x = 1 and y = -2

Check:
2 3 1   21  3  2     4

5  
  2 = 
 51  2  2  
 =  
 2
 

  
1


2x2 2x1 2x1

 2  3 3   X    8 
     
3. Convert  3
1
2
 1
2
 2


Y
 Z


=  10
 1


in a
     

system of linear equations


3x3 3x1 3x1

Solution:
 2  3 
3  X    8 
     
 3
1
2
 1
2 
 2
Y
 Z


=  10
 1


can be written as:
     

2x – 3y + 3z = -8
3x + 2y + 2z = 10
x – y – 2z = 1
4. Convert the following system of linear equations into extended matrix form.

Hussien E. 2020
5X1 – 2X2 + X3 = 10
-3X1 + 7X2 – 2X3 = 15

Solution
 X1 
 5 2 1    10 
   X2    
 3 7  2    15 
 X3 

2.4.5.2 Properties of Matrix Multiplication


i) Matrix multiplication is associative. That is, if matrices A, B and C are conformable
for multiplication, then A (B C) = (AB) C

Example:
2 3 1 0 5  2
Let A = 
5  , B=   and C=  
 1

2
 3

1
 0

2 3 5  2  49  16 
A (BC) = 
5 
1

13 
4  = 
 38 
 14 
     

8 9  5  2  49  16 
(AB) C = 
7    =  
 3

1
 0

 38
  14 

Therefore, A (BC) = (AB) C

ii) Matrix multiplication is distributive.


distributive. That is, if matrices A,B and C are conformable for
addition and multiplication, then
A (B + C) = AB + AC, and
(A + B) C = AC + BC
Examples:
 2 5 1 2   8 2
Let A = 
 
3  , B= 
 7
 , and C= 
 
1
 4  5   3 

 2 5 9 4  8 32 
a) A (B + C) = 
    =  
 4 3 


2 8

 42 40 

 23 31    31 1  8 32 
AB + AC = 
 
29  + 
 
11  = 
 
40 
19   23   42 

Therefore, A (B + C) = AB + AC

1 7  8 2   29 5 
b) (A + B) C = 
 9    =  
 10 

 3
 1

 42
 28 

Hussien E. 2020
  31 1   2 4    29 5 
AC + BC = 
 23 
11  + 
19 
17  = 
 42 
28 
     

Therefore, (A + B) C = AC + BC
iii)
iii) Matrix multiplication is not always commutative.
commutative. That is, AB is not necessarily equal to
BA. There are three possible cases.
Case I.
I. Under certain conditions, AB may be equal to BA
2 3 1 0
Example: Let A = 
1  and B=   , then
 4

0
 1

 21  3 0  2 0   31  2 3
AB = 
11  4 0  =  
 1 0   41 

1
 4

1 2   01 1 3  0 4   2 3
BA = 
 0 2   11  =  
 0 3  1 4  


1 4

Thus, in this case AB = BA. Note that in this example AB =BA = A because B is an identity
matrix of the same order as A. (See the properties of identity matrix under 2.3.7 above).
Specifically, if either or both matrices are scalar matrix, then AB = BA (for more explanations
and examples, see section 2.4.6)

Case II.
II. It is possible that AB is defined (conformable for multiplication) while BA does not
exist (not conformable for multiplication)
Example:
 1 5 2 5 1
Let A = 
  2

3 and B= 
 
3
  0 1 

AB exists because the orders 2 x 2 and 2 x 3 are conformable for multiplication, AB will
be of order 2 x 3. Therefore,
 1 5 2 5 1  2 10 16 
AB = 
 2    =  
 3

0
 1 3

 4
 7 7 

BA does not exist because the orders 2 x 3 and 2 x 2 are not conformable for
multiplications. Therefore
2 5 1  1 5
BA = 
0 1

3

 2 
3 does not exist
   

Case III.
III. It is possible that both AB and BA exist but they are different matrices. That is both
AB and BA are defined but AB is not equal to BA (AB  BA)

Hussien E. 2020
Example 1.
1 3  4 6
Let A = 
 
 1 and B= 
 
1 , then
2  2 

1 3  4 6 16 9 

AB =     =  
2  1


2 1


 6 11 

4 6 1 3  16 6
BA = 
2 
1

2 
 1 = 
 4 
5
     

Both AB and BA exist, but AB  BA

Example 2.
5 
Let A = (2 4) and B = 
  3
 , find AB and BA.
 

Solution: AB =  2 4
Solution:
5


  3



=  2 5  4  3  = (-2) = -2
1x2 2x1 1x1
If A is a row vector and B is a column vector and if AB exist, then the product matrix will be
a constant number,
5   5 2  5 4    10 20 
BA = 
  3
 2 4 = 
  3 2  
 3 4  
= 
 6 
 12 
     

2x1 1x2 2x2


When a column vector is multiplied to row vector the product will be matrix.
Therefore, if A and B are vectors and one is a row vector while the other is column vector,
then AB  BA.

Reminder: Matrix multiplication is associative and distributive but not necessarily


commutative.

2.4.6 Multiplication of a Matrix by a scalar


A scalar is a square and diagonal matrix whose every diagonal elements are equal (See 2.3.6
above). When multiplication is possible, multiplying a matrix by a scalar produces the same
result as multiplying the matrix by the constant diagonal element of the scalar.

Let K be a scalar and A be a square matrix of the same order as K, then KA = AK


K O   a11 a12 
Let K = 
O 
 and A= 
a 
 K   21 a 22 

Hussien E. 2020
 K  a11   0 a 21  K  a12   0 a 22    Ka11 Ka12 
KA = 
 0 a   K  a   =  
 11 21 0 a12   K  a 22  

 Ka
 21 Ka 22 

 a11 a12  K O   a11  K   a12  0  a11  0   a12 K 


AK =     = 
 a  K   a  0  =
a
 21 a 22 

O
 K 
  21 22 a 21  0   a 22  K  

 Ka11 Ka12 

 
 Ka 21 Ka 22 

Therefore, KA = AK. Note that multiplying matrix A by the constant number K produces the
same result.
 a11 a12   Ka11 Ka12 
KX 
a  =  
 21 a 22 

 Ka
 21 Ka 22 

3 0  5 2
Example (1) Given A = 
0  and B=   , evaluate AB and BA.
 3

 3
 4

Solution:
Solution:
3 0  5 2  3 5  0  3 3 2   0 4    15 6
AB =     = 
  = 
  9 12 
0
 3

 3
 4
  0 5  3   3 0 2   3  4  
 

 5 2 3 0  5 3  2 0  5 0   2 3   15 6
BA =     = 
  3 3  4  0   = 
  9 12 
 3
 4

0
 3
   3 0   4  3 
 

Note that the result is the same as multiplying A by 3


 5 2  3 5  3 2    15 6
3
 3 4  =   3  3 3 4    = 
  9 12  
     

however, KA may not be equal to AK if A is not a square matrix


 K O  a11 a12 a13 
Let K =  O  and A 
K 
 
 a21 a22 a23 
, then

 Ka11 Ka12 Ka13 


KA = 
 Ka  ; K is of 2 x 2 order, A is 2 x 3 and therefore KA is a 2
 21 Ka 22 Ka 23 

x3
matrix.

AK does not exit because a 2 x 3 matrix (A) cannot be multiplied by a 2 X 2 matrix since they
are not conformable for multiplication
Therefore, in this case KA  AK.

Check your progress


1. What are the two conditions for equality of matrices?
Hussien E. 2020
2. What condition should be fulfilled in order to add two or more matrices, or to subtract
one from the other?
3. State the rules of matrix multiplication
4. Is matrix multiplication associative?
5. Is matrix multiplication distribute?
6. Is matrix multiplication commutative?
2 5 1 4 
7. Given A = 1  and B   
 3 
  2 0

a) 3A – 2B
b) Matrix X such that (2A – B) + X = 0, where 0 denotes a null square matrix of
order 2
 30 2 
8. Evaluate 10  

4

10 

Answer
1. They have to be of the same order and the corresponding elements of each matrix must
be equal (see section 2.4.1.)
2. They have to be of the same order (see section 2.4.2.)
3. In order to multiply to matrices., say A and B, the number of columns of A must be
equal to the number of row of B and the product AB will have as many rows as A and
as many columns as B. while multiply A by B, we go along the rows of A and down
the columns of B; that is, we multiply row elements by column elements and add them
to form the corresponding row-column element. (see section 2.4.5.1)
4. Yes A (BC) = (AB) C
5. Yes A (B + C) = aB + AC, and (A + B) C = AC + BC
6. Not always. In some cases matrix multiplications is commutative but there are many
cases in which this is not true. That is A x B and B x A may or may not be equal
depending on the specific case. (See section 2.4.5.2)
 2 5 1 4  6 15  2 8   4 7 
7. a) 3A – 2B = 3 1  3  2 2 0  3  9  4 0  1  9
         

b) (2A – B) + X = 0
=   2 5  1 4   X11 X12  0 0 
2           
 1  3 2 0  X 21 X 22  0 0

= 4 10 1 4   X11 X12   0 0


          
2  6 2 0  X21 X22   0 0

Hussien E. 2020
 3 6   X 11 X 12   0 0
=       
 0  6   X 21 X 22   0

0 

3 + X11 = 0 , X11 = -3
6 + X12 = 0 , X12 = -6
0 + X21 = 0 , X21 = 0
-6 + X22 = 0 , X22 = 6
 3  6
Therefore, X= 
 0 
 6

Alternatively,
(2A – B) + X = 0
X = -2A + B
2 5  1 4  3  6
X = -2 1 
 3 
  
0 
  
 2  0 6

 30 2  1  30 2 3 1/ 5
8. 10   4  
10  10  4

10 
 
2 / 5 1 

2.4.7 Power of a Matrix


If A is square matrix, the A2, A3, A4 ….are defined.
 a11 a12 
If A = 
a  , then
 21 a 22 

 a11 a12   a11 a12 


A2 = 
a    =
 21 a 22 

a
 21 a 22 

 a11  a11   a12  a 21  a11  a12   a12  a 22  



a a   a a  
 21 11 22 21 a 21  a12   a 22  a 22  

Example
2 3
Given A = 
1 
 2 , find A2 and A3
 

Solution
2 3 2 3  2 2   31 2 3  3  2   7 0 
A2 =     = 
1 2    21   =  
1
  2

1
  2
  1 3  ( 2)   2  

0
 7

Hussien E. 2020
7 0  2 3  7 2   01 7 3  0  2  
A3 = 
0    = 
 
 =
 7
1
  2
  0 2   71
 0 3  7   2 
 

14 21

7 
  14 

2.4.8 Transpose of a Matrix


Let A be a matrix. The matrix obtained from A by interchanging its rows and columns is
called the transpose of A. Transpose of A is denoted by A or AT
Only square matrices can be powered
1 2 3
Example Given B = 
4 5
 ,
6 find B2
 

Solution B2 does not exist because a 2 x 3 and a 2 x 3 matrices are not conformable for
Multiplications
 a11 a12 a13 
If A = 
a  , then
 21 a 22 a 23 

 a11 a 21 
 
A=  a12
 a
a 22 

 13 a 23 

Example:
2 5  2 4 
1. If A = 
4 6
 ,A= 
5 6

   
1 
 
2. If B = (1 2 3) , B =  2
 3


 

4 0  4 0 
3. If C = 
0 4
 , C = 
0 4

   

3 2  3 2 
4. If D = 
2  , D =  
 3
2
 3

Any matrix A for which A = A1 is called a symmetric matrix. Examples 3 and 4 are
symmetric matrices.

2.5 ELEMENTARY OPERATION

The following types of row or column operations are called elementary operations.
i) Interchanging any two rows (or columns);
ii) Multiplying any row (or column) by a non-zero constant number; and
iii) Adding a multiple of one row (column) to a multiple of another row (column).

Hussien E. 2020
An elementary operation should be either row or column operation, not both at the same time.

If an elementary operation is conducted, it should involve every element of the row (or
column). It is prohibited to operate on some elements of a row (or column) and ignore some
elements of the same row (or column).
A new matrix formed by elementary operation can easily be restored back to its original
matrix by “undoing” the operations. Therefore, although the new matrix is not equivalent to
the old one, the information stored is the old matrix are retrievable from the new one, this is
why the system remains intact.

Notations: “ ” denotes interchanging. For example, R1  R2 reads as row 1 and row 2 are
interchanged.
“ ” denotes replacement. For example, 2R1 – R2  R2 reads as 2 times row
one minus row 2 replaces row 2. that is the old R1 minus the old R2
Although elementary operation can be conducted either on rows or columns, we focus on row
operations only because they are appropriate for our purposes. However, the principle is the
same for both operations.

Example:
3 5
1. Given 
2 
1 , change a12 element to zero. Using elementary row operation.
 

Solution: To make a12 element, 5, become 0, we can multiply the 2 nd row by 5 and subtract
the product (5 x 1 = 5) from 5; and the same operation should involve the whole row.
R1 – 5R2  R1 3 – 5 (2) 5 – 5 (1) = -7 0
R2  R1 2 1 2 1

 7 0
2. Given 
  Change a21 element to zero
2 1

Solution:
Solution:
R1  R1
-7 0 –7 0
2 R1  7 R2  R2

2 (-7) + 7 (2) 2 (0) + 7 (1) = 0 7

Hussien E. 2020
 2 5 1
 
3. Given 1
 3
6
5
2 
6 
, change the matrix to an upper triangular matrix,
 

using elementary row operation.


Solution: We need the a21, a31, and a32 elements be equal to zero. Let’s first make a21 and a31
elements be equal to zero.
R1  R1
2 5 1  2 5 1  2 5 1 
R1  2 R2  R2
     
1 6 2    2  2(1) 5  2(6) 1  2(2)    0  7  3 
3 5 6   3(1)  3 3(6)  5 3(2)  6   0 13 0 
 
3R2  R3  R3

Now, we have make a32 element, 13, zero.


R1  R1
2 5 1 2 5 1  2 5 1 
R2  R2
     
0  7  3   0 7 3    0  7  3
0     
 13 0 13(0)  7(0) 13(7)  7(13) 13(3)  7(0)   0 0  39 
13R2  7 R3  R3

Check your progress


 2 3 4 1
1. If A =  4  is converted int o B  
1 

3 by elementary operation, what row operation was conducted?
 2
 2 5 1
 
2. Convert M = 1
 3
6
5
2
6 
into an upper triangular matrix, using
 

elementary row operations.


 3 5 2 
 
3. Convert N =  4
 0
1
2
3 
2
into a lower triangular matrix, using
 

elementary row operations.


4. Make the a22 element of matrix M equal to 1

Answers
1. The first and second rows are interchanged (R1 R2)
2. Different outcomes are possible, one of which is the following.
R1  R2  2

1
5
6
1
2

 3 5 6 
 
R1-2R1 R2
3R2 R3 R3
This operations make a21 and a31 equal to zero.
R1  R1  2

5 1 

 0  7  3
 0 13 0 
R2  R2
 

Hussien E. 2020
13R2 + 7R3  R3
These operations make a32 equal to zero.
 2 5 1 
 
 0
 0
 7
0
 3 
 39 
An upper triangular matrix is obtained.
 

3. Different outcomes are possible of which the following is one.


R1 – R3  R1  3
This is to make
5 2  a13 and a23 equal to zero.
 
 4 1 3 

2R2 – 3R3 R2  0


 2 2 

R3  R3

4R1 + 3R2  R1 3 3 0 
 
8  4 0 
R2  R2  0
 2 This is to make a12 equal to zero.
2 

R3  R3

 12 0 0 
 
8  4 0 
 0 2 2 
 

4. Different elementary operations may produce the required outcome; the following is
one of them

R1R1  2

5 This is2
1to
make a22 element equal to one
1 6 
3 5 6 
 
R2 – R3  R2
R3R3
 2 5 1
 
  2 1  4
3 5 6 
 

Solving system of Linear Equations


As explained above, information stored in matrix will not be distorted by elementary
operations; hence, the original setting is retrievable. This can easily be demonstrated by
system of linear equations.

For example:

Hussien E. 2020
2 x  3 y  3z   8
3 x  2 y  2 z  10
x  y  2 z 1

can be written in extended matrix form as


 2  3 
3  X    8 
     
 3

2
 1
2 

 2 
Y
 Z


=  10



1    1 

By writing the coefficient matrix and the constant vector side-by side, we get.
 2  3 3  8 
 
3 2 2 10 
1  1  2 1 
 

Now, let’s change the coefficient matrix to an upper triangular matrix using elementary
operations. That is, we need to make a21, a22 and a31 elements equal to zero.

R1  R1 R1  R1
 2  3 3  8
R2  3R3  R2 R2  R2
 
3
1
2
 1
2
 2
10 
1 
=>
 
R1 _ 2 R3  R3 R2  5R3

 2  3 3  8 
 
 0 5 8 7 
 0 1 7  10 
 

Hussien E. 2020

You might also like