Linear Algebra Module
Linear Algebra Module
Linear Algebra Module
CHAPTER ONE
MATRICES
1.1 Definition
columns like
Injibara University 1
Linear Algebra for Economics
In real life, we do not have to deal with a single magnitude but with a set
of magnitudes. In analysis, we treat such set of magnitudes as a single
entity or a single object of thought, abstracted by numbers.
Suppose there are 3 brothers: A, B and C in a family and that.
A has a set of 3 shoes, 3 shirts, 2 Trousers and 1 tie
B has a set of 5 shoes, 2 shirts, 3 Trousers and 2 ties
C has a set of 4 shoes, 4 shirts, 5 Trousers and no tie
Now, we can arrange this data systematically in the following convenient
way.
Shoes
Brothers Shirts Trousers Trousers
(S)
(S) (Tr) (T)
A 3 3 2 1 1st row
B 5 2 3 2 2nd row
C 4 4 5 0 3rd row
The above system comprises 3 rows and 4 columns. (Note that we write
rows first and columns after wards). Clearly, there fore, 1st column gives
us the total number of shoes (3+5+4 = 12) that A, B and C have. While
2nd, 3rd and 4th columns enumerate respectively the number of shirts,
Trousers and Ties that three brothers together have in their family.
Numbers written in such a particular form of rows and columns enclosed by
square brackets or ( ) large parentheses are called a matrix.
Injibara University 2
Linear Algebra for Economics
Example1:
Similarly, 4 3
2 5 is a 3x2 matrix
7 4
1 2
3 4 is a matrix of order 2. (2x2 matrix)
1
2 is a 3x1 matrix
3
1 2 3
A= 5 6 7
8 9 10
Injibara University 3
Linear Algebra for Economics
a11
a21
a31 is nx1 column matrix.
,
,
an1
3. Square matrix – A matrix in which the number of rows is equal to the number
of columns is called a square matrix.
Example: 1 2
3 4 is a 2x 2 square matrix
1 2 3
4 5 6 is a 3x3 square matrix
7 8 9
4. Null or zero matrix – A matrix of any order whose all elements are zero is
called a null (zero) matrix and denoted by 0.
Illustration: 0 0
0 0 is a null matrix of order 2 (2 by 2)
Injibara University 4
Linear Algebra for Economics
0 0 0
0 0 0 is a null matrix of order 2x3.
5. Diagonal matrix – A square matrix whose all elements except those in the
main diagonal are zero is called a diagonal matrix.
Illustration
A= 2 0 1 0 0 are diagonal matrices of order
0 3 and B= 0 4 0 2 and 3 respectively.
0 0 9
Main
diagonal
Main
diagonal
6. Scalar Matrix – A square matrix whose all elements except those in the main
diagonal are zero and the diagonal elements are all equal
is called a scalar matrix
Illustration
2 0 4 0 0
0 2 & 0 4 0 are scalar matrices of order 2 & 3
0 0 4 respectively.
7. Unit (identify) matrix - a square matrix whose main diagonal entries are all
unity (1) and the other elements are zero is called a
unit or Identify matrix. A unit matrix of order n is
denoted by In.
Illustration
I2 = 1 0 1 0 0 1 0 0 0
0 1 I3 = 0 1 0 I4 = 0 1 0 0
, 0 0 1 , 0 0 1 0
0 0 0 1
Injibara University 5
Linear Algebra for Economics
A square matrix A is said to be skew – symmetric If aij = - aji for all i and j i.e.
if a21 = - a12, a13 = - a31, a32 = -a23 etc. and a11 = a22 = - - - = 0
Illustration
0 -2 -4 0 a b
2 0 -6 and -a 0 -c are skew symmetric matrices of
4 6 0 -b c 0 order 3.
10. Triangular matrix – A square matrix whose elements aij = 0 whenever i<j
is called a lower triangular Matrix. Similarly, a square matrix whose
elements aij = 0 whenever i> j is called an upper Triangular Matrix.
Injibara University 6
Linear Algebra for Economics
2 0 0
8 10 0 and 4 0
14 16 18 10 15 are lower triangular matrices
2 4 6 5 10
0 8 10 and 0 15 are upper triangular matrices.
0 0 12
18
28 = constant matrix. (c)
20
3 2 7 18
9 3 3 28 Augmented matrix
3 6 5 20
Injibara University 7
Linear Algebra for Economics
A= 1 2 3 1 2 3
Let 4 5 6 and B= 7 8 9
A B as matrix A is of order 2x3, while B is of order 3x3
3. The following two matrices are also not equal
A= 1 2 3 1 2 3
5 6 7 and B= 4 6 7
A B as a 21 = 5 and b21 = 4 are different corresponding entries.
4. Suppose the following two matrices are equal. Find the value of the variable t,
a, b and m.
4t b-2 t2+4 -7
A= log81
a 9 2x2 and B = 4 m 2x2
Solution
Since the matrices are equal they must have equal dimension and
corresponding entries of the matrices should be equal.
Injibara University 8
Linear Algebra for Economics
a) 4t = t2 +4 b) b- 2 = -7 c) log81
a = 4 d) 9 = m
t2 -4t+4 = 0 b = -7+2 a4 = 81
(t – 2) 2 = 0 b = -5 a4 = 3 4
t=2 a=3
Thus, A = B if and only if t=2, b = -5, a =3 and m = 9
B. Scalar multiplication of a matrix
Let be a scalar and A be a matrix. Then the produce of the scalar and the
matrix A, written as A, is the matrix obtained by multiplying each element of
A by .
Illustration
a. If = 4 and A = 1 2 4
2 -3 4 , then
Injibara University 9
Linear Algebra for Economics
C= C11 C12 Where C11 = a11 b11 + a12 b21 + a13 b31
C21 C22 C12 = a11 b12+ a12 b22 + a13 b32
C21 = a21 b11+ a22 b21 + a23 b31
C22 = a21 b12+ a22 b22 + a23 b32
Injibara University 10
Linear Algebra for Economics
Example A = 2 2 2 0
0 0 2x2 &B= 0 0 2x2
Injibara University 11
Linear Algebra for Economics
Solution
i. Since the number of columns of A is equal to the number of rows
of B, we can obtain the product AB as follows
AB = 4 -7 25
13 51 0
Injibara University 12
Linear Algebra for Economics
Example If A = 1 -2 3 2 3 -1
2 4 -1 and B = 1 0 2
-3 4 5
Find AB and BA if possible
Solution
Matrix A is a 2x3 matrix and B is a 3x3 matrix so that the product AB is
defined and it is a 2x3 matrix.
AB = 1 -2 3 2 3 -1
2 4 -1 x 1 0 2
-3 4 5
= -9 15 10
11 2 1
Note: that the product BA is not defined in this case, since the number of
columns in B the number of rows in A. since the number of columns of
the first matrix B is different from the number of rows of the second
matrix A we can not multiply B with A.)
Illustrative examples
Example1. If A = 0 2 3 7 6 3
2 1 4 2x3 and B = 1 4 5 2x3
Injibara University 13
Linear Algebra for Economics
Solution
1. We have 2A = 2x 0 2 3 0 4 6
2 1 4 = 4 2 8
And 3B = 3 x 7 6 3 21 18 9
1 4 5 = 3 12 15
Hence 2A +3B = 0 4 6 + 21 18 9
4 2 8 3 12 15
= 0+21 4+18 6+9
4+3 2+12 8+15
= 21 22 15
7 14 23
Injibara University 14
Linear Algebra for Economics
2. If x+y = 7 0 3 0
2 5 and x – y = 0 3
We have x+y = 7 0 1
2 5
And x-y = 3 0
0 3 2
(x+y) + ( x-y) = 7 0 3 0
2 5 + 0 3 = (x+y+x-y = 2x)
10 0
2x = 2 8 = multiplying both sides by ½
10 0
x= ½ = 2 8
x= 5 0
1 4
5 0 7 0
1 4 +y = 2 5
y= 7 0 5 0
2 5 - 1 4
y= 2 0
1 1 subtraction of matrices
Injibara University 15
Linear Algebra for Economics
1
0 xB= 2 4 9 6 5 0
4. A = 7 1x6
8 4x1
1
AB = 0 x 2 4 9 6 5 0
7
8
AB = 2 4 9 6 5 0
0 0 0 0 0 0
14 28 63 42 35 0
16 32 72 48 40 0
The total cost is given by the element of the product AB which is 1x1
matrix.
AB = 4
8 10 4 x 9
6
AB = 8x4 + 10x9 + 4x6
AB = 32 + 90 + 24
AB = 146
Injibara University 16
Linear Algebra for Economics
6. If A = 2 -1 2
4 -3 and B = -3 , find C such that AC = B
Then, AC = B gives = 2 -1 x 2
4 -3 x y = -3
2x –y 2
4x-3y = -3
Injibara University 17
Linear Algebra for Economics
i. If A = 1 0 2 then transpose of A = At = 1 2
2 3 4 2x3 0 3
2 4 3x2
ii. If B = a b c a d g
d e f , then Bt = b e h rows become columns.
g h i 3x3 c f I 3x3
Example: For the following two matrices verify that (At)t = A and (A+B)t = At+Bt
A= 1 2 3 2 3 4
4 5 6 , and B = 1 8 6
Solution
a.) At = 1 4 2 1
2 5 and Bt = 3 8
3 6 4 6
(At)t = 1 2 3
5 5 6 =A
Thus, (At)t = A
b) A+B = 3 5 7
5 13 12
(A+B)t = 3 5 3 5
5 13 and At +Bt = 5 13
7 12 7 12
Injibara University 18
Linear Algebra for Economics
Give A = 1 2 3 and B = 4 7
4 5 6 2x3 5 8
6 9 3x2
Solution
At = 1 4 4 5 6
2 5 Bt = 7 8 9 2x3
3 6 3x2
Bt At = 32 77
50 122 2x2
(AB)t = 32 50 t
77 122
So, (AB)t = 32 77
50 122 2x2
Hence, (AB)t = Bt At = 32 77
50 122
But, (AB)t At Bt, having different orders which is 2x2 and 3x3
respectively.
Note the following:
i. A matrix ‘A’ with a property A = At is called a symmetric matrix.
Example:
If A = 2 8 18 2 8 18
8 14 10 , then At = 8 14 10
18 10 16 18 10 16
Injibara University 19
Linear Algebra for Economics
1.5DETERMINATS
If A is a square matrix with entries (elements) from the field of complex
numbers, then determinant of A is some complex number. This will be
denoted by det A or /A/. Determinant is a numerical value of a square
matrix.
a11 a12 a13 . . . a1n
a21 a22 a23 . . . a2n
If A= , , , ,
, , , ,
An1 an3 an3 ann
Injibara University 20
Linear Algebra for Economics
then we define
det A = /A/ = a11 a22 – a12 a21
If B = a b
c d , then B = ad – bc
Then we define,
det A = a11 (a22 x a33 - a23 x a32 ) - a12 (a21 x a33 - a23 a31 ) + a13 (a21 x a32 - a22 x
a31)
Injibara University 21
Linear Algebra for Economics
Solution
The first bracket in the definition of det A is determinant of the matrix
after deleting the first row and first column. Of matrix A
1 2 3 5 -6
4 5 -6 = 8 9 = (5x9) – (-6x9) = 45+54 = 99
7 8 9
The second bracket is determinant of the matrix after removing the first
row and the second column of matrix A.
1 2 3 4 -6
4 5 -6 = 7 9 = (4x9) – (-6x7) = 36 +42 = 78
7 8 9
The third bracket is determinant of the matrix after removing the first
row and third column of matrix A.
1 2 3
4 5 -6 4 5
7 8 9 = 7 8 = (4x8) – (5x7) = 32 -35 = -3
Injibara University 22
Linear Algebra for Economics
Solution
i. det A = 2 2 -4 1 -4 1 2
1 5 - (-1) -3 5 + 3 -3 1
Injibara University 23
Linear Algebra for Economics
Od1
Md1 Md2 Md3 Od2 Od3
2 -1 3 2 -1
1 2 -4 -1 2
-3 1 5 -3 1
Solution
We can compute the determinant of the matrix using sarru’s method as
follows. 2 -1 3
1 2 -4 =
-3 1 5
Where md = main diagonal
od = off diagonal
Md1 = 2x2x5 = 20
Md2 = -1x-4x-3 = -12
Md3 = 3x1x1 = 3
and
Od1 = 3x2 x(-3) = -18
Od2 = 2x-4x1 = -8
Od3 = 1x1x5 = -5
det A = (md1+md2+md3) – (od1+0d2+od3)
= (20 – 12+3) – (-18 – 8-5)
= 11- (-31)
= 11+31
= 42
a b c
Example2: If A = d e f , then det A = ?
g h i
Od1
Md1 Md2 Md3 Od2 Od3
a b c a b
d e f d e
g h i g h
Injibara University 24
Linear Algebra for Economics
and B= c d
a b , interchanging the two rows of A
B= a c
b d rows are changed into columns
Similarly if A = a1 a2 a3
a1 a2 a3 , then /A/ = 0
c1 c2 c3
and let B = ka kb
c d = multiplying the first row by K.
Injibara University 25
Linear Algebra for Economics
B = a+kc b+kd
c d adding k times of the second row to the first row
Now. /B/ = (a+kc) d- (b+kd) c
= ad + kdc – bc – kdc
= ad – bc = /A/
Solution
/A/ = a b = ad-bc
c d
M12 (minor of b) a b
c d =c
Injibara University 26
Linear Algebra for Economics
M21 = (minor of c) a b
c d =b
M22 (minor of d) a b
c d =a
Example If A = 1 -2
-3 -4 , then find minors of each element
Solution
Example 3: If A = a1 b1 c1
a2 b2 c2 , find the minors of each
a3 b3 c3 element and evaluate then.
Solution
Example 4: write the minors of the elements of the first row of the
following determinant and hence evaluate them.
/A/ = 1 2 3
-4 3 6
2 -7 9
Solution
M11 = 3 6
-7 9 = 27 – (-42) = 69
-4 6
M12 = 2 9 = -36 -12 = -48
Injibara University 27
Linear Algebra for Economics
-4 3
M13 = 2 -7 = 28 -6 = 22
Use the same procedures to find minors of the 2nd and 3rd row elements
1.5.2 Cofactors
The cofactors of any element in /A/ is the minor of that element in /A/
with proper sign depending on the numbers of the row and the column in
which the element occurs. If an element occurs in ith row and jth column
in /A/, then the cofactor of the element = (-1) i+j x (Minor of the element),
cofactor of the element is denoted by Cij.
Thus, Cij = (-1) i+j x Mij
Example:- If A = 2 -3
4 3 , find the cofactors of each element.
Solution
Recalling the method of finding minor of an element, we obtain
M11 = 3, M21 = -3 and
M12 = 4 M22 = 2
After obtaining the minors of the elements, we simply substitute them in
the formula to find the corresponding cofactors.
C11 = (-1) 1+1 .M11 = 1x3=3
C12 = (-1) 1+2 .M12 = -1x4 = -4
C21 = (-1) 2+1 . M21 = -1x(-3) = 3
C22 = (-1) 2+2 .M22 = 1x2 = 2
In matrix form the cofactors can be put as follows
CA= 3 -4
3 2
Example2: If A = 1 2 3
-4 3 6 , find the cofactors of each element
2 -7 9
Injibara University 28
Linear Algebra for Economics
Solution
First find the minors of each element and multiply each minor by (-1) i+j
obtain cofactors.
M11 = 3 6
-7 9 = 27 – (-42) = 69
-4 6
M12 = 2 9 = -36 -12 = -48
Injibara University 29
Linear Algebra for Economics
1 -1 1
A= 2 3 0
18 2 10
Solution:-
We have A = 1 -1 1
2 3 0
18 2 10
and using the steps above to find adjoint of a matrix we obtain adj A =
3 0 -1 1 -1 1
2 10 - 2 10 3 0
2 0 1 1 1 1
- 18 10 18 10 2 0
Adj A =
2 3 1 -1 1 -1
18 2 - 18 2 2 3
Injibara University 30
Linear Algebra for Economics
30 22 -3
Adj A = -20 -8 2
-50 -20 5
0 0 0
0 0 0
0 0 0
Multiplying A and B
It can be easily see that
AB = BA = I (unit matrix)
In this case, we, say, B is inverse of A. or A is inverse of B.
Note that:
i. Inverse of a square matrix is defined only for square matrices
ii. If B is an inverse of A, then A is also an inverse of B.
iii. If a matrix A has an inverse, then A is said to be invertible
iv. Inverse of a matrix is unique
Uniqueness of inverse of a matrix can be easily shown as follows
Injibara University 31
Linear Algebra for Economics
A(adjA) (adjA) A A I
(Dividing both sides by A 0.)
A A A
A(adjA) (adjA)
Since A-1A= AA-1= I, A AA1 I
A A
adj A 1
This relation shows that A-1 = (adjA) dividing again both sides by A.
A A
1
Hence, A-1 = inverse of A= (adjA), where A 0
A
Injibara University 32
Linear Algebra for Economics
2 1
CAt = 1 2 = adj. A
1 1 2 1 2 1
Step3: A-1 = .adj A = 3 3
A 3 1 2
1 2
3 3
2 1
Thus, A-1 = 3 3
1 2
3 3
ii. B = a b
c d
Step:1 B= ad – bc
Step 2: C11 = d, C12 = -C, C21 = -b, C22 = a
CB = d -c
-b a
Injibara University 33
Linear Algebra for Economics
CBt = d -b
-c a = adj B
b
d b
d
Step 3. B-1 =
1
=
1
= ad bc ad bc
adj B x
ad bc
c a c a
B
ad bc ad bc
b) The Gaussian elimination procedure
The following elementary operations are needed to use Gaussian method of finding an
inverse of a matrix
i. Interchanging two rows
ii. Multiplying a row by a non-zero scalar
iii. Adding a scalar multiple of one row to another.
Briefly, the Gaussian method starts by writing the given matrix at the left and the
corresponding identify matrix at the left and the corresponding identify matrix next to it
at the right). Then select and carry out row operations that will convert the given matrix
into the identify matrix, and apply the same operations to the matrix at the right. When
the left matrix becomes the identify matrix, the matrix on the right will be the desired
inverse.
Zeros, first: For simplicity, the Gauss- Jordan method proceeds to obtain ones on the
main diagonal and zeros on the off diagonal elements.
Obtain the off –diagonal zeros first and following this, obtain ones on the main
diagonal.
To illustrate, let us find the inverse of the matrix
A= 3 2
1 1
A = AI = 3 2 1 0
1 1 0 1
Injibara University 34
Linear Algebra for Economics
1 1 0 1 R2 = -3 R1+R2
0 -1 1 -3
R2
1 1 0 1 R2 =
1
0 1 -1 3
1 0 0 1 R1 = R1 –R2
0 1 -1 3
A-1 = 1 -2
-1 3
As a check, we have
3 2 1 -2 1 0
1 1 x -1 3 = 0 1
i. A = AI= 7 3 1 0
2 1 0 1
Injibara University 35
Linear Algebra for Economics
2 1 0 1
7 3 1 0 - Interchanging rows.
1 0 1 -3
0 -½ 1 7/2 R1 = R1+R2
1 0 1 -3
0 1 -2 7 R2 = -2 R2
A1 1 -3
-2 3 at the right.
ii. B= 0 1
2 3
2 3 0 1 Interchanging rows
0 1 1 0
2 0 -3 1 R1 = -3R2 +R1
0 1 1 0
1 0 3/2 ½ R1 = R1
0 1 1 0 2
Hence, A 1 = -3/2 ½
1 0
Partitioned Matrices
Injibara University 36
Linear Algebra for Economics
In real world problems, systems can have huge numbers of equations and un-knowns.
Thousands of equations and hundreds of thousands of variables are not uncommon.
Standard computation techniques are inefficient in such cases, so we need to develop
techniques which exploit the internal structure of the matrices. In most cases, the matrices
of interest have lots of zeros: they are sparse.
Rank of a Matrix
The maximum number of its linearly independent columns (or rows) of a matrix is
called the rank of a matrix. The rank of a matrix cannot exceed the number of its rows or
columns.
If we consider a square matrix, the columns (rows) are linearly independent only if the
matrix is nonsingular. In other words, the rank of any nonsingular matrix of order m is m.
The rank of a matrix A is denoted by ρ (A).
The rank of a null matrix is zero. A null matrix has no non-zero rows or columns. So,
there are no independent rows or columns. Hence the rank of a null matrix is zero.
Injibara University 37
Linear Algebra for Economics
Injibara University 38