In multiplying 2 matrices, how do you know whether to operate on rows or columns? 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.
 A: 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} $$
A: 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.
