Matrix arithmetic (matrix addition, subtraction, and multiplication)
satisfies many, but not all of the properties of normal
arithmetic that you are used to. All of the properties below can
be formally proved, and it's not too difficult, but we will not do
so here. In what follows, we'll assume that different matrices
are represented by upper-case letters:
, and that
column vectors are represented by lower-case letters:
.
We will further assume that all the matrices are square matrices or
column vectors, and that all are the same size, either
or
. Further, we'll assume that the matrices contain numbers
(real or complex). Most of the properties listed below apply equally
well to non-square matrices, assuming that the dimensions make the
various multiplications and addtions/subtractions valid.
Perhaps the first thing to notice is that we can always multiply two
matrices, and we can multiply an
matrix by
a column vector, but we cannot multiply a column vector by the
matrix, nor a column vector by another. In other words, of the
three matrix multiplications below, only the first one makes sense.
Be sure you understand why.
Finally, an extremely useful matrix is called the ``identity matrix'',
and it is a square matrix that is filled with zeroes except for ones in
the diagonal elements (having the same row and column number). Here,
for example, is the
identity matrix:
The identity matrix is usually called ``
'' for any size square
matrix. Usually you can tell the dimensions of the identity matrix
from the surrounding context.
Probably the most important thing to notice about the laws above is
one that's missing--multiplication of matrices is not in general
commutative. It is easy to find examples of matrices
and
where
. In fact, matrices almost never commute under
multiplication. Here's an example of a pair that don't:
The associative laws above are extremely useful, and to take one
simple example, consider computer graphics. As we'll see later,
operations like rotation, translation, scaling, perspective, and so
on, can all be represented by a matrix multiplication. Suppose you
wish to rotate all the vectors in your drawing and then to translate
the results. Suppose
and
are the rotation and translation
matrices that do these jobs. If your picture has a million points in
it, you can take each of those million points
and rotate them,
calculating
for each vector
. Then, the result of that
rotation can be translated:
, so in total, there are two
million matrix multiplications to make your picture. But the
associative law tells us we can just multiply
by
once to get
the matrix
, and then multiply all million points by
to get
, so all in all, there are only 1,000,001 matrix
multiplications-- one to produce
and a million multiplications
of
by the individual vectors. That's quite a savings of time.
The other thing to notice is that the identity matrix behaves just like 1 under multiplication--if you multiply any number by 1, it is unchanged; if you multiply any matrix by the identity matrix, it is unchanged.