You are on page 1of 10

Chapter 1

Matrices

Objectives:
After completing this module, the student should be able to:
 identify various types of arrays and matrices, and give their dimensions.
 add, subtract and multiply matrices, and multiply matrices by a scalar.
 calculate the determinant of a square matrix.
 determine the inverse of a matrix.
 use the inverse of a matrix to solve a system of linear equations.

Definitions and Terminology


 An array is a set of numbers arranged in a pattern.
 A vector is an array consisting of a single row or a single column.
 A matrix is a rectangular array of numbers, called the elements of the matrix and enclosed
by a pair of brackets.
 The position of each element of a matrix is indicated by a double subscript, indicating the
1 2
row and the column that the element is located in e.g. if A=  3 , then element a31
 0 
 4 1
 
 5 6
= 4.
 A line matrix has one row only, e.g. 0  2
 1
 A column matrix has one column only, e.g.   3
 

 6 

 The dimension or order of a matrix is the number of rows and the number of columns in
1 2
the matrix, e.g. if A=  0 3 , then the order of A is 4 x 2, since the matrix has 4 rows
 4 1
 
 5 6
and 2 columns.
 A scalar is a single number as opposed to an array.
 All the elements of a null matrix are equal to zero
0 0 0 
0 0 
e.g.   (of order 2 x 2) or 0 0 0 (of order 3 x 3).
0 0  0 0 0

1
 If the elements on the main diagonal are equal to one and all the other elements are equal
to zero, the matrix is called a unit matrix or identity matrix, and is usually denoted by
an “I”:
Example

1 0 0
I = 0 1 0 is a 3 x 3 unit matrix or a unit matrix of order 3.
0 0 1

Example

1 0
I=   is a 2 x 2 unit matrix, or unit matrix of order 2.
0 1 

 If the rows of a matrix are changed to columns and the columns to rows, the matrix is
transposed,

1 2
0 3  1 0 4  5
e.g. if C =  , then C T =  2 3 1 6 .
4 1  
 
 5 6

Exercise 1.1
1. Transpose the following matrices:
1  2  2 1
a)   b)  2 3
0  1  

 2 0  1
c) 1 0 1 
d) 2 3 3 
 

4  1  1 2  1
e)   f)  
2  2  2  1 2 
1 1  1 3  3

1  5  0 1
g)   h)  
1 0    1 2
3  4  2 1

2 1 2   1 1 2 
i)   j)  
 0  2  1  2 1 0 
 2 3  2  1 3  1

2
More definitions
 The determinant of a square matrix is a scalar quantity, representing a certain defined
alternating sum of products of elements of the matrix.

 1 3 
If A =   , then the determinant of A is written as follows:
 4  2

1 3
det(A) or A = =  10 .
4 2

 The determinant of a singular matrix is zero. A non-singular square matrix has an inverse
 4 6
e.g. if matrix A =   , then
 2 3

A = 12 – 12 = 0

and A will therefore NOT have an inverse.

 Place signs are used in the calculation of determinants. The signs alternate, starting with
a plus i.e.
   ...
   ...
   ...
... ... ... ...

 If A is a square matrix, it has a determinant associated with it. Each element of the
determinant gives rise to a cofactor, which consists of the minor of the element together
with its place sign.

 1 0 1 
 If matrix A =  2  2 1 , then the minor of element a33  4 , is determined by
 5 3 4

striking out the line and column containing the element 4 and forming a determinant of
1 0
the remaining elements. The minor of element 4 is  2 , and the place sign is +.
2 2

The cofactor of the element 4 is therefore +(2) = 2.

The cofactor of a 23  1 is  (3)  3.

It is interesting to note that the cofactor expansion becomes very laborious for large matrices.
Even for a reasonably modest 11 x 11 matrix, the number of calculations required, is
approximately 108 505 112. If each calculation takes approximately 1 microsecond, then the
following table gives some time estimates:

3
(Greenberg, M.D., Advanced Engineering Mathematics, Prentice-Hall, New Jersey)

n Computing Time
5 0,0003 s
10 10 s
15 4 x10 6 s  40 days

20 7 x1012 s  210 000 years

25 4 x1019 s  1012 years

It will not help to use a faster computer either, since even a computer that is a million times as
fast would still take around 10 6 years to evaluate a 25 x 25 determinant. Gaussian elimination
or related techniques are almost always preferred in actual computation for matrices larger
than 3 x 3.

Exercise 1.2
1. Find the matrix of cofactors for the given matrices:
 4  1 2  1 2  2
a)   b)  
 3  2 8 0 1 0 
 3 0 5  1 3  3

Operations with matrices


Addition and Subtraction of Matrices
To add two matrices, they must have the same dimensions. Simply add the corresponding
elements. The same applies to subtraction.

Example

If A =  7 2 4 and B = 2 5  8 , then

A+B =  5 7  4 and AB =  9  3 12 .

Scalar Multiplication
If a matrix has to be multiplied by a scalar (a number), then each element of the matrix has to
be multiplied by that number.

Example

4
8 5  1 24 15  3
A = 0  2 3  , then 3A =  0 6 9 
 
1 0 4   3 0 12 

Multiplication of two Matrices


The number of columns in the first matrix has to equal the number of rows in the second
matrix, otherwise the product is not defined

Example
If A is a 3x2 matrix, and B is a 3x4 matrix, the product A.B is NOT defined.
If A is a 3x2 matrix, and B is a 2x5 matrix, then A.B IS defined.

Example
 2
If A = 2  3 1 and B =  1  , then
 4 

A.B = 2 2   31  14   3 . ( Order 1 x 1)

Example
1 X2
3 1 
if C = 3 2 (order 2 X 1) and D =   , (order 2 x 2) then
 2 4
