3
$\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$ Dec 15 '17 at 9:53
  • 5
    $\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
    Dec 15 '17 at 9:55
  • $\begingroup$ Thank you all for your answers. $\endgroup$ Dec 15 '17 at 9:57
2
$\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$ Dec 15 '17 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
    Dec 15 '17 at 10:01
  • $\begingroup$ Thank you very much @StackTD. $\endgroup$ Dec 15 '17 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
    Sep 23 '21 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$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.