techtree / Linear algebra

Matrix times vector

Each output entry is a dot product of one row with the vector.

49 seconds

[2−14037][121]=[413]\begin{bmatrix} 2 & -1 & 4 \\ 0 & 3 & 7 \end{bmatrix} \begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix} = \begin{bmatrix} 4 \\ 13 \end{bmatrix}
Transcript

Here is a matrix, and a vector. The matrix has three columns, and the vector has three entries, so they fit.

Take the first row, and dot it with the vector. That gives four, the first entry of the answer.

Now the second row, dotted with the vector: thirteen.

The answer is a new vector: four, thirteen. Three entries went in, two came out, one for each row.

Here is another way to see it. Scale each column by the matching entry of the vector, then add them up. Same answer.

A matrix takes in one vector and gives back another.