Linear Algebra and Its Applications, exercise 1.4.21

Exercise 1.4.21. An alternative way to compute the matrix product AB is as the sum

c_1r_1 + c_2r_2 + \cdots + c_nr_n

where c_i is the ith column of A, r_i is the ith row of B, and the product c_ir_i is a matrix.

  1. Provide an example showing the procedure above for a 2×2 matrix.
  2. Show that the above procedure gives the correct answer for (AB)_{ij} = \sum_{k=1}^{k=n} a_{ik}b_{kj}

Answer: (a) We choose the following 2×2 example matrices, with product as shown:

\begin{bmatrix} 1&2 \\ 3&4 \end{bmatrix} \begin{bmatrix} 3&5 \\ 7&9 \end{bmatrix} = \begin{bmatrix} 17&23 \\ 37&51 \end{bmatrix}

Using the alternative mechanism above we can also compute the product as

\begin{bmatrix} 1&2 \\ 3&4 \end{bmatrix} \begin{bmatrix} 3&5 \\ 7&9 \end{bmatrix} = \begin{bmatrix} 1 \\ 3 \end{bmatrix} \begin{bmatrix} 3&5 \end{bmatrix} + \begin{bmatrix} 2 \\ 4 \end{bmatrix} \begin{bmatrix} 7&9 \end{bmatrix} = \begin{bmatrix} 3&5 \\ 9&15 \end{bmatrix} + \begin{bmatrix} 14&18 \\ 28&36 \end{bmatrix} = \begin{bmatrix} 17&23 \\ 37&51 \end{bmatrix}

(b) For an mxn matrix A and nxp matrix B, the kth column of A and the kth row of B are as follows:

c_k = \begin{bmatrix} a_{1k} \\ a_{2k} \\ \vdots \\ a_{nk} \end{bmatrix} \quad r_k = \begin{bmatrix} b_{k1}&b_{k2}&\cdots&b_{kn} \end{bmatrix}

and their matrix product is

c_kr_k = \begin{bmatrix} a_{1k}b_{k1}&a_{1k}b_{k2}&\cdots&a_{1k}b_{kn} \\ a_{2k}b_{k1}&a_{2k}b_{k2}&\cdots&a_{2k}b_{kn} \\ \vdots&\vdots&\ddots&\vdots \\ a_{nk}b_{k1}&a_{nk}b_{k2}&\cdots&a_{nk}b_{kn} \end{bmatrix}

so that we have (c_kr_k)_{ij} = a_{ik}b_{kj}. If we define C = c_1r_1 + c_2r_2 + \cdots + c_nr_n = \sum_{k=1}^{k=n} c_kr_k then we have

C_{ij} = \sum_{k=1}^{k=n} (c_kr_k)_{ij} = \sum_{k=1}^{k=n} a_{ik}b_{kj}

so that C = AB as hypothesized.

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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s