Matrix Operations: The Building Blocks of Linear Algebra
Matrices are rectangular arrays of numbers used to represent linear transformations, systems of equations, and data. They underpin computer graphics, machine learning, engineering simulations, and economics.
Matrix Addition and Scalar Multiplication
Add element-by-element (matrices must be same size):
[1 2] + [5 6] = [6 8]
[3 4] [7 8] [10 12]
Scalar: 3 × [1 2] = [3 6]
[3 4] [9 12]
Matrix Multiplication
A(m×n) × B(n×p) → C(m×p) (inner dimensions must match)
C[i][j] = sum of A[i][k] × B[k][j] for all k
Matrix multiplication is NOT commutative: AB ≠ BA in general.
Determinant (2×2)
det([a b; c d]) = ad − bc
det([3 2; 1 4]) = 12 − 2 = 10
Inverse Matrix (2×2)
A⁻¹ = (1/det(A)) × [d −b]
[−c a]
Only exists when det(A) ≠ 0
Solving Linear Systems
Ax = b → x = A⁻¹b. This is the matrix form of solving a system of simultaneous equations, used extensively in engineering and data science.
Calculate matrix operations: Free Matrix Calculator
Core Matrix Operations
- Addition/Subtraction: Add corresponding elements. Matrices must be the same size.
- Scalar multiplication: Multiply every element by the scalar.
- Matrix multiplication: (AB)ᵢⱼ = Σ AᵢₖBₖⱼ. Rows of A dot columns of B. Requires A columns = B rows. Not commutative: AB ≠ BA in general.
- Determinant (2×2): det|a b; c d| = ad - bc. Zero determinant means no inverse exists.
- Inverse (2×2): A⁻¹ = (1/det A) × |d -b; -c a|
Applications
Matrices are the language of linear algebra and appear throughout science and engineering. Systems of linear equations are solved using matrices (Gaussian elimination or matrix inversion). Computer graphics use 4×4 transformation matrices to apply rotation, scaling, and translation to 3D objects. Google's original PageRank algorithm was a matrix computation on the web's link graph. Machine learning models are trained by matrix operations on datasets. Economics uses input-output matrices (Leontief model) to analyse supply chain dependencies. Quantum mechanics represents physical states and operations as matrices (operators on Hilbert spaces).
Frequently Asked Questions
What is the identity matrix?
The identity matrix I has 1s on the diagonal and 0s elsewhere. For any compatible matrix A: AI = IA = A. It is the matrix equivalent of multiplying by 1. The 2×2 identity is |1 0; 0 1| and the 3×3 is |1 0 0; 0 1 0; 0 0 1|.
When is a matrix not invertible?
A square matrix is not invertible (singular) when its determinant is zero. Geometrically, this means the matrix transformation collapses space to a lower dimension (a plane to a line, or a 3D space to a plane). Computationally, singular matrices arise from linearly dependent equations — systems with infinitely many or no solutions.
What is the transpose of a matrix?
The transpose Aᵀ is obtained by swapping rows and columns: (Aᵀ)ᵢⱼ = Aⱼᵢ. A symmetric matrix equals its own transpose (A = Aᵀ). Transposition appears in defining orthogonality, computing dot products, and in statistics (variance-covariance matrices are symmetric by definition).