Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Linear Algebra  ›  Capstone Project

Eigenvalues and Diagonalization

Eigenvalues, Diagonalization 15 minAn eigenvector is a direction a matrix only stretches, its eigenvalue is the stretch factor, and writing a matrix in terms of its eigenvectors makes it diagonal.

Eigenvalues and Diagonalization

Plot size against rent for a few hundred flats and the dots form a long cloud tilted up and to the right. The direction the cloud stretches along, and how far it stretches, are an eigenvector and an eigenvalue. Principal component analysis, a standard way to shrink many features into a few, is built on exactly this.

The rule

An eigenvector keeps its direction; its eigenvalue says how much it stretches.

Most vectors change direction when a matrix acts on them. A few special ones only get longer, shorter or flipped. For those, Av=λvAv = \lambda v: vv is the eigenvector and the number λ\lambda is its eigenvalue.

Take A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}:

  • v=[1,1]v = [1, 1]: Av=[3,3]=3vAv = [3, 3] = 3v. Same direction, stretched by 3, so λ=3\lambda = 3.
  • v=[1,−1]v = [1, -1]: Av=[1,−1]Av = [1, -1]. Same direction, stretched by 1, so λ=1\lambda = 1.
  • v=[1,0]v = [1, 0]: Av=[2,1]Av = [2, 1]. The direction changed, so this is not an eigenvector.

Diagonalization rewrites the matrix using its eigenvectors: A=PDP−1A = P D P^{-1}, where the columns of PP are the eigenvectors and DD is diagonal with the eigenvalues. In eigenvector coordinates the matrix is just "stretch each axis". That makes powers easy: A10=PD10P−1A^{10} = P D^{10} P^{-1}, and a diagonal matrix is raised to a power one entry at a time.

Covariance matrices, which describe how features vary together, are symmetric. Symmetric matrices always have real eigenvalues and perpendicular eigenvectors, which is why PCA can use them as new axes: the eigenvector with the largest eigenvalue points where the data spreads most.

The shortcut

For a 2 × 2 matrix: the eigenvalues add up to the trace and multiply to the determinant. The trace is the sum of the diagonal. Find two numbers with that sum and product.

Eigenvalues of [[4, 1], [2, 3]]Step 1 of 4
  1. Trace and determinant

    Trace: 4 + 3 = 7. Determinant: 4 × 3 − 1 × 2 = 10.

For a diagonal or triangular matrix it is even faster: the eigenvalues are the diagonal entries.

Drills

Answer fast — trust the rule.

quick drill

What are the eigenvalues of [[5, 0], [0, 2]]?

quick drill

What are the eigenvalues of [[2, 2], [1, 3]]?

quick drill

Is [1, 1] an eigenvector of [[2, 1], [1, 2]]?

quick drill

Why does diagonalizing A make the tenth power of A easy?

quick drill

In PCA on size-and-rent data, what does the eigenvector with the largest eigenvalue of the covariance matrix point along?

Remember

  • An eigenvector keeps its direction; its eigenvalue says how much it stretches.
  • Shortcut for 2 × 2: eigenvalues add to the trace and multiply to the determinant.
  • Trap: assuming any vector is an eigenvector; check that the direction really stays put.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainEigenvalues without a formula

For the matrix [[4, 1], [2, 3]], find both eigenvalues with the trace and determinant shortcut, find an eigenvector for each, and explain why diagonalization makes the tenth power of this matrix easy.