3.210 min read
Matrix-Vector Multiplication
To multiply matrix (size ) by vector (in ), the result is a vector in . The dimensions must be compatible: the number of columns of must equal the length of .
The column perspective: — a linear combination of the columns of weighted by the entries of . This is the geometric view.
The two-finger rule (entry-by-entry): The -th entry of is the dot product of row of with : . This is the computational view.
Formal View
Definition 3.2 — Matrix-Vector Multiplication
For and ,
where is the -th column of .
Interactive Visualization
Matrix-Vector Multiplication
Why This Matters
Matrix-vector multiplication is the core computational primitive of linear algebra and deep learning.
- Neural network forward pass: each layer computes
- Image filtering: applying a kernel is matrix-vector multiplication (vectorized)
- PageRank: Google's original algorithm computes repeated matrix-vector products
Quiz
Question 1
The product for and lives in:
Common Mistakes
- Forgetting that requires (columns of ) to equal the length of .
- Computing by rows when the column perspective is more geometric and informative.