9
$\begingroup$

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.

$\endgroup$
3
  • 3
    $\begingroup$ 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. $\endgroup$ Commented Dec 15, 2017 at 9:53
  • 9
    $\begingroup$ 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. $\endgroup$
    – Masacroso
    Commented Dec 15, 2017 at 9:55
  • $\begingroup$ Thank you all for your answers. $\endgroup$ Commented Dec 15, 2017 at 9:57

2 Answers 2

9
$\begingroup$

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})$$

$\endgroup$
4
  • $\begingroup$ Hello @StackTD Wolfram Mathematica said me that: Tensors {{1},{2},{3}} and {1,2,3} have incompatible shapes. $\endgroup$ Commented Dec 15, 2017 at 9:51
  • $\begingroup$ I'm not familiar with the syntax, but there's no problem with the product in your example (I updated my answer). $\endgroup$
    – StackTD
    Commented Dec 15, 2017 at 10:01
  • $\begingroup$ Thank you very much @StackTD. $\endgroup$ Commented Dec 15, 2017 at 10:03
  • $\begingroup$ 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. $\endgroup$
    – Cort Ammon
    Commented Sep 23, 2021 at 17:02
0
$\begingroup$

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}$$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .