Mathematics / Eigenvalues and eigenvectors

Eigenvalues and eigenvectors

A matrix turns most vectors, but a few special ones it only stretches. One 2 × 2 matrix is worked through: its two eigenvectors, their eigenvalues, and what they are good for.

Intermediate7 steps~8 min
Input v — a vector before the matrix acts
Output Av — where the matrix sends it
Eigen-line — a direction the matrix does not turn
// THE SHORT VERSION

In 30 seconds

A matrix is a rule that moves vectors around. Most get both stretched and turned. An eigenvector is one that keeps its direction: the matrix only scales it. The scale factor is its eigenvalue.

For the matrix here, (1, 1) is stretched by 4 and (1, −1) by 2. Knowing those two lines explains everything the matrix does.

Apply the matrix repeatedly and the direction with the largest eigenvalue takes over. That fact powers PageRank, PCA and tests of whether a system is stable.

Eigenvalues and eigenvectors, step by step

STEPS01 / 07

This symmetric matrix was chosen to be tidy. In general an eigenvalue can be negative (the vector flips) or complex: a quarter-turn rotation has no real eigenvector at all.

STEP 01 / 07 A matrix moves vectors
THE MATH
A = [3 1; 1 3] A(1, 0) = (3, 1) A(0, 1) = (1, 3)
  1. Step 1: A matrix moves vectors. A matrix is a rule that turns each vector into a new one. This matrix A sends (x, y) to (3x + y, x + 3y). Feed it (1, 0) and out comes (3, 1); feed it (0, 1) and out comes (1, 3). Both arrows end up longer, and both have been turned away from where they pointed.
  2. Step 2: One that is not turned. Now try (1, 1). The output is (4, 4): exactly the same direction, four times as long. A vector that a matrix only stretches, without turning it, is called an eigenvector of that matrix. The stretch factor, here 4, is its eigenvalue.
  3. Step 3: A second direction. There is one more such direction. (1, −1) goes to (2, −2): again not turned, this time stretched by 2. So this matrix has two eigenvectors with eigenvalues 4 and 2. Any multiple of an eigenvector works just as well, so each one really stands for a whole line.
  4. Step 4: Finding them by algebra. Guessing is not needed. We want A v = λ v for some number λ and a non-zero v. That is only possible when the determinant of A − λI is zero, which here gives λ² − 6λ + 8 = 0, so λ is 4 or 2. Putting each λ back in gives the direction that goes with it.
  5. Step 5: What the matrix really does. With both eigen-lines known, the matrix is easy to read: it stretches by 4 along one line and by 2 along the other, turning a circle into an ellipse. Any vector can be split into a part on each line. Stretch the parts separately, add them back, and you have the output, such as (3, 1) from step 1.
  6. Step 6: Repeat: one direction wins. Apply A again and again. Each time, the part along (1, 1) is multiplied by 4 and the part along (1, −1) only by 2, so the first part takes over and the result swings toward the eigenvector with the largest eigenvalue. Repeating a matrix like this is how PageRank finds its ranking.
  7. Step 7: Where they are used. PCA takes a table of data and finds the eigenvectors of its covariance matrix: the axes along which the data spreads most. PageRank is an eigenvector with eigenvalue 1 of a matrix built from web links. And for a system updated step by step, eigenvalues smaller than 1 in size mean disturbances die out, larger ones mean they grow.
VALUES SO FAR
A[3 1; 1 3]matrix
A(1, 0)(3, 1)turned
v₁····eigenvec
λ₁····eigenval
v₂····eigenvec
λ₂····eigenval
equation····det
A⁴(1, 0)····repeat
// AFTER

Learn next

Nothing builds on this one yet. See every mathematics concept.

Spotted a mistake on this page?