## Linear Algebra and Its Applications, exercise 1.4.2

Exercise 1.4.2. Multiply the matrices below:

$\left[ \begin{array}{rr} 4&1 \\ 5&1 \\ 6&1 \end{array} \right] \left[ \begin{array}{r} 1 \\ 3 \end{array} \right] \rm and \left[ \begin{array}{rrr} 1&2&3 \\ 4&5&6 \\ 7&8&9 \end{array} \right] \left[ \begin{array}{r} 0 \\ 1 \\ 0 \end{array} \right] \rm and \left[ \begin{array}{rr} 4&3 \\ 6&6 \\ 8&9\end{array} \right] \left[ \begin{array}{r} \frac{1}{2} \\ \frac{1}{3} \end{array} \right]$

Work by columns instead of by rows.

Answer: The first example multiplies a 3×2 matrix by a 2×1 matrix (column vector), producing a 3×1 matrix (column vector). Working by rows gives us the following:

$\left[ \begin{array}{rr} 4&1 \\ 5&1 \\ 6&1 \end{array} \right] \left[ \begin{array}{r} 1 \\ 3 \end{array} \right] = \left[ \begin{array}{r} 4 \cdot 1 + 1 \cdot 3 \\ 5 \cdot 1 + 1 \cdot 3 \\ 6 \cdot 1 + 1 \cdot 3 \end{array} \right] = \left[ \begin{array}{r} 7 \\ 8 \\ 9 \end{array} \right]$

Working by columns is done as follows:

$\begin{bmatrix} 4&1 \\ 5&1 \\ 6&1 \end{bmatrix} \begin{bmatrix} 1 \\ 3 \end{bmatrix} = \begin{bmatrix} 4 \\ 5 \\ 6 \end{bmatrix} \cdot 1 + \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} \cdot 3 = \begin{bmatrix} 4 \\ 5 \\ 6 \end{bmatrix} + \begin{bmatrix} 3 \\ 3 \\ 3 \end{bmatrix} = \begin{bmatrix} 7 \\ 8 \\ 9 \end{bmatrix}$

For the second example we’re multiplying a 3×3 matrix times a 3×1 matrix to produce a 3×1 matrix (column vector). Working by rows gives us the following:

$\begin{bmatrix} 1&2&3 \\ 4&5&6 \\ 7&8&9 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \cdot 0 + 2 \cdot 1 + 3 \cdot 0 \\ 4 \cdot 0 + 5 \cdot 1 + 6 \cdot 0 \\ 7 \cdot 0 + 8 \cdot 1 + 9 \cdot 0 \end{bmatrix} = \begin{bmatrix} 2 \\ 5 \\ 8 \end{bmatrix}$

Working by columns is done as follows:

$\begin{bmatrix} 1&2&3 \\ 4&5&6 \\ 7&8&9 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 4 \\ 7 \end{bmatrix} \cdot 0 + \begin{bmatrix} 2 \\ 5 \\ 8 \end{bmatrix} \cdot 1 + \begin{bmatrix} 3 \\ 6 \\ 9 \end{bmatrix} \cdot 0 = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} 2 \\ 5 \\ 8 \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 2 \\ 5 \\ 8 \end{bmatrix}$

Note that this is a special case of the general case that multiplying an nxn matrix by a column vector of the form (0, …, 0, 1, 0, …, 0) (where the jth entry is 1 and the others zero) produces a column vector corresponding to the jth column of the matrix.

The third example multiplies a 3×2 matrix by a 2×1 matrix to form a 3×1 matrix. Working by rows gives us the following:

$\begin{bmatrix} 4&3 \\ 6&6 \\ 8&9 \end{bmatrix} \begin{bmatrix} \frac{1}{2} \\ \frac{1}{3} \end{bmatrix} = \begin{bmatrix} 4 \cdot \frac{1}{2} + 3 \cdot \frac{1}{3} \\ 6 \cdot \frac{1}{2} + 6 \cdot \frac{1}{3} \\ 8 \cdot \frac{1}{2} + 9 \cdot \frac{1}{3} \end{bmatrix} = \begin{bmatrix} 2 + 1 \\ 3 + 2 \\ 4 + 3 \end{bmatrix} = \begin{bmatrix} 3 \\ 5 \\ 7 \end{bmatrix}$

Working by columns is done as follows:

$\begin{bmatrix} 4 \\ 6 \\ 8 \end{bmatrix} \cdot \frac{1}{2} + \begin{bmatrix} 3 \\ 6 \\ 9 \end{bmatrix} \cdot \frac{1}{3} = \begin{bmatrix} 2 \\ 3 \\ 4 \end{bmatrix} + \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 3 \\ 5 \\ 7 \end{bmatrix}$

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

This entry was posted in linear algebra. Bookmark the permalink.