Multiplying a matrix by a vector
Each row dotted with the column.
To multiply a matrix by a column vector, take each row of the matrix and dot it with the vector. The first row gives the top number, the second row gives the bottom number.
Example: [[4, 2], [5, 3]] times [1, 3]
- (4 × 1 + 2 × 3, 5 × 1 + 3 × 3) — Row times column, for each row
- (10, 14) — Answer
Why it works: Each row tells how much of each input goes into one output, so each output is a row times the vector.
Tip: Write the answer as a pair: (top, bottom).