multiplying a matrix by a row vector

$\begingroup$

Is multiplying a matrix by a row vector the same as multiplying it by a column vector? Or are there any differences between the two?

$\endgroup$

6 Answers

$\begingroup$

If treating the matrix as a permutation of column vectors, then right multiplying a col vector gives a linear combination of them. While left multiplying a row vector linearly combines row vectors of the matrix.

right mult : $\begin{bmatrix} | & |&&|\\C_1 & C_2& ... & C_n\\|&|&&| \end{bmatrix} \begin{bmatrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{bmatrix}=\sum_{i=1}^n a_iC_i$

left mult: $\begin{bmatrix} b_1 & b_2& ... & b_m \end{bmatrix} \begin{bmatrix} —R_1— \\ —R_2— \\ \vdots \\ —R_m— \end{bmatrix}=\sum_{i=1}^m b_iR_i$

$\endgroup$ $\begingroup$

A $1\times m$ row vector $v_{\text{row}}$ can left-multiply an $m\times n$ matrix $A$, yielding a $1\times n$ row vector: $$v_{\text{row}}A$$

An $n\times 1$ column vector $v_{\text{col}}$ can right-multiply an $m\times n$ matrix $A$, yielding an $m\times 1$ column vector: $$Av_{\text{col}}$$

$\endgroup$ $\begingroup$

of course there is a difference, because a matrix $ A_{m \times n}$ when multipled with column matrix $B_{n \times 1}$ it results another column matrix $C_{m \times 1}$ but when multiplied with a row matrix $D_{1 \times k} $ we can not multiply it

$\endgroup$ $\begingroup$

They are not the same. What is important is to understand dimensions of matrices, row and column vectors. A matrix is said to be $m \times n$ is it has $m$ rows and $n$ columns.

A column vector is a special matrix with only one column therefore it is of dimension $m \times 1$.

Similary, a row vector also is a special matrix which is $1 \times n$.

When doing matrix multiplications you need to insure that you match the dimensions. For example, say you have 2 matrices $A$ and $B$ of respective dimensions $3\times4$ and $2\times 5$. Their dimension do not match and therefore you cannot multiply them.

Another example, say you have 2 matrices $A$ and $B$ with respective dimensions $m\times n$ and $n \times p$ :

  • Then the product $AB$ makes sense thanks to matching dimensions. You have $(m\times n)(n\times p)$ which will give a matrix of dimension $m\times p$

  • You cannot do the product $BA$ as the dimension $m$ and $p$ do not match. You will have $(n\times p)(m\times n)$ which is not defined.

The same goes with column and row vectors. Say you have a matrix $A$ of dimension $m\times n$ and a row vector $v$ of dimension $1\times m$, then you can multiply the vector "from the left" as $vA$ will be $(1\times m)(m\times n)$ for which the product gives a $1\times n$ row vector.

Similarly with column vectors, you can only multiply them from the right of a matrix (assuming dimensions match).

Right and left multiplications will generally give you different answers unless the matrix you want to multiply is symmetric.

$\endgroup$ $\begingroup$

It is not the same. However multiplying a row vector with a matrix can be reduced to multiplying a collumn vector with a matrix by using that the order gets reversed when transposing. Let $v,w$ be row vectors and $A$ a matrix.

$$ \begin{align} vA &= w \\ (vA)^T &= w^T \\ A^Tv^T &= w^T \end{align} $$

Since $v^T$ is a collumn vector we know how to calculate this product.

$\endgroup$ $\begingroup$

If they do not agree by dimensions you cannot multiply them.

If they agree by dimensions you can only multiply:

  • a row vector and a matrix : (1,m) * (m,n) = (1,n)

  • a matrix and a column vector: (m,n) * (n,1) = (m,1)

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like