Matrix Operations
Addition and Subtraction
Element-wise operations requiring matching dimensions:
(A ± B)ij = aij ± bij
Multiplication
For A (m×n) and B (n×p), the product C = AB is m×p where:
cij = Σ aik × bkj (sum over k from 1 to n)
Key properties: not commutative (AB ≠ BA), associative (A(BC) = (AB)C), distributive (A(B+C) = AB + AC).
Determinant
For a 2×2 matrix: det = ad − bc
For larger matrices, computed using LU decomposition with partial pivoting. Properties:
- det(AB) = det(A) × det(B)
- det(Aᵀ) = det(A)
- det(kA) = kn × det(A) for n×n matrix
- Swapping rows negates the determinant
Inverse
The inverse A⁻¹ exists when det(A) ≠ 0. For a 2×2 matrix:
A⁻¹ = (1/det) × [[d, −b], [−c, a]]
For larger matrices, computed using Gauss-Jordan elimination.
Matrix Dimensions Quick Reference
| Operation | A Size | B Size | Result Size | Requirement |
|---|---|---|---|---|
| A + B | m × n | m × n | m × n | Same dimensions |
| A − B | m × n | m × n | m × n | Same dimensions |
| A × B | m × n | n × p | m × p | A cols = B rows |
| Aᵀ | m × n | — | n × m | Any matrix |
| det(A) | n × n | — | scalar | Square only |
| A⁻¹ | n × n | — | n × n | Square, det ≠ 0 |
| A^k | n × n | — | n × n | Square only |
Special Matrices
- Identity matrix (I): 1s on diagonal, 0s elsewhere. AI = IA = A
- Zero matrix: All elements are 0. Acts as additive identity
- Diagonal matrix: Non-zero elements only on the main diagonal
- Symmetric matrix: A = Aᵀ (equal to its transpose)
- Orthogonal matrix: A⁻¹ = Aᵀ (inverse equals transpose)
- Singular matrix: det = 0, no inverse exists
Applications
- Systems of equations: Ax = b solved via x = A⁻¹b
- Computer graphics: Rotation, scaling, and translation matrices
- Machine learning: Neural network weights, covariance matrices
- Physics: Quantum mechanics, stress tensors, moment of inertia
- Economics: Input-output models, Markov chains