Sei sulla pagina 1di 7

LECTURE 20

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

1 can also be viewed as a 31 matrix and all vectors (row


Note that the vector
5
or column) can be interpreted as matrices.
We denote by [A]ij the ijth entry of A.

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 matrix addition and subtraction is easy to implement. The definition of matrix


multiplication is however quite bizarre and not what you would expect. We will see in
the second session why this definition is needed (and in fact quite natural). Let us take
a look at a simple example.




7 2
3 5
Example 4: Let A =
and B =
. Find AB.
1 4
6 8

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

!!Observe that AB 6= BA!!


We say that matrix multiplication is non commutative. It really does matter which
one is put down first!

A remarkable feature of matrix multiplication is that matrices of different sizes can


sometimes be multiplied together!



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

Note that if A is m n and B is p q then AB exists if and only if n = p and the


resulting matrix is m q.

Example 6: Find BA for the matrices of the previous question.

F
4

So not only do we have AB


different sizes.

1
Example 7: Let C =
1
DC

6= BA, the matrix products AB and BA can even be of

2 3
1
0 1 and D = 2 . Find (if possible) CD and
0 2
3

14
F CD = 4
7

DC does not exist

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

These serve as the one and the zero of matrix theory.


5


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

Properties of Matrix Multiplication


Suppose thatA and B are matrices and that the relevant products exist. Then:
i) A(BC) = (AB)C (associativity)
ii) A(B + C) = AB + AC (distributivity)
iii) A(B) = AB for R
iv) AI = IA = A
v) In general AB 6= BA
vi) Is it true that (A + B)2 = A2 + 2AB + B 2 ??

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

definition of matrix multiplication.


We have i = 2, j = 1 and n = 3 so:
[AB]21

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

Using the more intuitive approach we get:

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

Potrebbero piacerti anche