TOPIC 2: MATRIX ALGEBRA
A matrix is a rectangular array of numbers, parameters or variables each of which has a
carefully ordered place within the array. The elements in the horizontal axis are rows
and those in the vertical axis are columns.
DIMENSIONS OF A MATRIX
The rows and columns give the dimensions of the matrix e.g 2× 2 matrix is read as 2 by
2 ;means that they are two rows and two columns in the matrix; 3 by 1 means there are
3 rows and one column in the matrix.
USES OF MATRIX ALGEBRA
1. Matrix algebra is a compact form of expressing a complicated system of equations.
2. It provides a fast method of determining whether a solution exists before it is
attempted.
3. It provides a means of solving a system of simultaneous equations.
DISADVANTAGES OF MATRIX ALGEBRA
It is only used for linear equations.
Definitions of Terms
1. Transpose matrix
This is a matrix which converts rows into columns and columns into rows. The
transpose of matrix A is denoted as 𝐴𝑇 𝑂𝑅 𝐴1 .
1 4
1 2 3 𝑇
E.g A= [ ]; 𝐴 = [2 5]
4 5 6
3 6
2. Identity matrix (I)
An identity matrix is a square matrix which has one (1) for every element in the
principal/leading diagonal and zeros (0) elsewhere . E.g;
1 0
𝐼2 = [ ]
0 1
1 0 0
𝐼3 = [0 1 0]
0 0 1
3. Null matrix
This is a matrix composed of all elements being zeros and it can be of any dimensions.
0 0 0
E.g [ ]
0 0 0
4. Elements of a matrix
These are parameters making up the matrix like 0,1,2 3 in the matrix below;
1 2 3
𝐴 = [1 3 0]
0 1 2
5. Diagonal elements
Are elements forming the principal diagonal of a square matrix e.g 1, 3,2 in the matrix
below.
1 2 3
𝐴 = [1 3 0]
0 1 2
6. Off-diagonal elements
These are elements other than the principal diagonal elements in a square matrix.
7. Trace of a matrix
This is the sum of principal diagonal elements in a square matrix.
1 0 0
[0 2 0]
0 0 4
For this matrix, the trace is 1+2+4=7
8. Upper triangular matrix
This is a matrix whose lower off-diagonal elements are zeros e.g
1 3 5
[0 2 6]
0 0 4
9. Lower triangular matrix
This is a matrix whose upper off-diagonal elements are zeros.
1 0 0
[5 2 6]
3 7 4
10. Diagonal matrix
This is a matrix whose off- diagonal elements are zeros (0). It has only principal
diagonal elements being non-zero.
1 0 0
[0 2 0]
0 0 4
Symmetric matrix
Is a matrix where the original matrix is the same as its transpose. It is a square matrix
which has similar off-diagonal elements though the principal diagonal elements may
differ.
e.g
3 2 4 3 2 4
A=[2 0 3] 𝐴𝑇 = [2 0 3]
4 3 1 4 3 1
Matrix Operations
Consist of the following;
Addition
Subtraction
Multiplication
Addition and subtraction
The condition for addition and subtraction is that the two matrices for which the
operations are to be performed must be of equal dimensions. The elements of one
matrix are then added to the corresponding elements of the other matrix.
7 8
A=[ ]
8 10
1 2
B= [ ]
3 4
8 10
A+B = [ ]
11 14
6 6
A- B=[ ]
5 6
Note that; A+B=B+A but A-B≠ 𝐵 − 𝐴
2. Matrix Multiplication
a) Scalar multiplication
A scalar is a single number such as 0.5, 1, 5,-1. Scalar multiplication involves
multiplication of every element by a number e.g;
1 2 5 10
A =[ ] 𝑎𝑛𝑑 𝑘 = 5 𝑘𝐴 = [ ]
3 4 15 20
Multiplication of a row vector (a row vector is a matrix with one row only) A by a
column vector ( a column vector is a matrix with one row only B requires that each
vector must have precisely the same number of elements e.g;
A=[1 2 3]
4
B=[5]
6
AB= [1 ∗ 4 + 2 ∗ 5 + 3 ∗ 6]
AB=[28]
The matrices being multiplied must be conformable for multiplication i.e the columns of
the first matrix should equal the rows of the second matrix.
e.g;
1 2 3
A=[ ]
4 7 3
1 3
B=[2 7]
4 9
To determine AB or BA you first need to check whether the two matrices are
conformable for multiplication. If yes, proceed with the multiplication. The rows of the
𝑅1𝐶1 𝑅1𝐶2
first matrix are multiplied by the columns of the second matrix. AB =[ ]
𝑅2𝐶1 𝑅2𝐶2
i) AB
Matrix A is a 2 by 3 matrix while matrix B is a 3 by 2 matrix. Since the number
of the columns of the first matrix equals the number of rows of the second
matrix we can proceed with the multiplication. The resulting matrix will be a
2 by 2 matrix i.e number of rows in the first matrix and the number of
columns in the second matrix.
1∗1+2∗2+3∗4 1∗3+2∗7+3∗9
AB =[ ]
4∗1+7∗2+3∗4 4∗3+7∗7+3∗9
17 42
AB= [ ]
30 88
1 3
1 2 3
ii) BA=[2 7] [ ]
4 7 3
4 9
In this case, the first matrix (B) is a 3 by 2 matrix while the second matrix a is
a 2 by 3 matrix. The number of columns in the first matrix equals the number
of rows in the second matrix thus conformable for multiplication. The
resulting matrix will be a 3 by 3 matrix i.e rows of the first matrix and
columns of the second matrix. Rows of matrix B are multiplied by columns of
matrix A
1∗1+3∗4 1∗2+3∗7 1∗3+3∗3
BA =[2 ∗ 1 + 7 ∗ 4 2 ∗ 2 + 7 ∗ 7 2 ∗ 3 + 7 ∗ 3]
4∗1+9∗4 4∗2+9∗7 4∗3+9∗3
13 23 12
BA= [30 53 27]
40 71 39
Note that AB ≠ 𝐵𝐴
MATRIX INVERSION
An inverse matrix is a matrix determined only for square matrices. The concept of
‘matrix division’ is approached in matrix algebra by deriving the inverse of a matrix.
One reason for wanting to find a matrix inverse is because it can be used to help solve a
set of simultaneous equations specified in matrix format.
Any matrix multiplied by the identity matrix will give the original matrix. A matrix A
can be inverted if there exists an inverse A−1 such that A−1A = I, the identity matrix.
Using this definition we can now see that if
Ax = b
multiplying both sides by A gives
−1
A−1Ax = A−1b
Since A−1A = I this means that
Ix = A−1b
As any matrix or vector multiplied by the identity matrix gives the same matrix or
vector then
x = A−1b
There are several instances when the inverse of a matrix may not exist:
Firstly, the zero, or null matrix, which has all its elements equal to zero. There are zero
matrices corresponding to each possible order.
Just as it is not possible to determine the inverse of zero in basic arithmetic, the inverse
of the zero matrix 0 cannot be calculated. However, if we were trying to solve a set of
simultaneous equations, we would be unlikely to start off with a matrix of coefficients
that were all zero as this would not tell us very much!
Secondly, linear dependence of two or more rows (or columns) of a matrix will prevent its
inverse being calculated. Linear dependency means that all the terms in one row (or
column) are the same scalar multiple of the corresponding elements in another row (or
column).
To actually find the inverse of a matrix, we first need to consider some special concepts
associated with square matrices, namely:
• The Determinant
• Minors
• Cofactors
• The Adjoint Matrix
Determinant of a matrix
This is a single number found only for square matrices.
The determinant of a 2 by 2 matrix
The determinant of a 2 × 2 matrix is called a second order determinant and is obtained
by taking the product of the two elements on the principal diagonal and subtracting
from it the product of the two elements off the principal diagonal.
E.g
4 2
A= [ ] 𝑡ℎ𝑒 𝑑𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑛𝑡 𝑜𝑓 𝐴 𝑑𝑒𝑛𝑜𝑡𝑒𝑑 𝑎𝑠 |𝐴| = 4 ∗ 10 − 4 ∗ 2 = 32
4 10
If any sets of rows or columns of a matrix are linearly dependent then the determinant
will be zero and we have what is known as a singular matrix. For example, if the second
row is twice the value of the corresponding element in the first row and
5 8
A =[ ] then the determinant |A| = 5 × 16 − 8 × 10 = 80 − 80 = 0
10 16
The determinant of a 3rd order matrix
The determinant of a 3 by 3 matrix, known as third order determinant is found through
the use of laplace expansion method.
For the general 3rd order matrix
𝑎11 𝑎12 𝑎13
𝑎
A =[ 21 𝑎22 𝑎23 ]
𝑎31 𝑎32 𝑎33
the determinant |A| can be calculated as;
𝑎22 𝑎23 𝑎21 𝑎23 𝑎21 𝑎22
|A| = 𝑎11 |𝑎 𝑎33 | -𝑎12 |𝑎31 𝑎33 | +𝑎13 |𝑎31 𝑎32 |
32
This entails multiplying each of the elements in the first row by the determinant of the
matrix remaining when the corresponding row and column are deleted. For example,
the element a11 is multiplied by the determinant of the matrix remaining when row 1
and column 1 are deleted from the original 3 × 3 matrix. If we start from a11 then, as we
use this method for each element across the row, the sign of each term will be positive
and negative alternately. Thus the second term has a negative sign.
PROPERTIES OF DETERMINANTS
1. The determinant of a matrix is unchanged in its value if its rows and columns are
transposed.
2. A determinant changes sign if its two rows or columns are interchanged.
3. The value of a determinant by k fold if each element on one row or column is
multiplied by k.
4. A determinant is equal to zero if the rows or columns are identical or multiple of
each other.
Minors
The minor |Mij | of matrix A is the determinant of the matrix left when row i and
column j have been deleted. For example, if the first row and first column are deleted
from matrix
𝑎11 𝑎12 𝑎13
A =[ 21 𝑎22 𝑎23 ]
𝑎
𝑎31 𝑎32 𝑎33
the determinant of the remaining matrix will be the minor
𝑎22 𝑎23
|M11| =|𝑎 |
32 𝑎33
Cofactors
A cofactor is the same as a minor, except that its sign is determined by the row and
column that it corresponds to. The sign of cofactor |Cij | is equal to (−1)i+j . Thus if the
row number and column number sum to an odd number, the sign will be negative. For
example, to derive the cofactor |C12| for the general 3rd order matrix A we eliminate
the 1st row and the 2nd column and then, since i + j = 3 , we multiply the determinant of
the elements that remain by (−1)3. Therefore
𝑎21 𝑎23 𝑎21 𝑎23
|C12| =(−1)3 |𝑎 | = −1 |𝑎31 𝑎33 |
31 𝑎33
For matrices of any order n, using the Laplace expansion, the determinant can specified
as
𝑖,𝑗=𝑛
|A| =∑𝑖,𝑗=0 𝑎𝑖𝑗 |𝐶𝑖𝑗 |
where the summation from 1 to n can take place across the rows (i) or down the
columns (j ). If you check the formula (1) above for determinant of a 3rd order matrix in
terms of its cofactors, you will see that this employs the Laplace expansion.
If the original matrix is 4th order or greater, then the first set of cofactors derived by
using the Laplace expansion will themselves be 3rd order or greater. Therefore, the
Laplace expansion has to be used again to break these cofactors down. This process
needs to continue until the determinant is specified in terms of 2nd order cofactors
which can then be evaluated. With larger determinants this method can involve quite a
lot of calculations and so it is usually quicker to use a spreadsheet for numerical
examples.
The transpose matrix, the cofactor matrix, the adjoint and the matrix inverse formula
There are still a few more concepts that are needed before we can determine the inverse
of a matrix.
The transpose of a matrix
To get the transpose of a matrix, usually written as AT, the rows and columns are
swapped around, i.e. row 1 becomes column 1 and column 1 becomes row 1, etc. If a
matrix is not square then the numbers of rows and columns will alter when it is
transposed.
The cofactor matrix
If we replace every element in a matrix by its corresponding cofactor then we get the
cofactor matrix, usually denoted by C.
The adjoint matrix
The adjoint matrix, usually denoted by AdjA, is the transpose of the cofactor matrix.
AdjA = CT