2.1 Matrix multiplication

A matrix, normal cap a, is a rectangular array of numbers arranged in rows and columns. (Matrices is the plural of the word matrix.) You will concentrate on two-dimensional situations, and so consider matrices of the form:

matrix row 1column 1 cap a 11 cap a 12 row 2column 1 cap a 21 cap a 22 times two multiplication two square matrix
matrix row 1column 1 cap a 11 cap a 12 times one multiplication two row matrix
vector element 1 cap a sub 11 element 2 cap a sub 21 times two multiplication one column matrix

In order to multiply two matrices, the number of columns of first matrix should be equal to the number of rows in the second matrix. Matrices of the right shape can be multiplied together as follows:

normal cap c equals normal cap a times normal cap b full stop
Equation label:(1)

To calculate normal cap c, where normal cap c sub i times j is the element in the i th row and j th column of normal cap c, you go along the ith row of normal cap a and down the jth column of normal cap b, multiplying corresponding elements and adding the results. For two two multiplication two matrices, this pattern may be visualized as follows:

matrix row 1column 1 asterisk operator equals matrix row 1column 1 right arrow right arrow times matrix row 1column 1 down arrow row 2column 1 down arrow
matrix row 1column 1 asterisk operator equals matrix row 1column 1 right arrow right arrow times matrix row 1column 1 down arrow row 2column 1 down arrow
matrix row 1column 1 asterisk operator equals matrix row 1column 1 right arrow right arrow times matrix row 1column 1 down arrow row 2column 1 down arrow
matrix row 1column 1 asterisk operator equals matrix row 1column 1 right arrow right arrow times matrix row 1column 1 down arrow row 2column 1 down arrow

where the asterisk operator indicates a matrix element in the new matrix, normal cap c, and the arrows show how matrix elements in the old matrices are processed to obtain this. In order to multiply two matrices, the number of columns of first matrix should be equal to the number of rows in the second matrix. In other words, each term cap c sub i times j is given by cap c sub i times j equals cap a sub i times one times cap b sub one times j plus cap a sub i times two times cap b sub two times j.

Exercise 3

  1. What shape is the result of multiplying a one multiplication two row matrix by a two multiplication two square matrix?

  2. What shape is the result of multiplying a two multiplication two square matrix by a one multiplication two row matrix?

  3. What shape is the result of multiplying a two multiplication two square matrix by a two multiplication one column matrix?

  4. What shape is the result of multiplying a one multiplication two row matrix by a two multiplication one column matrix?

(A text entry box would appear here, but your browser does not support it.)

Answer

  1. The result is a one multiplication two row matrix.

  2. This operation cannot be performed because the number of columns of first matrix is not equal to the number of rows in the second matrix.
  3. The result is a two multiplication one column matrix.

  4. The result is a one multiplication one matrix (i.e. a scalar number).

Exercise 4

Evaluate the following combination of square matrices:

matrix row 1column 1 12 row 2column 1 two minus minus one times matrix row 1column 1 10 row 2column 1 zero minus minus one times matrix row 1column 1 12 row 2column 1 two minus minus one

Answer

The product of two matrices is given by:

matrix row 1column 1 cap a 11 cap a 12 row 2column 1 cap a 21 cap a 22 times matrix row 1column 1 cap b 11 cap b 12 row 2column 1 cap b 21 cap b 22 equals matrix row 1column 1 plus plus times times cap a 11 cap b 11 times times cap a 12 cap b 21 plus plus times times cap a 11 cap b 12 times times cap a 12 cap b 22 row 2column 1 plus plus times times cap a 21 cap b 11 times times cap a 22 cap b 21 plus plus times times cap a 21 cap b 12 times times cap a 22 cap b 22

So, to find the matrix element in row i and column j of the product normal cap a times normal cap b, we multiply the elements in row i of normal cap a with the corresponding elements in column j of normal cap b, and add the results together.

To find the product of three matrices, normal cap a times normal cap b times normal cap c, we first evaluate normal cap b times normal cap c and then form the product normal cap a of normal cap b times normal cap c, taking care to preserve the order of the matrices.

So the solution is

matrix row 1column 1 12 row 2column 1 two minus minus one times matrix row 1column 1 10 row 2column 1 zero minus minus one times matrix row 1column 1 12 row 2column 1 two minus minus one equals matrix row 1column 1 12 row 2column 1 two minus minus one times matrix row 1column 1 multiplication multiplication plus plus multiplication multiplication 1102 multiplication multiplication plus plus multiplication multiplication 120 left parenthesis right parenthesis minus minus one row 2column 1 multiplication multiplication plus plus multiplication multiplication 01 left parenthesis right parenthesis minus minus 12 multiplication multiplication plus plus multiplication multiplication 02 left parenthesis right parenthesis minus minus one left parenthesis right parenthesis minus minus one
matrix row 1column 1 12 row 2column 1 two minus minus one times matrix row 1column 1 10 row 2column 1 zero minus minus one times matrix row 1column 1 12 row 2column 1 two minus minus one equals matrix row 1column 1 12 row 2column 1 two minus minus one times matrix row 1column 1 12 row 2column 1 minus minus 21
matrix row 1column 1 12 row 2column 1 two minus minus one times matrix row 1column 1 10 row 2column 1 zero minus minus one times matrix row 1column 1 12 row 2column 1 two minus minus one equals matrix row 1column 1 multiplication multiplication plus plus multiplication multiplication 112 left parenthesis right parenthesis minus minus two multiplication multiplication plus plus multiplication multiplication 1221 row 2column 1 multiplication multiplication plus plus multiplication multiplication 21 left parenthesis right parenthesis minus minus one left parenthesis right parenthesis minus minus two multiplication multiplication plus plus multiplication multiplication 22 left parenthesis right parenthesis minus minus 11
matrix row 1column 1 12 row 2column 1 two minus minus one times matrix row 1column 1 10 row 2column 1 zero minus minus one times matrix row 1column 1 12 row 2column 1 two minus minus one equals matrix row 1column 1 minus minus 34 row 2column 1 43