C  D  33  22 31  24
 13 11

(order 1 x 2)

“Exceptional” properties of matrix multiplication:

 AB  BA in general

 AB  AC does not imply that B  C (even if A  0 )

 AB  0 does not imply that A  0 and/or B  0

 A 2  I does not imply that A   I or  I

Exercise 1.3
5
Multiply the following matrices:

1  2 3  2 1  1 1
a) 0  1  2 b)  2 3   2 1
       

c) 0  2  2 0  1 d) 2
1  1    1 0 1  2   
3  3   1
   
 4 

4  1 1 2  1
e)   f)
 
2  2 3  2  2  
 
 4 2  1  2  1 2 
1 1  1 3  3

1  5  0 1
g)    1 h)   4  3
1 0    2    1 2   0  2 
3  4    2 1  

2 1 2  1  1  1 2    1 1 2
i)     j)    
 0  2  1   1  2  1 0    2 4 0
 2 3  2  1   1 3  1  2 1 1

Exercise 1.4
2 3 4 6 3 5 2 7
1. If A    and B    , determine
1 6 0 4 8 1 5 2

a) A B
b) A B
c) C, if 2 A  C  B

 2 7
5 0 4 
2. Given that A    and B   9 0 , determine
1 5  2  3 8

a) A B b) B A
c) 3A

Equal Matrices
Two matrices are equal if their corresponding elements are equal. This property is often used
to solve for unknown quantities:
Example

 2 a 2  5
If A    and B    , and A  B ,
 3 b  c 3 

then a  5, b  3 and c  3


6
Example

If A   3 2 x, and A  AT  17 , find the possible value(s) of x.

Solution

 3
A  A   3 2 x   2 
T

 x 


 9  4  x2 (by matrix multiplication)

 13  x 
2

But A  AT  17

 
 13  x 2  17 (given)

13  x 2  17 (individual elements of equal matrices are equal)

 x2  4
 x  2

Inverse of a matrix by using a five step process


To form the inverse of a square matrix A:

a) Evaluate the determinant of A, i.e. A .

b) Form a matrix C of cofactors of the elements of A .

c) Write the transpose of C, i.e. C T to obtain the adjoint of A.

d) Divide each element of C T by A .

e) The resulting matrix is the inverse A 1 of A.


Example
2  1 3 
1 3  1
If A =   , find the inverse of A.
2  2 5 

Solution

a) A 9.

7
1
Since A  0 , the inverse of A exists and is given by A 1   CT .
A

 13  7  8
b) C =   1 4 2 
 8 5 7 

 13  1  8
c) C   7 4
T
5  .
  8 2 7 

 13  1  8  139  19  89 
 A 1   7 4 5    79 5 
1 4
d) 9 9 
9
  8 2 7   89 2
9
7 
9 

Solving a System of Linear Equations using Matrix Inversion


If Ax = b is a set of linear equations, where x is a vector of n variables, and b is a vector of m
constants, then we can multiply both sides of the matrix equation by the inverse of A:
A1  A  x  A1  b
But A1  A  I , I  x  A1  b

i.e. x  A1  b
That means that if we form the inverse of the matrix of coefficients and pre-multiply matrix b
by it, we shall determine the matrix of solutions of x.

Example
To solve the set of equations
x1  2 x 2  x3  4
3x1  4 x 2  2 x3  2
5 x1  3x 2  5 x3  1
a) Write the set of equations in matrix form:
1 2 1   x1   4 
3  4  2   x    2 
   2  
5 3 5   x3   1

i.e. A  x  b  x  A1  b
b) Calculate the value of the determinant:

8
1 2 1
A  3  4  2  35
5 3 5

c) Find the matrix of cofactors:

 14  25 29 
C    7 0 7 
 0 5  10

d) Find the transpose of C, i.e. C T :

  14  7 0 

adj A  C   25 0
T
5 
 29 7  10

e) Write down the inverse of A:

  14  7 0 
1 
5 
adj A
1
A     25 0
A 35
 29 7  10

f) Solve:

  14  7 0  4   70 
1   
5    2     105

1 1 
 x  A  b    25 0
35 35
 29 7  10  1  140 

 x1  2
  x 2    3 
 
 x3   4

 x1  2; x2  3; x3  4

Exercise 1.5

3 2 4
1. Show that matrix A is a singular matrix if A =  1 5 3 .

 1 8 2

1 4 3
2. If A = 6 2 5 , determine
 
1 7 0

a) A and

b) adj A

9
3. Solve the following set of linear equations by matrix method:

x1  3x 2  2 x3  3
2 x1  x 2  3x3  8
5 x1  2 x 2  x3  9

4. The following question is not for Civil Engineering students:

j 0   0 1 0 j  1 0
If A =   ,B=  ,C=  and I =   , where 1  j , determine
0  j    1 0  j 0 0 1 
the following products and express the answers in terms of A, B, C and I.
a) A.B b) B.C

c) C.A d) A2

 1 0,5 1 2 
5. If A =   and B =   , determine
0,5 1   2 3

a) B 1 b) A.B

c) B 1 .A

6. For what value of  , if any, does the following matrix have an inverse?

  1 2 
A= 
 3  

  
cos 4 x
7. Obtain the values of x and y if the matrix A    satisfies the

 sin y
 4 

equation AAT  I where AT is the transpose of A.

5 4 3 4  x  3 2  5
3 
5 4 4 1 2  2 3 
8. Given M   and its inverse M  
1 .
5 4 4 5  6 7 6 y
   
3 1 1 2  7 7  5 z 

Find the unknown elements x, y and z in the given inverse of matrix M.

1 0 0 0
0 1 0 0
(Hint: M  M 1 I  ).
0 0 1 0
 
0 0 0 1

10

You might also like