Search Knowledge

© 2026 LIBREUNI PROJECT

Linear Algebra / Overview

Eigenvalues and Eigenvectors

Eigenvalues and Eigenvectors

Most vectors change direction when a linear transformation is applied. However, some special vectors keep their direction and are only stretched or shrunk. These are eigenvectors, and their scaling factor is the eigenvalue.

1. The Stability Equation

For a linear operator AA, a vector vv is an eigenvector if: Av=λvAv = \lambda v where λ\lambda is a scalar (the eigenvalue).

Intuition: In a 2D rotation, no real vector keeps its direction (except the zero vector). But in a scaling transformation, the axes are eigenvectors because points on them move only along the line.

python
1import numpy as np
2import matplotlib.pyplot as plt
3 
4A = np.array([[3, 1],
5 [0, 2]])
6 
7# v is an eigenvector [1, 0] with eigenvalue 3
8v = np.array([1, 0])
9Av = A @ v
10 
11# u is NOT an eigenvector [0, 1]
12u = np.array([0, 1])
13Au = A @ u
14 
15plt.quiver([0, 0], [0, 0], [v[0], u[0]], [v[1], u[1]], color=['b', 'k'], scale=5, label='Original')
16plt.quiver([0, 0], [0, 0], [Av[0], Au[0]], [Av[1], Au[1]], color=['r', 'gray'], scale=5, label='Mapped')
17plt.legend()
18plt.title("v (blue) stays on line, u (black) changes direction")
19plt.show()

2. Finding the Spectrum

To find λ\lambda, we must solve det(AλI)=0\det(A - \lambda I) = 0. This gives us the Characteristic Polynomial.

If a matrix is triangular (all zeros below the diagonal), what are its eigenvalues?

3. The Power Method: Finding Eigenvectors Iteratively

In high-dimensional spaces (like Google’s PageRank), we don’t calculate determinants. Instead, we use the Power Method: repeatedly apply AA to a random vector until it converges to the dominant eigenvector.

python
1import numpy as np
2 
3A = np.array([[2, 1],
4 [1, 2]])
5x = np.random.rand(2) # Start with random vector
6 
7for i in range(10):
8 x = A @ x
9 x = x / np.linalg.norm(x) # Normalize to prevent overflow
10 print(f"Iteration {i}: {x}")
11 
12print(f"
13Final estimate for dominant eigenvector: {x}")
14print(f"Verify: A @ x = {A @ x}")

4. Diagonalization: A=PDP1A = PDP^{-1}

If a matrix has enough eigenvectors, we can rotate our coordinate system so the transformation is just axis-aligned scaling. This is the foundation of Principal Component Analysis (PCA).

True or False: A matrix must be square to have eigenvalues.

5. Summary Check

If λ = 0 is an eigenvalue of A, what does this imply?

Previous Module Canonical Forms