# Thread: Matrix and vector multiplication

1. ## Matrix and vector multiplication

Hello,
Im trying to learn the rules for multiplying a row vector and matrix together, can anyone please tell me if Im right or wrong about:

$\begin{pmatrix} a& b & c\end{pmatrix}$ * $\begin{pmatrix}e & f & g\\h & i & j\\ k & l & m\end{pmatrix}$ = $\begin{pmatrix} ae+ah+ak& bf+bi+bl & cg+cj+cm\end{pmatrix}$

2. Dear NotGoodAtMath94,

Your multiplication of matrices is incorrect. The correct one is,

$\begin{pmatrix} a& b & c\end{pmatrix}$ * $\begin{pmatrix}e & f & g\\h & i & j\\ k & l & m\end{pmatrix}
$
= $
\begin{pmatrix} ae+bh+ck& af+bi+cl & ag+bj+cm\end{pmatrix}
$

3. Thank you for showing me

4. Originally Posted by NotGoodAtMath94
Hello,
Im trying to learn the rules for multiplying a row vector and matrix together, can anyone please tell me if Im right or wrong about:

$\begin{pmatrix} a& b & c\end{pmatrix}$ * $\begin{pmatrix}e & f & g\\h & i & j\\ k & l & m\end{pmatrix}$ = $\begin{pmatrix} ae+ah+ak& bf+bi+bl & cg+cj+cm\end{pmatrix}$
Think of a matrix multiplication as a series of "dot products". The number at the "i,j" place in the product AB is the dot product of the ith row of A and the jth column of B.

In your example, row 1 of A is (a, b, c) and column 1 of B is (e, h, k). The "dot product" of those is ae+ bh+ ck so your first number in the first column is ae+ by+ ck, not ae+ ah+ ak where you have multiplied the first column by a only.

In this case, since A has only one row, the product has only one row.

5. Hello, NotGoodAtMath94!

$\begin{pmatrix} a& b & c\end{pmatrix}* \begin{pmatrix}e & f & g\\h & i & j\\ k & l & m\end{pmatrix}$

We multiply the row vector by each column vector.

The three multiplications are:

. . $\begin{pmatrix}a&b&c\end{pmatrix}*\begin{pmatrix}e \\h\\k\end{pmatrix} \;=\;ae + bh + ck$

. . $\begin{pmatrix}a&b&c\end{pmatrix} * \begin{pmatrix}f\\i\\l\end{pmatrix} \;=\;af + bi + cl$

. . $\begin{pmatrix}a&b&c\end{pmatrix} * \begin{pmatrix}g\\j\\m\end{pmatrix} \;=\;ag + bj + cm$

Since $(1\times3) * (3\times3) \;\to\;(1\times 3)$, the product is a $(1\times 3)$ row vector:

. . . . $\begin{pmatrix}ae+bh+ck & af+bi+cl & ag+bj+cm \end{pmatrix}$