Algebra
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
The aim of this unit is to acquaint you with the concept of matrix, the algebra of matrix and
applications of matrix algebra.
2.1 INTRODUCTION
22
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.
Columns
Note that every element in the matrix has define location. For example a 23 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.
Question: Given A =
23
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
This is a raw vector of order one by four, (1 X 4). We can simply say “a row vector of order
four.”
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.3.3 Null or Zero Matrix –A matrix each of whose elements is zero is known as a null or
zero matrix.
1.
2.
3.
24
4.
5.
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.
Example:
Example: 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?
a) b) c)
d)
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.
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
A= , B= , C =
25
A, B and C are diagonal matrices
A= B= , C =
, D=
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:
All the above matrices are scalar matrix. Question: Which of the followings is not a scalar
matrix?
A= B= C =
Answer: Both A and B are not scalar matrices because A is not a square matrix and a 23
element of B is not zero. Matrix C is a scalar matrix.
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
26
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:
A= , B= , C =
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
If A = and I= , then
A.I = = =
I.A = = =
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
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)
27
A= B =
C=
D= E=
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
A= , B =
C=
D= E=
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?
A= B= C =
D=
28
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.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:
a) If A = and B= , then
b) If M = and N= , 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
A= and B =
29
Then
A+B=
Examples:
Examples:
1. If M = and N=
addition
because both are of the same order, 2 x 3.
A+B= =
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:
Let A = , B= , C= , and O =
a) A + B = =
b) B + C =
c) (A + B) + C = + = =
30
d) A + (B + C) = + = =
e) A + B + C = + +
Therefore, (A + B) + C = A + (B + C) = A + B + C =
f) A + O = + = =
g) O + A = + = =
Therefore, A + 0 = 0 + A = A
A+B= =
B+A= =
A= , B= , C =
2. Let M = , N= , and L =
Then find
31
i) M + N ii) M + L iii) N + M iv) N + L
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
A= and B =
Then
A – B =
B – A =
Example:
32
A–B= =
B–A= =
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.)
K= =
Example:
2 = =
33
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
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
34
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.
If x = ,
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:
Solutions:
AB = = =
BA = = =
If = ,
35
Check:
= =
3. Convert = in a system
of linear equations
3x3 3x1 3x1
Solution:
2x – 3y + 3z = -8
3x + 2y + 2z = 10
x – y – 2z = 1
4. Convert the following system of linear equations into extended matrix form.
5X1 – 2X2 + X3 = 10
-3X1 + 7X2 – 2X3 = 15
Solution
Example:
Let A = , B= and C=
36
A (BC) = =
(AB) C = =
Let A = ,B = , and C=
a) A (B + C) = =
AB + AC = + =
Therefore, A (B + C) = AB + AC
b) (A + B) C = =
AC + BC = + =
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
AB = =
BA = =
37
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:
Let A = and B=
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,
AB = =
BA does not exist because the orders 2 x 3 and 2 x 2 are not conformable for
multiplications. Therefore
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)
Example 1.
AB = =
BA = =
Example 2.
Solution:
Solution: AB = = = (-2) = -2
38
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,
BA = = =
Let K = and A=
KA = =
AK = = =
Therefore, KA = AK. Note that multiplying matrix A by the constant number K produces the
same result.
KX =
Solution:
Solution:
39
AB = = =
BA = = =
3 = =
Let K= , then
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.
7. Given A =
a) 3A – 2B
b) Matrix X such that (2A – B) + X = 0, where 0 denotes a null square matrix of
order 2
8. Evaluate 10
40
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)
7. a) 3A – 2B = 3
b) (2A – B) + X = 0
=
=
3 + X11 = 0 , X11 = -3
6 + X12 = 0 , X12 = -6
0 + X21 = 0 , X21 = 0
-6 + X22 = 0 , X22 = 6
Therefore, X=
Alternatively,
41
(2A – B) + X = 0
X = -2A + B
X = -2
8. 10
If A = , then
A2 = =
Example
Solution
A2 = = =
A3 = = =
Solution B2 does not exist because a 2 x 3 and a 2 x 3 matrices are not conformable for
Multiplications
If A = , then
A=
42
Example:
1. If A = ,A=
2. If B = (1 2 3) , B =
3. If C = , C =
4. If D = , D =
Any matrix A for which A = A1 is called a symmetric matrix. Examples 3 and 4 are
symmetric matrices.
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).
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
43
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:
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
Solution:
Solution:
-7 0 –7 0
44
1. If A = by elementary operation, what row operation was conducted?
Answers
1. The first and second rows are interchanged (R1 R2)
2. Different outcomes are possible, one of which is the following.
R1 R2
R1-2R1 R2
3R2 R3 R3
This operations make a21 and a31 equal to zero.
R1 R1
R2 R2
13R2 + 7R3 R3
These operations make a32 equal to zero.
4R1 + 3R2 R1
R2 R2 This is to make a12 equal to zero.
R3 R3
45
4. Different elementary operations may produce the required outcome; the following is
one of them
For example:
By writing the coefficient matrix and the constant vector side-by side, we get.
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.
=>
46
47