# Why Does this Example of Matrix Multiplication Work?

I'm fairly new to matrix multiplication and came across an example which looks wrong and I'm wondering if anyone can clarify. Which is said to become the following equation:

But if with matrices you multiply row by column, and then sum, why are the two examples equivalent?

Shouldn't the equation evaluate to

$$\begin{bmatrix} W_{1,1}*x_1 + W_{1,2}*x_1 + W_{1,3} +x_1 \\ W_{2,1}*x_2 + W_{2,2}*x_2 + W_{2,3} +x_2 \\ W_{3,1}*x_3 + W_{3,2}*x_3 + W_{3,3} +x_3 \\ \end{bmatrix}$$

and not

$$\begin{bmatrix} W_{1,1}*x_1 + W_{1,2}*x_2 + W_{1,3} +x_3 \\ W_{2,1}*x_1 + W_{2,2}*x_2 + W_{2,3} +x_3 \\ W_{3,1}*x_1 + W_{3,2}*x_2 + W_{3,3} +x_3 \\ \end{bmatrix}$$

as it does

What would the correct equation be?

• Is $W_{ij}=W_{ji} \ \forall \ i,j \in \{1,2,3\}$ ? Nov 11, 2015 at 19:23
• The first equation looks incorrect to me. It should have $x_1,x_2,x_3$ along the rows, not down the columns. Did you copy it correctly?
– amd
Nov 11, 2015 at 19:23
• I literally copied the images from here: tensorflow.org/tutorials/mnist/beginners/…. You'll have to scroll down. Nov 11, 2015 at 19:27
• The two equations in the picture you posted are not equivalent. The top one is probably a typo. Nov 11, 2015 at 20:09
• I made my comment an answer so the question can be marked as answered. Nov 11, 2015 at 21:35

The two equations in the picture you posted are not equivalent. The top one is probably a typo.

It looks OK to me.

To do the matrix product, I would go across the Ws and down the Xs. That gets the WX sums.