Matrix Multiplication Definition and Compatibility
You'll learn when you can multiply two matrices together and how to predict the size of the result.
The Core Idea
Unlike adding matrices (where dimensions must match exactly), multiplying matrices has a special compatibility rule. Two matrices can be multiplied only when the number of columns in the first matrix equals the number of rows in the second matrix.
Think of it like a handshake: the first matrix reaches out with its columns, and the second matrix must have exactly that many rows to "shake hands" properly.
The Compatibility Rule
For matrices A and B:
- If A is m × n (m rows, n columns)
- And B is p × q (p rows, q columns)
- Then AB exists only if n = p
The resulting product AB will have dimensions m × q (rows from the first, columns from the second).
Visual Pattern
Think of it as:
(m × n)(n × q) → (m × q)
↑ ↑
must match
The "inner" dimensions must be equal. The "outer" dimensions become the result's dimensions.
Examples
- (3 × 2)(2 × 4) → Compatible! Result is (3 × 4)
- (2 × 5)(5 × 1) → Compatible! Result is (2 × 1)
- (4 × 3)(2 × 3) → Incompatible (3 ≠ 2), multiplication undefined
- (1 × 4)(4 × 1) → Compatible! Result is (1 × 1) — a single number
Notice: AB may exist while BA does not, or they may both exist but produce different-sized results!
Key Takeaway: Two matrices can be multiplied only when the number of columns in the first equals the number of rows in the second; the result has dimensions (first's rows) × (second's columns).