3.2 Matrix Multiplication

(This topic is also in Section 3.2 in Finite Mathematics and Finite Mathematics & Applied Calculus)

Some On-line Resources for This Topic:

In the preceding tutorial we learned how to add matrices and multiply matrices by scalars (real numbers). For example,

Q What about matrix multiplication? Do we multiply matrices as follows?


A No, that is not the way we multiply matrices, since multiplying matrices in this way is not as useful as the "correct" way.

Q OK. What is the "correct way"?
A Since the correct way may seem a little strange at first, let us do it step-by-step.

A Row Times a Column

If A is a row matrix, and B is a column matrix, then their product AB is a 11 matrix. The length of the row in A must match the length of the column in B for the product to be defined. To find the product, multiply each entry in A (going from left to right) by the corresponding entry in B (going from top to bottom) and then add the results.

Examples

[ 3     -2 ]
  4  
5
= [34 + (-2) 5] = [2]     Product is a 11 matrix
[ 3     -1     -2 ]
  4  
3
1
=  

 
Q How can we apply this strange method of multiplying rows by columns?
A Here is an application: Suppose you sell 3 T-shirts at $10 each, 4 hats at $15 each, and 1 pair of shorts at $20. Then your total revenue is

[ 10     15     20 ]
  3  
4
1
= [103 + 154 + 120] = [110]
PriceQuantity =Revenue

The Product of Two Matrices: General Case

In general, we can take the product AB only if the number of columns of A equals the number of rows of B (so that we can multiply the rows of A by the columns of B as above). The product AB is then obtained as follows:

  • To obtain the 1,1 entry of AB, multiply Row 1 of A by Column 1 of B.
  • To obtain the 1,2 entry of AB, multiply Row 1 of A by Column 2 of B.
  • To obtain the 1,3 entry of AB, multiply Row 1 of A by Column 3 of B.
    . . .
  • To obtain the 2,1 entry of AB, multiply Row 2 of A by Column 1 of B.
  • To obtain the 2,2 entry of AB, multiply Row 2 of A by Column 1 of B.
and so on. In general,
    To obtain the i,j entry of AB, multiply Row i of A by Column j of B.

Note: The product AB has as many rows as A and as many columns as B.

Examples

[ 2     0     -1   1 ]
1
1
0
2
5
1
-1
0
-7
0
1
0
=
4
11
-15
14 43 13
[ 3     -1     -2 ]
  4  
  2     0  
3
0 2
1
1 0
=
 
 
  2  
  0  
-
  1  
1
2
0
1
1
1
0
2
5
1
-1
0
-7
0
1
0
=
4
5
11
7
-15
-7
24 43 23
  3  
  -1  
  -2  
2
-2
-1
  4  
  2     0  
3
0 2
1
1 0
=
 
 
 
  2  
  -1  
1
3
  1  
  1  
0
-1
=
 
 
 
  1  
  1  
0
-1
  2  
  -1  
1
3
=
 
 
 

If you compare the answers to the above two examples, you will see that they are different. In other words,
A.B B.A
Matrix multiplcation is not commutative.
  1  
  0  
  0  
1
0
-1
0
1
-1
  1  
  2  
  3  
2
3
4
2
4
6
=
 
 
 
 

 
Q Now give me an application for multiplying matrices with more than one row and/or column.
A Here is an application that extends the application above: Suppose you make the following sales:

Then your total revenue for the two days is
[ 10     15     20 ]
  3  
  4  
4
2
1
3
= [110   130]
PriceQuantity =Revenue

There are tons of other applications in Exercise Set 3.2 of Finite Mathematics and Finite Mathematics & Applied Calculus Also see theon-line review exercises.

 

Identity Matrices

An identity matrix is a square matrix, called I, that has ones down the leading diagonal (see the examples below) and zeros everywhere else.

Here are some identity matrices.

I = [ 1 ]     11 identity matrix
I =
  1  
  0  
0
1
    22 identity matrix
I =
  1  
  0  
  0  
0
1
0
0
0
1
    33 identity matrix
I =
  1  
  0  
  0  
  0  
0
1
0
0
0
0
1
0
0
0
0
1
    44 identity matrix

Note The leading diagonal of a square matrix is the diagonal from the top left to the bottom right. It consists of the entries a11, a22, a33, ..., ann.

Q Why are these matrices called "identity matrices"?
A Let us mutliply an identity matrix by some other matrix and see what we get:

  1  
  0  
  0  
0
1
0
0
0
1
  1  
  2  
  3  
4
5
6
7
8
9
=
 
 
 
 

In other words, is seems that that, if A is any square matrix, then

In other words, multiplying a matrix by I leaves it unchanged. This is analogous to multiplying a number, a, by 1. You should now try multiplying a 2 2 matrix by the 2 2 identity matrix. You will once again end up with the matrix you started with.

Q What happens if you multiply them the other way around? In other words, what is A.I? (Remember that matrix multiplcation is not commutative)
A Try it out, and you will find once again that the result is A. In other words,

for every square matrix A.

Here is a list of rules that summarize the multiplicative properties of matrices.

Properties of Matrix Multiplication

If A, B and C are any matrices, and if I is an identity matrix, then the following hold, whenever the dimensions of the matrices are such that the products are defined.

A(BC) = (AB)C   Associative Law
A.I = I.A =   Multiplicative Identity Law
A(B + C) = AB + AC   Left Distributive Law
(A + B)C =   Right Distributive Law
A.0 = 0.A = 0Multiplication by Zero

Now try some of the exercises in Section 3.1 of Finite Mathematics or Finite Mathematics and Applied Calculus

Last Updated: May, 2006
Copyright © 2000, 2006 Stefan Waner