0

the question I have difficulty with

So not only do we have $AB=BA$, the matrix products $AB$ and $BA$ can even be of different size.

Example 7: Let $C= \begin{pmatrix} 1 & 2 & 3 \\ 1 & 0 & 1 \\ -1 & 0 & -2 \end{pmatrix}$ and $D= \begin{pmatrix} -1\\-2\\-3 \end{pmatrix}$. Find (if possible) $CD$ and $DC$.

For this question, our lecturer just flew past this question and didn't explain much about why we can multiply $CD$ but not $DC$.

What is the exact reason why I can't multiply $DC$? Thanks!

xela
  • 15
  • 7
  • 2
    For matrix multiplication to work, the dimensions need to be compatible. See, for instance, this answer. – Blue Jul 29 '22 at 05:38
  • 1
    So long as the number of columns of the first matrix is the same as the number of rows of the second you can multiply them. If they are not you can not. – fleablood Jul 29 '22 at 05:48
  • the way the product works is foreach row of the first matrix and each column of the second you multiply the $k$th terms together and keep a tally. That's only possible if each row of the first matrix and each column of the second has the same number of items. in other words if the number of columns of the first matrix is the same as the number or rows of the second. – fleablood Jul 29 '22 at 05:52
  • If $A$ is a $m\times n$ matrix , for $AB$ to exist , we need that $B$ is a $n\times p$-matrix. $BA$ exists as well if and only if $m=p$. – Peter Jul 29 '22 at 07:14

1 Answers1

3

The number of columns of the first matrix needs to be equal to the number of rows of the second matrix. In this way:

  1. The inner product between one row of the first matrix and one column of the second matrix is well defined
  2. The outer product among columns of the first matrix and rows of the second matrix is also well defined.
yes
  • 878