APP. A] VECTORS AND MATRICES 413
(b)[ 6 ,− 1 , 8 , 3 ]⎡
⎢
⎢
⎣4
− 9
− 2
5⎤
⎥
⎥
⎦=^24 +^9 −^16 +^15 =^32We are now ready to define matrix multiplication in general.Definition A.1: LetA=[aik]andB=[bkj]be matrices such that the number of columns ofAis equal to the
number of rows ofB, say,Ais anm×pmatrix andBis ap×nmatrix. Then the productABis them×nmatrix
C=[cij]whoseij-entry is obtained by multiplying theith row ofAby thejth column ofB, that is,
cij=ai 1 b 1 j+ai 2 b 2 j+···+aipbpj=∑pk= 1aikbkjThe productABis pictured in Fig. A-2.
⎡ ⎢ ⎢ ⎢ ⎢ ⎣
a 11 ... a 1 p
· ... ·
ai 1 ... aip
· ... ·
am 1 ... amp⎤ ⎥ ⎥ ⎥ ⎥ ⎦
⎡ ⎢ ⎢ ⎢ ⎢ ⎣
b 11 ... b 1 j ... b 1 n
· ... · ... ·
· ... · ... ·
· ... · ... ·
bp 1 ... bpj ... bpn⎤ ⎥ ⎥ ⎥ ⎥ ⎦=⎡ ⎢ ⎢ ⎢ ⎢ ⎣
c 11 ... c 1 n
· ... ·
· cij ·
· ... ·
cm 1 ... cmn⎤ ⎥ ⎥ ⎥ ⎥ ⎦Fig. A-2We emphasize that the productABis not defined ifAis anm×pmatrix andBis aq×nmatrix wherep=q.EXAMPLE A.6
(a) FindABwhereA=[
13
2 − 1]
andB=[
20 − 4
5 − 26]
.SinceAis 2×2 andBis 2×3, the productABis defined andABisa2×3 matrix. To obtain the first
row of the product matrixAB, multiply the first row( 1 , 3 )ofAtimes each column ofB,
[
2
5]
,[
0
− 2]
,[
− 4
6]respectively. That is,AB=[
2 +15 0− 6 − 4 + 18]
=[
17 − 614]To obtain the second row of the productAB, multiply the second row( 2 ,− 1 )ofAtimes each column ofB,
respectively. ThusAB=[
17 − 614
4 − 50 + 2 − 8 − 6]
=[
17 − 614
− 12 − 14](b) SupposeA=[
12
34]
andB=[
56
0 − 2]
.ThenAB=[
5 + 06 − 4
15 + 018 − 8]
=[
52
15 10]
and BA=[
5 +18 10+ 24
0 − 60 − 8]
=[
23 34
− 6 − 8]The above Example A.6(b) shows that matrix multiplication is not commutative, that is, that the productsAB
andBAof matrices need not be equal.