Introduction to Matrices (plural for Matrix)

(This material is experted from http://www.tutor.ms.unimelb.edu.au/matrix/matrix_basics.html etc)

DEFINITION

A matrix is a rectangular array of items. In our context the items will typically be numbers.

EXAMPLES. A and B below are examples of matrices.

A =

 1 4 3 0 -2 1

B =

 1 9 -1 8

Most books write the array inside large brackets, but that is difficult here, so we will use a border right around instead.

TERMINOLOGY AND NOTATION

§  If a matrix has m rows and n columns we say it is an mxn matrix or that the SIZE of the matrix is mxn.
In the example above, A is a 3x2 matrix.

§  When m = n we say the matrix is SQUARE. In the example above, B is a square matrix and has size 2x2.

§  The numbers in the array are called ELEMENTS or ENTRIES of the matrix.

§  If we want to write a general matrix A, we denote the element in row i and column j as aij.
So a shorthand way of writing A is A = (aij) where i = 1, 2, ...m and j = 1, 2, ...n and by this we mean

A =

 a11 a12 ... a1n a21 a22 ... a2n ... ... ... ... am1 am2 ... amn

§  For A in the example above, a22 = 0, a31 = -2. For B in the example above, b12 = 9, b22 = 8.

§  If a matrix has only one row it is called a ROW MATRIX or ROW VECTOR; If a matrix has only one column it is called a COLUMN MATRIX or COLUMN VECTOR.

EXAMPLES. C below is an example of a row matrix; D below is a column matrix.

C =

 1 -2 3

D =

 4 0 6

BASIC PROPERTIES AND OPERATIONS

EQUALITY

Two matrices are equalif and only if they have the same size and corresponding elements are equal.

EXAMPLE. When does

 a b c d

=

 1 2 3 4

?

The two matrices have the same size. To be equal we also need

 a = 1, b = 2, c = 3, d = 4.

ZERO MATRIX

A zero matrix is a matrix with all its entries zero. We denote the zero matrix by 0 if there is no confusion about size, otherwise we use 0mxn.

EXAMPLES.

03x2 =

 0 0 0 0 0 0

01x2 =

 0 0

OPERATIONS

If A and B are the same size we can add (subtract) them and we do so by adding (subtracting) corresponding elements.

EXAMPLES.

(i)

 1 2 3 4

+

 2 -1 4 6

=

 1 + 2 2 - 1 3 + 4 4 + 6

=

 3 1 7 10

(ii)

 1 2 3 4

+

 2 4

is not defined because the matrices are different sizes.

If A, B, C are all mxn matrices (i.e. all the same size) then

A + B = B + A
A + (B + C) = (A + B) + C
A + 0mxn = A.

SCALAR MULTIPLICATION

If A is any matrix and p is any real number, the product pA is the matrix obtained by multiplying each element of A by p.

EXAMPLE.

3

 1 2 3 4 5 6

=

 3 6 9 12 15 18

PROPERTIES OF THE SCALAR MULTIPLICATION OPERATION

If p and q are real numbers and A and B are matrices of the same size, then

p(A + B) = pA + pB
(p + q)A = pA + qA
pqA = p(qA)

TRANSPOSE OF A MATRIX

If A is an mxn matrix then the transpose of A, denoted AT or At or sometimes A', is the nxm matrix obtained by interchanging the rows and columns of A.

Thus the first row becomes the first column, the second row becomes the second column, etc.

EXAMPLE. Find the transpose of

 1 2 3 4 5 6

The transpose is

 1 4 2 5 3 6

PROPERTIES OF THE TRANSPOSE OPERATION

If A and B are matrices of the same size, then

(AT)T = A

(A + B)T = AT + BT.

MATRIX MULTIPLICATION

How do we multiply a matrix by a matrix? The definition is not the natural thing one would first think of, but, strange as it at first seems, it is what has been found to be very useful.

DEFINITION

Given two matrices A = (aij) and B = (bij) we can only find AB if the number of columns of A is the same as the number of rows of B.

Suppose that A is mxn and B is nxp, (i.e. the number of columns of A is the same as the number of rows of B), then C = AB is an mxp matrix where the elements of C, cij, are given by

cij = ai1b1j + ai2b2j + ...+ ainbnj

i.e. To get the ij element of C, multiply the elements of row i from A with the corresponding elements of column j from B and add.

EXAMPLE. Find AB and BA if possible, where

A =

 1 2 3 4

B =

 5 6 7 8

A is 2x2 and B is 2x2, so AB exists and BA exists.

AB =

 1x5 + 2x7 1x6 + 2x8 3x5 + 4x7 3x6 + 4x8

=

 19 22 43 50

(We have used the definition as follows:For example for the 1,2 entry of AB: Take row 1 of A and column 2 of B. Multiply corresponding elements and add: 1x6 + 2x8.)

BA =

 5x1 + 6x3 5x2 + 6x4 7x1 + 8x3 7x2 + 8x4

=

 23 34 31 46

EXAMPLE. Find AB and BA if possible, where

A =

 1 2 3 4 5 6

B =

 1 2 2 3 1 1 2 3

A is 3x2 and B is 2x4, so AB exists and is of size 3x4. Since B is 2x4 and A is 3x2, 4 does not equal 3, so BA does not exist.

AB =

 1 + 2 2 + 2 2 + 4 3 + 6 3 + 4 6 + 4 6 + 8 9 + 12 5 + 6 10 + 6 10 + 12 15 + 18

=

 3 4 6 9 7 10 14 21 11 16 22 33

PROPERTIES OF MATRIX MULTIPLICATION

§  VERY IMPORTANT: As the previous examples show AB and BA are not usually equal, and in fact one may exist whilst the other does not. Thus it is VERY important to be precise in the order in which we write the matrices that we are multiplying. Take particular notice of this in the properties below.

§  If the sizes of the matrices below are such that the following matrix multiplications are defined, then

(AB)C = A(BC)
(A + B)C = AC + BC
C(A + B) = CA + CB
0A = A0 = 0.

POWERS OF SQUARE MATRICES

We define

A2 = AA, A3 = AAA, etc. Note that these are only defined if A is square.

MATRIX IDENTITIES: EVEN MATRICES NEED AN IDENTITY!

A SQUARE matrix with all 1's on the main diagonal (from the upper left corner to the lower right corner) and 0's elsewhere is called an identity matrix. If it is an nxn matrix, we denote it In, but if the size is clear from the context we often don't bother to write the n. E.g.

I2 =

 1 0 0 1

I3 =

 1 0 0 0 1 0 0 0 1

I plays a similar role in matrix theory to the role 1 plays in real number multiplication. For matrices we have, if A is an nxn matrix, then

A In = InA = A.