Math101learn.math101.caMatrix Multiplication
A precise explanation of matrix multiplication as composition, row–column pairing, and column combination.
Precise definition
If $A$ is $m\times n$ and $B$ is $n\times p$, then $AB$ is $m\times p$ with $(AB)_{ij}=\sum_{k=1}^n a_{ik}b_{kj}$. The inner dimensions must match. Multiplication is associative and distributive but generally not commutative.
Notation and mathematical language
Column $j$ of $AB$ is $A$ times column $j$ of $B$, hence a linear combination of $A$'s columns. As transformations, $AB$ represents applying $B$ first and then $A$ under compatible coordinate bases.
Conceptual picture
The row–column formula measures how an output coordinate of $A$ combines every intermediate coordinate supplied by $B$. This contraction of the shared index explains both the dimension rule and the order of composition.
Conditions and key results
$AB$ may exist while $BA$ does not; when both exist they may have different sizes or values. Cancellation requires invertibility conditions. A zero product does not imply either factor is zero for matrices.
A reliable strategy
- Write both shapes and confirm the first matrix's column count equals the second's row count.
- Predict the output shape before calculating entries.
- Compute each entry as one row–column dot product or each output column as $A$ times a column of $B$.
- Verify with transformation composition, identity behaviour, or a sample vector.
Fully worked example
Interpretation and application
Matrix products combine transformations, transition steps, network paths, and linear models. The order encodes process order and therefore carries substantive meaning rather than being a formatting choice.
Common mistakes
Verification and reasonableness
- Confirm the result shape and recompute selected entries as dot products.
- Test $(AB)x=A(Bx)$ on a simple vector.
- Check identity products $AI=A$ and $IA=A$ with correctly sized identities.
Practice
- What is the shape of $(3\times4)(4\times2)$?
- Which map acts first in $ABx$?
- Is matrix multiplication commutative?
Answers and brief solutions
- $3\times2$.
- $B$.
- Not in general.
Further deduction
The $j$th column rule $ABe_j=A(Be_j)$ provides a compact verification: $Be_j$ selects column $j$ of $B$, and $A$ maps it to column $j$ of $AB$. It also shows $\operatorname{Col}(AB)\subseteq\operatorname{Col}(A)$ and hence $\operatorname{rank}(AB)\le\min(\operatorname{rank}A,\operatorname{rank}B)$.
Associativity, $(AB)C=A(BC)$, allows a product chain to be parenthesized for efficiency without changing its value. For shapes $A:m\times n$, $B:n\times p$, $C:p\times q$, the two orders can require very different operation counts. Factor order remains fixed; only parentheses may change.
Block multiplication can expose structure when partitions are compatible. If $A$ and $B$ are divided into conformable blocks, each output block is computed by the same row-by-column rule, treating submatrices as entries while preserving their order. A block-diagonal matrix therefore acts independently on corresponding coordinate groups. Invalid block sizes or commuting blocks cannot be assumed, so dimensions should be annotated before using this shortcut in coupled systems or transformations.
Noncommutativity is structural: a $90^\circ$ rotation followed by a reflection generally differs from reflecting first and then rotating. Both products may exist and have the same dimensions, so shape checks are necessary but not sufficient for interchanging factor order.
Related topics
Explore the idea
Vector and matrix transform
Change one quantity at a time and connect what moves to Matrix Multiplication.
Try it yourself
Hints are part of learning. Open one whenever it makes the next step feel possible.
For row $(2,3)$ and column $(4,5)^T$, what is their product entry?
- Multiply matching positions: $2\cdot4+3\cdot5$.
- $8+15=23$.
End of lesson
Nice work making it this far.
Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.
