Matrix Multiplication
Multiply matrices using the row-by-column rule: (AB)ᵢⱼ = Σ AᵢₖBₖⱼ. Columns of A must equal rows of B. Result is m×p when A is m×n and B is n×p. Non-commutative: AB ≠ BA in general.
Why This Mathematical Concept Matters
Why: Matrix multiplication underpins computer graphics, quantum mechanics, neural networks, and economics. Every 3D game uses it for rotation and projection. Neural networks are chains of matrix multiplications.
How: For each element C[i,j], take row i of A and column j of B. Multiply corresponding entries and sum. Dimensions: A(m×n)×B(n×p)→C(m×p). Scalar: multiply every entry. Power: A^n = A×A×...×A (n times, A square).
- ●AB ≠ BA in general — order matters for matrix multiplication.
- ●Identity matrix I satisfies AI = IA = A for compatible A.
- ●Rotation by 90°: [[0,-1],[1,0]]. Two rotations = 180°: [[-1,0],[0,-1]].
📐 Examples — Click to Load
Matrix A
Matrix B
| 19 | 22 |
| 43 | 50 |
Result Entries (Bar)
Element Magnitudes (%)
📐 Calculation Steps
Properties
- • Result dimensions: 2×2
- • AB ≠ BA in general (non-commutative)
- • For square matrices: (AB)C = A(BC) (associative)
⚠️For educational and informational purposes only. Verify with a qualified professional.
🧮 Fascinating Math Facts
3D games use matrix multiplication for rotation, scaling, and projection of vertices.
— Computer Graphics
Quantum mechanics uses matrices; multiplication represents state evolution.
— Physics
📋 Key Takeaways
- • Row-by-column method: C[i,j] = sum over k of A[i,k] × B[k,j]
- • Dimension rule: A(m×n) × B(n×p) → C(m×p). Columns of A must equal rows of B.
- • Non-commutativity: AB ≠ BA in general. Order matters!
- • Associative: (AB)C = A(BC) when dimensions allow
- • Applications: Computer graphics, physics, economics, machine learning
💡 Did You Know?
📖 Row-by-Column Method
To multiply A × B: take row i of A and column j of B. Multiply corresponding entries and add. That gives C[i,j]. Repeat for every position.
C[i,j] = A[i,1]·B[1,j] + A[i,2]·B[2,j] + ... + A[i,n]·B[n,j]
Example: 2×2
A = [[1,2],[3,4]], B = [[5,6],[7,8]]. C[1,1] = 1×5 + 2×7 = 19. C[1,2] = 1×6 + 2×8 = 22. C[2,1] = 3×5 + 4×7 = 43. C[2,2] = 3×6 + 4×8 = 50.
🔄 Non-Commutativity (AB ≠ BA)
For numbers, a×b = b×a. For matrices, AB and BA are usually different — and BA may not even be defined if dimensions differ. Example: A is 2×3, B is 3×2. Then AB is 2×2, but BA is 3×3. Different sizes!
Even for 2×2: [[1,0],[0,0]] × [[0,1],[0,0]] ≠ [[0,1],[0,0]] × [[1,0],[0,0]]
📊 Dimension Rules Table
| A | B | AB | Valid? |
|---|---|---|---|
| 2×2 | 2×2 | 2×2 | ✓ |
| 2×3 | 3×2 | 2×2 | ✓ |
| 3×2 | 2×4 | 3×4 | ✓ |
| 2×3 | 2×3 | — | ✗ (cols≠rows) |
🎯 Applications in Computer Graphics
In 2D graphics, transformations are matrices. Rotation by θ: [[cos θ, -sin θ], [sin θ, cos θ]]. Scaling: [[sx, 0], [0, sy]]. Composing: Scale × Rotation. Order matters! For 90°: [[0,-1],[1,0]]. Two 90° = 180°: [[-1,0],[0,-1]].
🔢 Identity and Zero Matrices
Identity I has 1s on diagonal, 0s elsewhere: AI = IA = A. Zero O has all zeros: AO = OA = O. Load the identity example to see A × I = A.
📝 Practice Checklist
Before multiplying, verify:
- Columns of A = Rows of B
- Result dimensions: rows of A × columns of B
- For A^n, A must be square
❓ FAQ
Why must columns of A equal rows of B?
Each element of AB is a dot product: row of A with column of B. They must have the same length.
Is matrix multiplication commutative?
No. AB ≠ BA in general. Order matters for matrix multiplication.
What is the identity matrix?
I has 1s on the diagonal, 0s elsewhere. AI = IA = A for compatible A.
How is this used in graphics?
Transformations (rotate, scale, translate) are matrices. Composing transforms = multiplying matrices.
What is matrix power A^n?
A × A × ... × A (n times). Only defined for square matrices.
⚠️ Disclaimer: This calculator handles standard matrix multiplication. For very large matrices, numerical precision may vary. Educational use only.