Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MATRIX OPERATIONS
An m n matrix is a rectangular array of real numbers with m rows and n
columns.
Matrices are added and subtracted using simple pointwise operations.
If A is m n and B is p q then the product AB exists if and only if n = p and
the resulting matrix is m q.
In general AB 6= BA
A matrix is simply a mathematical object comprising a rectangular block of real numbers.
Example 1: Examples of matrices are
1
3
3
11
1 2 3
1
a) 2 7 8 b)
3 5 9
2
7
7
11
and
c)
1
2 3
Observe that the matrix can be any rectangular shape and that the numbers (called
entries) can be any real number. Later on we will also look at complex matrices where
the entries are complex numbers!
We classify matrices according to their size (also called dimension) with a matrix of
size m n having m rows and n columns. We always specify rows first. Thus the above
three matrices are of size 33, 32 and 22.
Note that if a matrix has as many rows as columns (and hence is n n) we call it a
square matrix.
We denote the set all all real m n matrices by Mmn (R).
4
4
6 2 7
4 1 3 9
Example 2: If A =
5 9 3 7 then A is a 44 matrix with
1
8 6 5
[A]24 = 9, [A]13 = 2 and [A]41 = 1
We sometimes also write [A]ij as aij .
Matrices are useful as a notational tool (for example we made great use of [A|b] in
Gaussian Elimination) and also as abstract mathematical objects.
We would like to be able to manipulate matrices just as if they were numbers! The
operations of addition, subtraction and scalar multiplication are trivial.
2 3
1 3
1 2 3
Example 3: Let A = 1 2 , B =
and C = 3 0 .
1 5 0
0 4
2 5
Find (if possible) A + C, A + B, 4B and 2A C.
3 6
F A + C = 4 2
2 9
4B =
4 8 12
4 20 0
3
3
2A C = 1 4
2 3
A + B is undefined
Observe that matrices can only be added or subtracted when they are of the exactly
the same size.
2
So your left hand sweep across the first matrix while your right hand sweeps down
the second matrix and you multiply and add as you go. A formal definition of matrix
multiplication will close the lecture.
What about BA?? Have a go now:
BA =
3 5 7 2
=
6 8
1 4
F AB =
33 51
27 37
,
BA =
26 26
50 44
F
1 0
1 2 3
Example 5: Find AB if A =
and B = 2 7 .
6 5 4
4 8
A is a 2 3 matrix and B is 3 2. Strangely (more on this soon) AB is 2 2.
F AB =
17 38
32 67
F
F
4
1
Example 7: Let C =
1
DC
2 3
1
0 1 and D = 2 . Find (if possible) CD and
0 2
3
14
F CD = 4
7
The above example shows that matrices may be used to transform vectors. This is
the most important application of matrix theory.....matrices are transformations !
We have two special square matrices, the identity matrix I and the zero matrix 0.
These are
1 0
0 0
22: I =
and 0 =
0 1
0 0
1 0 0
3 3 : I = 0 1 0 and
0 0 1
0 0 0
0= 0 0 0
0 0 0
3 1
Example 8: Let A =
. Find AI, IA, A0 and 0A where the identity and zero
2 5
matrices are of the appropriate size.
F AI = IA = A,
Example 9: Let D =
3 5 7
2 4 8
A0 = 0A = 0 F
. Show that DI = ID = D.
F
6
The proofs of these results come down to the formal definition of matrix multiplication
and may be found in your lecture notes.
We have been multiplying matrices algorithmically however a formal definition does
exist:
Definition If A is an m n matrix and B is a n q matrix then
[AB]ij =
n
X
[A]ik [B]kj
k=1
Example 10: If A =
4 6 9
3
and B = 5 find [AB]21 using the formal
8
3
X
=
[A]2k [B]k1 = [A]21 [B]11 + [A]22 [B]21 + [A]23 [B]31 = 4 3 + 6 5 + 9 8 = 114.
k=1
F
We have not mentioned matrix division! This is because it doesnt work properly and
the closest we can come to division is the concept of an inverse, which we leave to the
next lecture.
7