Cheatsheet: Eigenvectors and eigenvalues
The definition
Section titled “The definition”M · v = λ · v (v nonzero)An eigenvector v is a direction the transformation only scales (stays on its own line). The eigenvalue λ is the scaling factor. For an eigenvector, the whole matrix acts like a single number.
Finding them
Section titled “Finding them”- Eigenvalues: solve the characteristic equation
det(M - λI) = 0. - Eigenvectors: for each
λ, find the null space of(M - λI)(the vectors it crushes to zero).
Works because M·v = λ·v rearranges to (M - λI)·v = 0, which has a nonzero solution only when M - λI collapses, i.e. its determinant is zero (the inverses-lesson condition).
The diagonal basis (change-of-basis payoff)
Section titled “The diagonal basis (change-of-basis payoff)”With two independent eigenvectors as the columns of P:
D = P^-1 · M · P is diagonal, eigenvalues on the diagonalIn the eigenvector basis the transformation is pure scaling along the axes, the simplest it can look.
Worked examples
Section titled “Worked examples”| Matrix | Eigenvalues | Eigenvectors |
|---|---|---|
[[2,0],[0,3]] (stretch) | 2, 3 | [1,0], [0,1] (already diagonal) |
[[0,-1],[1,0]] (rotation) | none real | none (everything rotates off its line) |
[[1,1],[0,1]] (shear) | 1 (only) | [1,0] only (degenerate) |
[[3,1],[0,2]] | 3, 2 | [1,0], [1,-1] |
Last one in full: det([[3-λ,1],[0,2-λ]]) = (3-λ)(2-λ) = 0 gives λ = 3, 2. Check: M·[1,0]=[3,0]=3·[1,0]; M·[1,-1]=[2,-2]=2·[1,-1]. With P=[[1,1],[0,-1]], D = P^-1·M·P = [[3,0],[0,2]].
Why it matters for AI (substantive)
Section titled “Why it matters for AI (substantive)”- PCA: eigenvectors of the data’s covariance matrix are the directions of greatest variance (principal components); eigenvalues say how much each captures.
- Exploding / vanishing gradients: signal passing repeatedly through a weight matrix is scaled by its eigenvalues; magnitude above 1 explodes, below 1 vanishes.
- Spectral graph neural networks use eigenvectors of a graph’s matrix; PageRank is an eigenvector problem.
Pitfalls to dodge
Section titled “Pitfalls to dodge”- Eigenvectors are lines, not single arrows. Any nonzero scalar multiple is the same eigenvector.
- Not every matrix has real eigenvectors. Rotations have none; shears have one.
- Zero eigenvalue is meaningful. It means that direction collapses to the origin (not invertible).
- Eigenvalue vs eigenvector.
λis the number;vis the direction.
The one-line version
Section titled “The one-line version”Eigenvectors are the directions a transformation only scales, the eigenvalue is the scale factor, and in the eigenvector basis the transformation becomes a diagonal matrix of those factors, the simplest description it has.