Member-only story
Math Explained to Programmers: From Eigenvectors to Eigen Decomposition
3 min readApr 18, 2025
Refactor your codebase in the “clean way”
Eigenvalues and Eigenvectors
Given an n × n matrix A, if there exists a non-zero vector v and a scalar λ, such that:
Av = λv
Then:
- λ is called an eigenvalue of A.
- v is the eigenvector corresponding to eigenvalue λ.
Characteristic Equation
Rewrite the equation as:
(A - λI)v = 0
For v ≠ 0, the following must hold:
det(A - λI) = 0
This equation is called the characteristic polynomial.
Types of Eigenvalues and Eigenvectors
Case 1: Distinct Real Eigenvalues
- Each eigenvalue has its independent eigenvector.
- Eigenvectors are linearly independent.
Case 2: Repeated Real Eigenvalues
- If geometric multiplicity (number of independent eigenvectors) equals algebraic multiplicity (multiplicity of the eigenvalue), the matrix is diagonalizable.
- If geometric multiplicity is less than algebraic multiplicity, the matrix is not diagonalizable.
Case 3: Complex Eigenvalues
- Occur in conjugate pairs (a + bi, a —…