Matrix Multiplication
Subtopic: Matricies
Matrix multiplication is the workhorse of linear algebra—it computes the composition of linear transformations, solves systems of equations, and powers everything from graphics to neural networks. The rule is simple once you see it: row times column, summed up.
Introduction
Why is matrix multiplication defined the way it is? It's not component-wise (that would be too simple and less useful). Instead, it's designed so that if matrix
This connection to function composition is why matrix multiplication is so powerful—and why it's not commutative. The order of transformations matters.
Definition
For
Entry
Critical requirement: the number of columns of
Geometric Interpretation
If
For a vector
This explains why
Step-by-Step Example
Multiply:
Key Properties
NOT commutative:
A*B≠B*A in general (even when both products exist)Associative:
(A*B)*C=A*(B*C) Distributive:
A*(B+C)=A*B+A*C and(A+B)*C=A*C+B*C Identity:
A*I=I*A=A , whereI is the identity matrixTranspose:
(A*B)T=BT*AT (note the reversal)Inverse:
(A*B)(−1)=B(−1)*A(−1) (note the reversal)
Matrix-Vector Multiplication
A special case:
where
This column view is often more insightful than the row-dot-column computation.
Dimension Rules
The inner dimensions must match; the outer dimensions give the result size.
Memory aid:
Computational Cost
Multiplying an
For square
Faster algorithms exist (Strassen:
Block Multiplication
Matrices can be partitioned into blocks, and multiplication works block-wise as if blocks were entries:
This is useful for large matrices and parallel computation.
Applications
In graphics, transformations (rotation, scaling, translation) are matrices. Combining transformations = multiplying matrices.
In neural networks, each layer performs
In solving linear systems
In Markov chains, powers of the transition matrix
Summary
Matrix multiplication combines row–column dot products to produce a new matrix. It represents composition of linear transformations, explaining its non-commutativity. Key properties: associative, distributive, and transpose and inverse reverse order. The column view (