# Product between a column vector and a row vector

I know that matrices product is correct when the number of the columns of the first matrix is equal to the number of rows of the second matrix.

Why I can't do the product between a column vector and a row vector? For example:

$$\begin{bmatrix}1 \\ 2 \\ 3 \end{bmatrix} \, \begin{bmatrix}1 & 2 & 3\end{bmatrix}$$

Thank you so much.

• Matrix multiplication is basically multiplying rows with columns, so the length of the rows of the first matrix need to be the same as the length of the columns of the second matrix. You can do that in this example. Dec 15 '17 at 9:53
• you can do that, the result is $\begin{bmatrix}1&2&3\\2&4&6\\3&6&9\end{bmatrix}$, understanding the vector as matrices. Dec 15 '17 at 9:55
• Thank you all for your answers. Dec 15 '17 at 9:57

I know that matrices product is correct when the number of the columns of the first matrix is equal to the number of rows of the second matrix.

I wouldn't say "is correct", it is only defined in this case. You can invent your own product or way of multiplication, but the standard product of matrices only works, as you say, when the number of columns of the first matrix matches the number of rows of the second. Multiplying column or row vectors are simply special cases of matrices in general, so that condition still applies.

In short: it's a consequence of the (usual) definition of the product of matrices.

Why I can't do the product between a column vector and a row vector? For example:

$$\begin{bmatrix}1 \\ 2 \\ 3 \end{bmatrix} \, \begin{bmatrix}1 & 2 & 3\end{bmatrix}$$

Your example however, satisfies the condition you mention: the first matrix has $$1$$ column and the second one has $$1$$ row, so their product is defined. Note that as a result, you expect a $$3\times 3$$-matrix.

In general, multiplying an $$m \times n$$-matrix with an $$n \times p$$-matrix, gives you an $$m \times p$$-matrix: $$(\color{blue}{m} \times \color{red}{n}) \cdot (\color{red}{n} \times \color{purple}{p}) \to (\color{blue}{m} \times \color{purple}{p})$$

• Hello @StackTD Wolfram Mathematica said me that: Tensors {{1},{2},{3}} and {1,2,3} have incompatible shapes. Dec 15 '17 at 9:51
• I'm not familiar with the syntax, but there's no problem with the product in your example (I updated my answer). Dec 15 '17 at 10:01
• Thank you very much @StackTD. Dec 15 '17 at 10:03
• Just to add to this (a bit late), the "standard product of matrices" is chosen to provide some key behaviors which prove extremely useful, such as having the associative property. It is easy to invent a new product, but more challenging to invent one with the same properties. Sep 23 '21 at 17:02

Matrix/vector product $C=A\cdot B$ is well define when:

$A_{n\times k}$ and $B_{k\times m}$

thus

$$C_{n\times m}$$