Matrix - matrix multiplication
The first thing to note is that matrix-matrix multiplication is NOT d one
element-wise (you don’t simply multiply the
corresponding elements). How is it done?
Row-column multiplication
Multiplying matrices is fairly easy to show, but kind of tough to write a
formula for symbolically . The easiest way to
introduce it is to define it in terms of rows and columns.
Suppose you have a row (a 1 × n matrix) and a column (an n × 1 matrix). For
example, suppose

We define matrix multiplication by multiplying the row
entries of A with the corresponding column entries of B, and
summing the products :
In general, we could write that if

then

• Note than in order for this to work , the number of
columns of A must equal the number of rows of B.
Matrix-matrix multiplication
The formal definition of matrix-matrix multiplication:
Given an m × r matrix A and an r × n matrix B, the product matrix C = AB is an m
× n matrix
with entries ci,j such that

It is not immediately obvious what that definition is
telling you to do, although you can probably see right away
you’re multiplying elements of A and elements of B that correspond in some
fashion.
However, having defined row-column multiplication, we can describe the process
of matrix-matrix multiplication in
the fol lowing way . What that definition is saying is: to get the i, jth element
of the product C = AB, multiply
the ith row of A with the jth column of B
For example, to get c1,1, multiply the first row of A with the first column of
B.
To get c2,3, multiply the second row of A with the third row of B.
And so on ...
Sounds complicated? It’s tough to describe in symbols and in words , but makes
sense with an example. Go to the
next page and fill in the grid. There’s a screen in the clip that’ll do the
calculations .
Example: Given

find the product C = AB.
Multiplying row 1 of A wit
column 1 of B gives c1,1. |
Multiplying row 1 of A with
column 2 of B gives c1,2. |
Multiplying row 1 of A with
column 3 of B gives c1,3. |
Multiplying row 2 of A with
column 1 of B gives c2,1 |
Multiplying row 2 of A with
column 2 of B gives c2,2 |
Multiplying row 2 of A with
column 3 of B gives c2,3, |
Multiplying row 3 of A with
column 1 of B gives c3,1. |
Multiplying row 3 of A with
column 2 of B gives c3,2. |
Multiplying row 3 of A with
column 3 of B gives c3,3. |
Observations:
• Do A and B have to be the same size for multiplication to be defined?
• What does have to match up?
• There’s an easy way to remember this (and to also predict the size of the
resulting product matrix):