Professional Documents
Culture Documents
SCHOOL OF MATHEMATICS
MATH 1131
MATHEMATICS 1A ALGEBRA.
Section 5: - Matrices.
In our last topic we used matrices to solve systems of linear equations. A matrix was simply
a block of numbers, which, in that context, represented the co-efficients of the unknowns
in some system of equations. In this topic, we are going to look at the basic properties of
matrices, regarded simply as blocks of numbers.
Definition: An m n matrix A is simply a block of numbers written with m rows and
n columns. If m = n we say that A is a square matrix. The set of all m n matrices is
denoted by Mmn . In most of our work, the numbers in question will be real, but later we
will also deal with matrices whose entries are complex numbers.
A=
a11
a21
a31
..
.
a12
a22
a32
..
.
..
.
a1n
a2n
a3n
..
.
am1
am2
amn
We will use the notation aij , to denote the general element in the matrix A, (similarly bij
for the general element in the matrix B and so on).
We will also use the notation (A)ij to denote the general element aij in the matrix A.
For example
1 2 3 4
A = 9 2 21 0
5 4 3 2
is a 3 4 matrix and a23 = 21 .
In Mmn there is a special matrix called the zero matrix which has all its entries equal
to 0. It is generally denoted by 0.
For example
0 0 0 0
0=
0 0 0 0
0 0 0 0
is the zero matrix in M34 .
In Mnn , the set of all square matrices of size n, there is another special matrix called the
identity matrix. It consists of 1s down the main diagonal, i.e. aii = 1 and zeros everywhere
else. It is generally written as In and sometimes simply as I, where the context tells us the
size.
1
For example
I2 =
1 0
0 1
1 0 0
I3 = 0 1 0
0 0 1
is the identity matrix in M33 .
Definition: We say that two matrices A and B are equal if they have the same size (i.e. the
same number of rows and columns) and aij = bij for each i, j. In other words, their entries
in identical positions are the same.
Addition and Subtraction of Matrices:
We can only add or subtract matrices which have the same size, and we do this by simply adding or subtracting the entries in the same position.
More formally, if A = (aij ) and B = (bij ) are matrices of the same size, then we define
C = A + B, by C = (cij ) where cij = aij + bij . Similarly with subtraction.
1
2
3
5
3
9
4 1 2
1
2
Ex: If A = 4 7 3 and B = 9 2
then
1 2 8
1 3
1
2
3
H
1
H2
H3
M C N
$
1 2 3 2
2 2 1 3
5 4 3
1
To work out the total cost to each house, we would do the following. The cost to the first
house will be 1 2 + 2 3 + 3 1 = 11 and so on for the other houses, for the second house
it is 2 2 + 2 3 + 1 1 = 11 and for the third 5 2 + 4 3 + 3 1 = 25
This example suggests how we might define multiplication of an m n matrix by an n 1
matrix (i.e. a vector with n entries).
1
2
3
1
Ex: Multiply A = 9 2 5 by v = 2 .
1 3 5
3
n
X
aik xk for 1 i m.
k=1
Now to multiply two general matrices together, we can think of each column of the second
matrix as a vector and simply apply the above ideas. Notice that for this to make sense we
need the number of columns of the first matrix to equal to number of rows of the second.
In other words we can multiply an n m matrix by an m p matrix and answer will be an
n p matrix.
1
2
3
2 3
9
Ex. Multiply the matrices A and B where A = 9 2 5 and B = 5
.
1 3 5
2 4
2
3
1 2
9 2
n
X
aik bkj
k=1
for 1 i m and 1 j p.
Ex: Find AB and BA if A =
2 3
2 5
and B =
9 2
1 3
As you see from the above example, in general AB does not equal BA. This is extremely
important fact to keep in mind. In general, matrix multiplication is NOT commutative.
Note that we write An for A
A
A} .
|
{z
n times
2 3
2 5
!n
n nn1
0
n
and I =
1 0
0 1
n
X
air (BC)rj =
r=1
p
n X
X
n
X
air
r=1
r=1 s=1
p X
n
X
p
X
brs csj
s=1
s=1 r=1
At this stage, we have swapped the order of summation. You should check this step carefully.
Continuing,
(A(BC)ij =
p
X
n
X
s=1
r=1
p
X
s=1
For (iii), we again need to check that the entries of (A + B)C are equal to the entries in
AC + BC. Thus
((A + B)C)ij =
n
X
(A + B)ik ckj
k=1
n
X
k=1
n
X
aik ckj +
k=1
n
X
bik ckj
k=1
!
1
2
1 9 1
T
change the rows and columns. For example if B = 9 2 then B =
.
2 2 3
1 3
More formally, (AT )ij = aji .
Thus (AT )T = A. (An operation which when composed with itself gives the identity function
is called an involution. Complex conjugation is another example of an involution.)
Note that the transpose of a column vector is a row vector. If we take two (column) vectors,
a, b, (of the same size) then the quantity aT b is a 1 1 matrix whose entry is simply the
dot product or scalar product of a and b, as we saw in an earlier chapter. Note however
7
for two vectors of the same size, n, then abT is an n n matrix matrix.
1
2
T
T
Ex: Find a b and ab for a = 0 and b = 3 .
1
1
The transpose has the following properties which should be carefully noted.
Theorem: If A and B are matrices such that A + B and AB is defined, then
(i) (AT )T = A
(ii) (A + B)T = AT + B T
(iii) (A)T = AT .
(iv) (AB)T = B T AT .
Take particular note of result (iv). Proofs of (i), (ii) and (iii) are trivial.
Proof: (iv) Suppose A is an m n matrix, then B is an n p matrix. Hence
(AB)Tij = (AB)ji =
n
X
ajk bki .
k=1
Also
(B T AT )ij =
n
X
k=1
n
X
k=1
bki ajk =
n
X
k=1
Rotation Matrices:
!
x
Suppose
is the position vector of a point P in 2-dim space, which has distance r
y
from the origin and makes an angle of with the positive x axis.
r cos
This vector can be written as
.
r sin
Now !
rotate P anti-clockwise about the origin through an angle to the new point P 0 =
x0
.
y0
Then
x0
y0
=
r cos( + )
r sin( + )
x cos y sin
x sin + y cos
cos
sin
sin
cos
x
y
= Ax.
A =
cos 2
sin 2
sin 2
cos 2
and so on.
!1
1
=
ad bc
d b
c a
This formula will only work if ad bc 6= 0. This quantity is called the determinant of the
matrix. You can check the formula works by simply multiplying.
Ex: Find the inverse of
3 1
2 5
For matrices of higher order, there is no simple formula for the inverse. We will develop an
algorithm for finding the inverse if it exists.
Suppose we have a 3 3 invertible matrix A whose inverse X we seek to find. We know that
10
AX = 0
0
Suppose we
0 0
1 0
.
0 1
write X as x1 x2 x3 where x1 etc are the columns of X. Thus we have
1 0 0
A x1 x2 x3 =
0 1 0 . We can think of this equation as three sets of equations,
0 0 1
1
0
0
1 2 3
1 6 4
11
Properties of Inverses:
Suppose that A, B are invertible matrices of the same size then
(i) (A1 )1 = A.
(ii) (AB)1 = B 1 A1
Note the second result. It is very similar to the rule we had for transposes. Observe also
that it generalises: (ABC)1 = C 1 B 1 A1 assuming that all the matrices have the same
size and invertible.
To see why (ii) is true, we simply note that (AB)(B 1 A1 ) = A(BB 1 )A1 = AIA1 =
AA1 = I. Hence the inverse of AB is B 1 A1 .
Ex: Simplify HG(F HG)1 F G.
x=
2
3
is invertible.
Determinants:
We have seen that the inverse of the general 2 2 matrix
a b
c d
ad bc 6= 0.
This quantity is called the determinant of the matrix.
a b
c d
a b
det(A) = ad bc or
c d
= ad bc.
There is a similar, but more complicated formula for the determinant of a 3 3 and higher
size matrices. There are various ways to define the determinant, but we take a purely computational approach and develop a method of calculating the determinant for a general matrix.
Definition: Suppose A is a square matrix. We define |Aij |, called the ijth minor of
A, to be the determinant of the matrix obtained by deleting the ith row and jth column of
A.
1
4 5
1 4
For example, if A = 1 2 7 then |A23 | =
2 3
2 3 4
= 11.
13
1
4 5
For 4 4 matrices (and higher orders), we have to apply this definition iteratively.
There is, however, a more efficient method of finding the determinant which we shall see later.
Properties of the Determinant:
Suppose A and B are n n matrices then
(i) |AB| = |A||B|.
(ii) |A| = |AT |.
(iii) |I| = 1.
(iv) |A1 | =
1
|A|
Proof of (iv): AA1 = I so |AA1 | = |I|. Now using (i) and (iii) we see that this is
equal to |A||A1 | = 1 and the result follows.
In the light of property (ii), we can see that we can change the definition of determinant
slightly and expand down the first column instead of the across the first row. This can be
very useful calculationally, for example:
1 4 5
The deteminant 0 2 7
0 3 4
2 7
= 1
= 29, since if we expand down the first col
3 4
14
Ex: Suppose |A| = 3, |B| = 2, and A, B are square matrices of the same size.
Simplify |A2 B T (B 1 )2 A1 B|.
15
1 2 3
Ex: Find 2 5 3
1 0 8
Ex: Find
1 1 0
3
2 2 6 1
.
4 2 1
7
3 5 7 2
16
1 1 3
3 1
.
3 1 4
17