2

My understanding is that multiplying a matrix by a matrix on its left means operating on rows, and multiplying a matrix by a matrix on its right means operating on columns.

When there are 2 matrices next to each other to be multiplied, how can I know whether I'm supposed to operate on columns or on rows? These 2 operations appear to produce different results.

Andrew
  • 21
  • 1
    You read a product left-to-right, so you use the rows of $A$ and the columns in $B$ to compute $AB$. You would do the vice versa to compute $BA$. Order matters, of course. – Randall Oct 10 '19 at 14:14
  • The columns of $AB$ are all in the column space of $A$, while its rows are all in the row space of $B$. – Berci Oct 10 '19 at 15:07

2 Answers2

0

In order to find the product $AB$ of the $m\times n$ matrix $A$ and $n\times l$ matrix $B$ you find the dot product of row $i$ of $A$ with column $j$ of $B$ to find the $i,j$ element of the product. That is if $AB=C$ then $$c_{ij} = \sum_{k=1}^n a_{ik} b_{kj} $$

0

I think this example will help, if we have any $3×3$ matrix $A$, and we multiply it by the permutation matrix $P_{2,3}$ from the right, here is what happens, $$AP_{2,3}= \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}= \begin{pmatrix} a & c & b \\ d & f & e \\ g & i & h \end{pmatrix}$$

(The second and third columns are switched)

Now if we multiply it by the permutation matrix $P_{2,3}$ from the left, here is what happens, $$P_{2,3}A= \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix} \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix} = \begin{pmatrix} a & b & c \\ g & h & i \\ d & e & f \end{pmatrix}$$

(The second and third rows are switched)

So $P$ works on the columns of $A$ when multiplied by $A$ from the right, and $P$ works on the rows of $A$ when multiplied by $A$ from the left.

Note that $P_{2,3}$ is the matrix obtained from the identity by flipping the second and third row (or column).

Also, $$P_{2,3}P_{2,3}= \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}= \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$$

You can say that the $P_{2,3}$ on the right switched the second and the third columns of the $P_{2,3}$ on the left, OR you can also say that the $P_{2,3}$ on the left switched the second and third rows of the $P_{2,3}$ on the right.