LINEAR ALGEBRA / 6. EIGENVALUES & EIGENVECTORS
Eigenvalues & Eigenvectors
3Blue1Brown: vectors that only get stretched, never rotated
EXPLANATION
3Blue1Brown's definition: eigenvectors are the special vectors that stay on their own span after a transformation — they only get scaled, not rotated. Av = λv • v → eigenvector (the direction that doesn't rotate) • λ → eigenvalue (how much v gets scaled) To find: det(A - λI) = 0 (characteristic equation) Then solve (A - λI)v = 0 for each λ. Geometric intuition: • λ > 1 → stretch in this direction • 0 < λ < 1 → compression • λ < 0 → flip and scale • λ = 0 → collapse to zero (singular matrix!) Why eigenvectors matter for ML: • PCA: eigenvectors of covariance matrix = principal components (directions of max variance) • Hessian: eigenvectors = principal curvature directions, eigenvalues = curvature magnitude • Graph neural networks: graph Laplacian eigenvectors • Markov chains: stationary distribution = eigenvector with λ=1 • Attention: implicitly related to eigendecomposition of attention matrix Symmetric matrices (like covariance matrices, Hessians): • Always have real eigenvalues • Eigenvectors are orthogonal to each other • Can be eigendecomposed as A = QΛQᵀ
DIAGRAM
A = [[3, 1],
[0, 2]]
Characteristic equation: det(A - λI) = 0
det([[3-λ, 1],
[0, 2-λ]]) = (3-λ)(2-λ) = 0
Eigenvalues: λ₁=3, λ₂=2
For λ₁=3: (A-3I)v=0 → v₁=[1,0] (x-axis unchanged!)
For λ₂=2: (A-2I)v=0 → v₂=[1,-1]
Geometric: x-axis stretches by 3, v₂ direction stretches by 2
All other vectors rotate AND scale
PCA connection:
Covariance Σ → eigenvectors = principal directions
eigenvalues = variance in each directionCODE