# Matrix Multiplication - Equality of Row-Column and Column-Row (Strang P71)

Source: P71 of Strang's IoLA, 4th ed, and Wikipedia. How does $(I) = (O)$? I can't conciliate them.

$\bbox[5px,border:2px solid grey]{\text{Inner Product or Row$\cdot$Column :}}$

$\mathbf{AB} = \left[\begin{matrix} \vec{A_1} \\ \vdots \\ \vec{A_i} \\ \vdots \\ \vec{A_m} \end{matrix}\right]_{m \times n} \left[\vec{B_1} \cdots \vec{B_i} \cdots \vec{B_p}\right]_{n \times p}$ $= \left[\begin{matrix} \vec{A_1}\cdot\vec{B_1} & \cdots & \vec{A_1}\cdot\vec{B_j} & \cdots & \vec{A_1} \cdot \vec{B_p} \\ \vdots & \cdots & \vdots & \cdots & \vdots \\ \vec{A_i}\cdot\vec{B_1} & \cdots & \vec{A_i}\cdot\vec{B_j} & \cdots & \vec{A_i}\cdot \vec{B_p} \\ \vdots & \cdots & \vdots & \cdots & \vdots \\ \vec{A_m}\cdot\vec{B_1} & \cdots & \vec{A_m}\cdot\vec{B_j} & \cdots & \vec{A_m} \cdot\vec{B_p} \\ \end{matrix}\right]$ $\quad \color{Green}{\text{(I)}}$

$\bbox[5px,border:2px solid grey]{\text{Outer Product or Column$\cdot$Row :}}$

For outer product ($\neq$ inner product), $\cdot$ is defined as the operation of multiplying the $k$th row of A (of size $m \times 1$) with the $kth$ column of B (of size $1 \times p$). This effects a new matrix (of size $m \times p$).

$\mathbf{AB} = \left[\vec{A_1} \cdots \vec{A_k} \cdots \vec{A_n}\right]_{m \times n} \left[\begin{matrix} \vec{B_1} \\ \vdots \\ \vec{B_k} \\ \vdots \\ \vec{B_n} \end{matrix}\right]_{n \times p} := {\left[\require{cancel}\xcancel{\vec{A_1} \cdot \vec{B_1} + \cdots + \vec{A_k} \cdot \vec{B_k} + \cdots + \vec{A_n} \cdot \vec{B_n}} \right]}$
$= \vec{A_1}\vec{B_1} + \cdots + \vec{A_k}\vec{B_k} + \cdots + \vec{A_n}\vec{B_n} \quad \color{green}{(O)}$

• Why is the $\odot$ notation necessary? We have a column of $A$ (a column vector) multiplied by a row of $B$ (a row vector). We're just using ordinary matrix multiplication. If the columns of $A$ are $A_1,\ldots,A_n$ (column vectors) and the rows of $B$ are $B_1,\ldots,B_n$ (row vectors) then $AB = \sum_{i=1}^n A_i B_i$. Aug 29, 2013 at 8:48
• @littleO: Thank you. I've edited my OP. AB is still a matrix, so shouldn't your last phrase be my equation $\color{green}{(O)}$ and thus retains the matrix notation, viz: $AB = \left[ \sum_{i=1}^n A_i B_i \right]$ ?
– user53259
Sep 26, 2013 at 1:39
• Actually the brackets on the right side of $\color{green}{(O)}$ are unnecessary. Each $A_k$ is an $m \times 1$ matrix. Each $B_k$ is a $1 \times p$ matrix. So $A_k B_k$ is an $m \times p$ matrix. There would be no need to write it as $[ A_k B_k ]$ or something like that. And $A_1 B_1 + \cdots + A_n B_n$ is a matrix. Again no need for brackets. Also, we could omit the dots in your matrix products, because it will be assumed that we are just using matrix multiplication. Sep 26, 2013 at 2:42
• @littleO: Many thanks!
– user53259
Sep 27, 2013 at 13:47

Your inner product rule and (I) is the definition of the matrix product.

For (O), if you write the identity matrix as $$I_n = \sum_{i=1}^n e_i e_i^T$$ for $$(e_1,...,e_n)$$ the canonical basis then, because the matrix product is distributive, $$AB = AI_nB = \sum_{i=1}^n (A e_i) (e_i^TB).$$ This is exactly (O) by checking that $$A e_i$$ is indeed the $$i$$-th column of $$A$$ and $$e_i^TB$$ indeed the $$i$$-th row of $$B$$.

EDIT: This response was given for an older version of the question. In the current notation, $\odot$ is the same as multiplying a column vector by a row vector to get a matrix.

In order to see why the two matrices are the same, you'll need to go one level deeper on the definitions of both $\cdot$ and $\odot$ so that everything is written out in terms of the entries of the two original matrices, along with normal real-number addition and multiplication.

What you'll find, roughly speaking, is that the sums hidden in the definition of the $\cdot$ product will be provided explicitly in the $\odot$ formulation. More explicitly, the $k^\text{th}$ $\odot$ product in the summation can be thought of as showing the $k^\text{th}$ term of the $\cdot$ products "all at once".

• Sorry for any inconvenience, but would you mind updating your Answer? I changed my OP by virtue of littleO's comments.
– user53259
Sep 27, 2013 at 13:33
• @LePressentiment: There's no substantive change to be made, so I've removed my speculation, left the old notation, and commented on it. The easiest way to see the matrices are the same is still to unpack the definitions. Sep 29, 2013 at 23:14
• Thank you. The new OP now only subsumes $\cdot$, so why must the definitions still be unscrambled to apprehend $(I) = (O)$, withal?
– user53259
Sep 30, 2013 at 9:25
• @LePressentiment: I'm not sure I can answer that question. Perhaps it is possible to understand $(I)=(O)$ without unpacking definitions, but the two forms are so radically different that it seems unlikely. Maybe after you do the calculation you will be able to explain it better than me :P Sep 30, 2013 at 14:33