10 Matrix Algebra

Matrix Algebra
Learning Goals: We establish the arithmetic rules of matrix algebra.
We now know how to multiply matrices. We also know that we can add vectors, and if
we add several sets of columns simultaneously, we can define matrix addition in the obvious
way. So let’s establish the laws of matrix arithmetic so that we can feel free to do some algebra.
Definitions
• If A and B are the same size and shape, we can define C = A + B, and cij = aij + bij
• If A has as many columns as B has rows (that is, A is m × n, and B = n × p), then D = AB
n
is the m × p matrix given by dij = ! aik bkj .
k=n
Algebraic rules
We prove the following rules of matrix algebra. We will use quick-and-dirty proofs.
These may not be the most elegant, or help in understanding why some matrix property is true,
but they will prove the properties true!
• A + B = B + A. This is true because in any given position, aij + bij = bij + aij.
• (A + B) + C = A + (B + C). This is true because regular addition is also associative.
• c(A + B) = cA + cB. This is true because, entry by entry, multiplication of numbers
distributes over addition of numbers.
• (AB)C = A(BC). The quick-and-dirty proof is to use summations:
p
n
n
n
" p
%
((AB)C)ij = ! (ab)ik ckj = ! $ ! ail blk ' ckj = ! ! ail blk ckj , the last equation being true by
#
&
k =1
k =1
l =1
k =1 l =1
distributivity. We can then use commutativity of addition to do the k-summation first,
p
giving
n
!!a b c
l =1 k =1
•
•
•
•
il lk kj
p
n
p
l =1
k =1
l =1
= ! ail ! blk ckj = ! ail (bc)lj = (A(BC))ij . There are more
enlightening proofs of this fact, but we’ll have to wait on those.
A(B + C) = AB + AC and (A + B)C = AC + BC. These are easy to show by distributing in
the summation formulas.
However, AB is usually not equal to BA. Even if both multiplications are defined, the
results needn’t even be the same size. Even if they are, the results still may not be the
! 1 1$ !1 0 $ ! 2 1$
!1 0 $ ! 1 1$ !1 1 $
same: #
but #
=#
&
#
&
&
&#
&=#
&.
" 0 1% "1 1 % " 1 1%
"1 1 % " 0 1% "1 2 %
We have already seen the identity matrix I, and can easily surmise the additive and
multiplicative properties of the zero matrix.
We can multiply matrices by numbers just as we can multiply vectors by scalars. Again,
the algebra (associativity, distributivity, etc.) hold.
Block multiplication of matrices
There is one more curiosity of the matrix multiplication AB. You can do it in “chunks.”
When we multiply matrices, we read across the rows of A and down the columns of B. But we
can consider the matrix on the left not as a bunch of rows, but as groups of rows. Each group of
rows multiplies B to form a group of rows in AB. Or we can group columns of B.
Even more curiously, we can break a row of A in pieces, and the corresponding break can
be made in the columns of B. We read only part way across A and down B, then go on and read
the other part of the way. We get the same result as before, we just do it in two stages. For
!w $
#x&
example, [ a b c d ] # & = aw + bx + cy + dz while
#y&
# &
"z%
! !w # #
%% &&
!w #
!y#
" x $&
!"[ a b ][ c d ]#$ %
= [ a b ] % & + [ c d ] % & = ( aw + bx ) + ( cy + dz ) , giving the same result.
% !y# &
"x$
"z$
%% &&
%" " z $ &$
This idea can be done with any number of any size blocks in both A and B, as long as the
! b11 b12 b13 b14 b15 $
! a11 a12 a13 a14 $ #
b21 b22 b23 b24 b25 &
#
&
#
&
sizes match up. For instance, we could break up # a21 a22 a23 a24 &
#b31 b32 b33 b34 b35 &
#" a31 a32 a33 a34 &% #
&
"b41 b42 b43 b44 b45 %
! ! b11 $ ! b12 b13 b14 $ ! b15 $ $
! ! a11 a12 a13 $ ! a14 $ $ # # & #
& # &&
##
& # # b21 & # b22 b23 b24 & # b25 & & ! A11 A12 $ ! B11 B12 B13 $
&
#
&
a
a
a
a
as # " 21 22
and
=
" 24 % & # # & #
23 %
b31 % "b32 b33 b34 &% #"b35 &% & #" A21 A22 &% #" B21 B22 B23 &%
"
#" [ a31 a32 a33 ] [ a34 ] &% #
&
#" [ b41 ] [ b42 b43 b44 ] [ b45 ] &%
! A11 B11 + A12 B21 A11 B12 + A12 B22 A11 B13 + A12 B23 $
the product works out to be #
& just as if the
" A21 B11 + A22 B21 A21 B12 + A22 B22 A21 B13 + A22 B23 %
matrix-entries were single number entries.
This gives us our fourth way of looking at a matrix product:
•
Columns-times-rows: we block multiply, making each column of A and each row of B a
block.
" 2 3 % " 2 0 3% " 2 %
"3%
For example, $
= $ ' [ 2 0 3] + $ ' [ !1 2 1] , which equals
'
$
'
# 1 !1& # !1 2 1 & # 1 &
# !1&
3 $ !1 6 9 $
! 4 0 6 $ ! '3 6
# 2 0 3 & + # 1 '2 '1& = # 3 '2 2 & as expected.
"
% "
% "
%