Skip to content

Eigenvalues and Eigenvectors

Most vectors, hit by a matrix, come out both turned and stretched. A few special ones come out only stretched — same direction, different length. Those are the eigenvectors, and the stretch factors are the eigenvalues.

The word is German: eigen means “characteristic”, “self” or “own”. These are the matrix’s own directions, and finding them tells you what the matrix is actually doing, in a way that reading its entries never does.

  • Definition 4.6, the eigenvalue equation, and the four equivalent conditions for λ\lambda to be an eigenvalue.
  • The characteristic polynomial as the route to the eigenvalues (Theorem 4.8), and why it is not how anyone computes them.
  • Algebraic against geometric multiplicity (Definitions 4.9 and 4.11), and what defective means (Definition 4.13).
  • The spectral theorem (Theorem 4.15): symmetric matrices always have an orthonormal eigenbasis and real eigenvalues.
  • Theorems 4.16 and 4.17: detA=λi\det\mathbf{A} = \prod\lambda_i and trA=λi\mathrm{tr}\,\mathbf{A} = \sum\lambda_i.
  • Why a rotation has no real eigenvectors, and why that is the right answer rather than a failure.
  • PageRank as the dominant eigenvector of a transition matrix, with the measured convergence rate.

Intuition: the directions a map does not turn

Section titled “Intuition: the directions a map does not turn”

Take a matrix and feed it every direction on the unit circle. Watch the angle between x\mathbf{x} and Ax\mathbf{A}\mathbf{x} as you sweep round.

For most directions that angle is nonzero: the matrix turned the vector. At a few special angles it drops to zero (or to 180°180°, which is the same line pointing the other way). Those are the eigenvector directions, and the ratio of lengths there is the eigenvalue.

Three things follow immediately, and each is a theorem later:

  • There are at most nn of these directions, because you cannot have more than nn independent directions in Rn\mathbb{R}^n.
  • There can be fewer. A shear turns every direction except one. A rotation turns every direction, so it has none at all — over the reals.
  • A negative eigenvalue is still an eigenvector: the line is preserved, the arrow flips along it.
diagram Diagram mermaid

The exclusion x0\mathbf{x} \neq \mathbf{0} is not pedantry. A0=λ0\mathbf{A}\mathbf{0} = \lambda\mathbf{0} holds for every λ\lambda, so without it every number would be an eigenvalue of every matrix.

λ is an eigenvalue of A    x0:Ax=λx    (AλI)x=0 nontrivially\lambda \text{ is an eigenvalue of } \mathbf{A} \iff \exists\,\mathbf{x}\neq\mathbf{0}: \mathbf{A}\mathbf{x} = \lambda\mathbf{x} \iff (\mathbf{A}-\lambda\mathbf{I})\mathbf{x} = \mathbf{0} \text{ nontrivially}     rk(AλI)<n    det(AλI)=0\iff \mathrm{rk}(\mathbf{A}-\lambda\mathbf{I}) < n \iff \det(\mathbf{A}-\lambda\mathbf{I}) = 0

Read that chain forwards and it is the derivation of the whole method. An eigenvector is a nonzero solution of a homogeneous system, a homogeneous system has a nonzero solution exactly when its matrix is rank-deficient, and a square matrix is rank-deficient exactly when its determinant vanishes (§4.1, Theorem 4.3). So the eigenvalues are the roots of det(AλI)\det(\mathbf{A}-\lambda\mathbf{I}), which §4.1 named the characteristic polynomial.

An eigenvector is really a direction, or more precisely a line through the origin. Definition 4.7 distinguishes codirected (same direction) from collinear (same or opposite direction), and eigenvectors come in collinear families. This is why libraries return unit vectors, and why their signs are arbitrary — a fact that costs people reproducibility bugs in PCA plots.

That inequality is the entire subtlety of this section, and §4.4 depends on it.

Distinct eigenvalues are sufficient for an eigenbasis, not necessary. What is required is that the eigenspace dimensions add to nn; a defective matrix has some λi\lambda_i with algebraic multiplicity m>1m > 1 and geometric multiplicity below mm. And the book’s remark closes the loop: a defective matrix cannot have nn distinct eigenvalues, since Theorem 4.12 would then give it a basis.

  • A\mathbf{A} and A\mathbf{A}^\top have the same eigenvalues, though generally different eigenvectors.
  • Eλ=ker(AλI)E_\lambda = \ker(\mathbf{A}-\lambda\mathbf{I}).
  • Similar matrices have the same eigenvalues, so the eigenvalues — like the determinant and the trace — characterise the mapping, not the representation.
  • Symmetric positive definite matrices always have positive, real eigenvalues.

Both halves are one line. Symmetry: S=(AA)=A(A)=AA=S\mathbf{S}^\top = (\mathbf{A}^\top\mathbf{A})^\top = \mathbf{A}^\top(\mathbf{A}^\top)^\top = \mathbf{A}^\top\mathbf{A} = \mathbf{S}. Semidefiniteness: xSx=(Ax)(Ax)=Ax20\mathbf{x}^\top\mathbf{S}\mathbf{x} = (\mathbf{A}\mathbf{x})^\top(\mathbf{A}\mathbf{x}) = \lVert\mathbf{A}\mathbf{x}\rVert^2 \geq 0 — a sum of squares.

This theorem is the hinge of §4.5. It says any matrix, of any shape, can be turned into a symmetric one — and symmetric matrices have the best behaviour available:

Consequences, in order of usefulness: a symmetric matrix always diagonalises; the diagonalising matrix can be taken orthogonal, so A=PDP\mathbf{A} = \mathbf{P}\mathbf{D}\mathbf{P}^\top with no inverse to compute; and no complex arithmetic ever appears. Every result in Chapters 10 and 12 that assumes a covariance or kernel matrix behaves nicely is cashing this theorem.

The geometry is in the book’s Figure 4.6. Take an orthonormal eigenbasis (x1,x2)(\mathbf{x}_1,\mathbf{x}_2) of R2\mathbb{R}^2; the unit square they span has area 11 and circumference 2(1+1)2(1+1). Applying A\mathbf{A} sends them to λ1x1\lambda_1\mathbf{x}_1 and λ2x2\lambda_2\mathbf{x}_2, still orthogonal, so the image is a rectangle of area λ1λ2\lvert\lambda_1\lambda_2\rvert and circumference 2(λ1+λ2)2(\lvert\lambda_1\rvert + \lvert\lambda_2\rvert). The determinant is the area change; the sum of the absolute eigenvalues is the circumference change.

A=[4213]\mathbf{A} = \begin{bmatrix} 4 & 2\\ 1 & 3\end{bmatrix}

Step 1 — the characteristic polynomial.

pA(λ)=det(AλI)=4λ213λ=(4λ)(3λ)21p_{\mathbf{A}}(\lambda) = \det(\mathbf{A}-\lambda\mathbf{I}) = \begin{vmatrix} 4-\lambda & 2\\ 1 & 3-\lambda\end{vmatrix} = (4-\lambda)(3-\lambda) - 2\cdot1

Step 2 — the eigenvalues. Expand and factor:

(4λ)(3λ)2=127λ+λ22=107λ+λ2=(2λ)(5λ)(4-\lambda)(3-\lambda) - 2 = 12 - 7\lambda + \lambda^2 - 2 = 10 - 7\lambda + \lambda^2 = (2-\lambda)(5-\lambda)

giving λ1=2\lambda_1 = 2 and λ2=5\lambda_2 = 5.

Two free checks against §4.1: the constant term 1010 should be detA=4(3)2(1)=10\det\mathbf{A} = 4(3)-2(1) = 10 ✓, and the λ\lambda coefficient 7-7 should be trA=(4+3)-\mathrm{tr}\mathbf{A} = -(4+3) ✓. And Theorems 4.16 and 4.17: 2×5=10=det2 \times 5 = 10 = \det, 2+5=7=tr2 + 5 = 7 = \mathrm{tr} ✓.

Step 3 — the eigenspaces. Solve (AλI)x=0(\mathbf{A}-\lambda\mathbf{I})\mathbf{x} = \mathbf{0} for each.

For λ=5\lambda = 5:

[452135]x=[1212]x=0\begin{bmatrix} 4-5 & 2\\ 1 & 3-5\end{bmatrix}\mathbf{x} = \begin{bmatrix} -1 & 2\\ 1 & -2\end{bmatrix}\mathbf{x} = \mathbf{0}

Both rows say the same thing, x1=2x2x_1 = 2x_2, so

E5=span ⁣[[21]](4.33)E_5 = \mathrm{span}\!\left[\begin{bmatrix}2\\1\end{bmatrix}\right] \tag{4.33}

For λ=2\lambda = 2:

[422132]x=[2211]x=0\begin{bmatrix} 4-2 & 2\\ 1 & 3-2\end{bmatrix}\mathbf{x} = \begin{bmatrix} 2 & 2\\ 1 & 1\end{bmatrix}\mathbf{x} = \mathbf{0}

Both rows say x2=x1x_2 = -x_1, so

E2=span ⁣[[11]](4.35)E_2 = \mathrm{span}\!\left[\begin{bmatrix}1\\-1\end{bmatrix}\right] \tag{4.35}

Both eigenspaces are one-dimensional. Their dimensions add to 22, so the eigenvectors form a basis of R2\mathbb{R}^2 and A\mathbf{A} is not defective.

A sanity check that catches sign errors. A(2,1)=(42+21, 12+31)=(10,5)=5(2,1)\mathbf{A}(2,1)^\top = (4\cdot2+2\cdot1,\ 1\cdot2+3\cdot1)^\top = (10,5)^\top = 5(2,1)^\top ✓.

A=[2102]\mathbf{A} = \begin{bmatrix}2 & 1\\ 0 & 2\end{bmatrix}

Triangular, so the determinant of AλI\mathbf{A}-\lambda\mathbf{I} is the product of its diagonal: p(λ)=(2λ)2p(\lambda) = (2-\lambda)^2. One eigenvalue λ=2\lambda = 2, algebraic multiplicity 2.

A2I=[0100]\mathbf{A}-2\mathbf{I} = \begin{bmatrix}0&1\\0&0\end{bmatrix}

which has rank 11, so its null space is one-dimensional: x2=0x_2 = 0, and

E2=span ⁣[[10]]E_2 = \mathrm{span}\!\left[\begin{bmatrix}1\\0\end{bmatrix}\right]

Geometric multiplicity 1. One independent eigenvector where two are needed — the matrix is defective, and §4.4’s Theorem 4.20 will refuse to diagonalise it.

Example 4.8 — the spectral theorem in action

Section titled “Example 4.8 — the spectral theorem in action”
A=[322232223](4.37)\mathbf{A} = \begin{bmatrix}3&2&2\\2&3&2\\2&2&3\end{bmatrix} \tag{4.37}

The characteristic polynomial is pA(λ)=(λ1)2(λ7)p_{\mathbf{A}}(\lambda) = -(\lambda-1)^2(\lambda-7), so λ1=1\lambda_1 = 1 (repeated) and λ2=7\lambda_2 = 7. The eigenspaces come out as

E1=span ⁣[[110]x1,[101]x2],E7=span ⁣[[111]x3](4.39)E_1 = \mathrm{span}\!\left[\underbrace{\begin{bmatrix}-1\\1\\0\end{bmatrix}}_{\mathbf{x}_1}, \underbrace{\begin{bmatrix}-1\\0\\1\end{bmatrix}}_{\mathbf{x}_2}\right], \qquad E_7 = \mathrm{span}\!\left[\underbrace{\begin{bmatrix}1\\1\\1\end{bmatrix}}_{\mathbf{x}_3}\right] \tag{4.39}

Here λ1\lambda_1 has algebraic multiplicity 22 and geometric multiplicity 22, so the matrix is not defective. But look at the given basis of E1E_1: x1x2=10\mathbf{x}_1^\top\mathbf{x}_2 = 1 \neq 0, so x1\mathbf{x}_1 and x2\mathbf{x}_2 are not orthogonal, even though x3\mathbf{x}_3 is orthogonal to both.

The spectral theorem says an orthogonal basis exists, not that the one you happened to compute is it. And the fix is available: by Equation 4.40, any linear combination of eigenvectors sharing an eigenvalue is again an eigenvector for that eigenvalue,

A(αx1+βx2)=λ(αx1+βx2)\mathbf{A}(\alpha\mathbf{x}_1 + \beta\mathbf{x}_2) = \lambda(\alpha\mathbf{x}_1 + \beta\mathbf{x}_2)

so Gram-Schmidt applied within the eigenspace produces an orthogonal pair. The book’s result is

x1=[110],x2=12[112](4.41)\mathbf{x}_1' = \begin{bmatrix}-1\\1\\0\end{bmatrix}, \qquad \mathbf{x}_2' = \tfrac{1}{2}\begin{bmatrix}-1\\-1\\2\end{bmatrix} \tag{4.41}

Check: x1x2=12(11+0)=0\mathbf{x}_1'^\top\mathbf{x}_2' = \tfrac12(1 - 1 + 0) = 0 ✓, and x3x2=12(11+2)=0\mathbf{x}_3^\top\mathbf{x}_2' = \tfrac12(-1-1+2) = 0 ✓.

book_examples.py
import numpy as np
 
def report(A, name):
    A = np.asarray(A, dtype=float)
    n = A.shape[0]
    vals = np.linalg.eigvals(A)
    print(f"{name}: eigenvalues {np.round(vals, 6)}")
    print(f"    det {float(np.linalg.det(A)):+.6f} = prod {float(np.prod(vals).real):+.6f}   "
          f"trace {float(np.trace(A)):+.6f} = sum {float(np.sum(vals).real):+.6f}")
    total = 0
    for lam in np.unique(np.round(np.real(vals), 6)):
        alg = int(np.sum(np.abs(np.real(vals) - lam) < 1e-6))
        geo = n - np.linalg.matrix_rank(A - lam * np.eye(n), tol=1e-8)
        total += geo
        print(f"    lambda {lam:+.4f}: algebraic {alg}, geometric {geo}")
    print(f"    eigenspace dimensions sum to {total} of {n} -> "
          f"{'defective' if total < n else 'has an eigenbasis'}")
 
report([[4, 2], [1, 3]], "Example 4.5")
report([[2, 1], [0, 2]], "Example 4.6")
report([[3, 2, 2], [2, 3, 2], [2, 2, 3]], "Example 4.8")
 
# Example 4.8's non-orthogonal eigenbasis, and the orthogonal one.
x1, x2, x3 = np.array([-1.0, 1, 0]), np.array([-1.0, 0, 1]), np.array([1.0, 1, 1])
print()
print("given basis of E_1: x1.x2 =", float(x1 @ x2), " (not orthogonal)")
x2p = 0.5 * np.array([-1.0, -1.0, 2.0])
print("after Gram-Schmidt: x1.x2' =", float(x1 @ x2p), "  x3.x2' =", float(x3 @ x2p))
A8 = np.array([[3.0, 2, 2], [2, 3, 2], [2, 2, 3]])
for v, nm in ((x1, "x1"), (x2p, "x2'"), (x3, "x3")):
    lam = float((A8 @ v) @ v) / float(v @ v)
    print(f"  A {nm} = {lam:.6f} * {nm}, residual "
          f"{float(np.linalg.norm(A8 @ v - lam * v)):.2e}")
output
Example 4.5: eigenvalues [5. 2.]
    det +10.000000 = prod +10.000000   trace +7.000000 = sum +7.000000
    lambda +2.0000: algebraic 1, geometric 1
    lambda +5.0000: algebraic 1, geometric 1
    eigenspace dimensions sum to 2 of 2 -> has an eigenbasis
Example 4.6: eigenvalues [2. 2.]
    det +4.000000 = prod +4.000000   trace +4.000000 = sum +4.000000
    lambda +2.0000: algebraic 2, geometric 1
    eigenspace dimensions sum to 1 of 2 -> defective
Example 4.8: eigenvalues [1. 7. 1.]
    det +7.000000 = prod +7.000000   trace +9.000000 = sum +9.000000
    lambda +1.0000: algebraic 2, geometric 2
    lambda +7.0000: algebraic 1, geometric 1
    eigenspace dimensions sum to 3 of 3 -> has an eigenbasis
 
given basis of E_1: x1.x2 = 1.0  (not orthogonal)
after Gram-Schmidt: x1.x2' = 0.0   x3.x2' = 0.0
  A x1 = 1.000000 * x1, residual 0.00e+00
  A x2' = 1.000000 * x2', residual 0.00e+00
  A x3 = 7.000000 * x3, residual 0.00e+00

Every book number reproduced, and note the residuals: exactly zero, not 101610^{-16}, because these are integer matrices acting on integer and half-integer vectors.

The first sketch is the definition, swept. Drag round the circle and watch the angle between x\mathbf{x} and Ax\mathbf{A}\mathbf{x} collapse at the eigendirections.

sketch Eigenvectors are where the turning stops p5.js
Drag the white vector around the circle. The blue arrow is Ax. The readout is the angle between them, and the meter at the bottom is that angle as a function of direction — it touches zero exactly at the eigenvector directions, marked in amber. Change the matrix entries and watch the zeros move, merge, or disappear entirely.

The second sketch plots the characteristic polynomial itself, so the roots are visible and the complex case is visibly a curve that misses the axis.

sketch The characteristic polynomial and its roots p5.js
Edit the matrix and watch p(lambda) = det(A - lambda I) deform. Its roots — the crossings of the horizontal axis — are the eigenvalues. Push the entries towards a rotation and the parabola lifts clear of the axis: no real roots, no real eigenvectors, and the discriminant readout goes negative.

And the stepped version on the book’s own Example 4.5, which runs the full three-step procedure and checks both theorems:

matrixExample 4.5, step by stepeigen analysis, §4.2
A x (rotated, not just scaled)
A
4213
setupA is 2x2. The eigenvalue equation Ax = Lx asks for directions the matrix only scales — and the only way a nonzero x can satisfy (A - L I)x = 0 is for A - L I to be singular, so det(A - L I) = 0 is where the eigenvalues must come from.
1/7

The dashed white arrow is a direction that is NOT an eigenvector, drawn beside its image so the turning is visible. The amber and blue lines are the two eigenspaces.

Then the defective case, where the procedure runs to completion and the verdict changes:

matrixExample 4.6: one eigenvalue, one eigenvector, two neededeigen analysis, §4.2
A
2102
setupA is 2x2. The eigenvalue equation Ax = Lx asks for directions the matrix only scales — and the only way a nonzero x can satisfy (A - L I)x = 0 is for A - L I to be singular, so det(A - L I) = 0 is where the eigenvalues must come from.
1/7

Algebraic multiplicity 2 and geometric multiplicity 1. The last frame is the verdict: the eigenspaces do not add up to the dimension, so no eigenbasis exists.

And the spectral theorem’s case, with a repeated eigenvalue whose eigenspace is genuinely two-dimensional:

matrixExample 4.8: symmetric, repeated, and still diagonalisableeigen analysis, §4.2
A
322232223
setupA is 3x3. The eigenvalue equation Ax = Lx asks for directions the matrix only scales — and the only way a nonzero x can satisfy (A - L I)x = 0 is for A - L I to be singular, so det(A - L I) = 0 is where the eigenvalues must come from.
1/7

Lambda = 1 has algebraic multiplicity 2 and geometric multiplicity 2, so the dimensions add to 3. Above two dimensions the stage shows the numbers rather than a misleading picture.

eigen_from_scratch.py
import numpy as np
 
def eigen_report(A, tol=1e-8):
    """Everything section 4.2 defines, computed and checked."""
    A = np.asarray(A, dtype=float)
    n = A.shape[0]
    vals = np.linalg.eigvals(A)
 
    out = {
        "spectrum": np.sort_complex(vals),
        "all_real": bool(np.all(np.abs(vals.imag) < 1e-12)),
        "det_matches_product": abs(float(np.linalg.det(A)) - float(np.real(np.prod(vals)))) < 1e-8,
        "trace_matches_sum": abs(float(np.trace(A)) - float(np.real(np.sum(vals)))) < 1e-8,
        "multiplicities": [],
    }
    total = 0
    for lam in np.unique(np.round(np.real(vals[np.abs(vals.imag) < 1e-12]), 8)):
        alg = int(np.sum(np.abs(np.real(vals) - lam) < 1e-6))
        geo = n - np.linalg.matrix_rank(A - lam * np.eye(n), tol=tol)
        total += geo
        out["multiplicities"].append((float(lam), alg, int(geo)))
    out["independent_eigenvectors"] = total
    out["defective"] = total < n
    return out
 
cases = {
    "Ex 4.5  [[4,2],[1,3]]": [[4, 2], [1, 3]],
    "Ex 4.6  [[2,1],[0,2]]": [[2, 1], [0, 2]],
    "Ex 4.8  3x3 symmetric": [[3, 2, 2], [2, 3, 2], [2, 2, 3]],
    "identity (Ex 4.4)":     np.eye(3),
    "rotation by 30 deg":    [[np.cos(np.pi / 6), -np.sin(np.pi / 6)],
                              [np.sin(np.pi / 6), np.cos(np.pi / 6)]],
    "A^T A for a 2x3 A":     np.array([[1.0, 0, 1], [-2, 1, 0]]).T @ np.array([[1.0, 0, 1], [-2, 1, 0]]),
}
 
for name, A in cases.items():
    r = eigen_report(A)
    mult = ", ".join(f"{l:+.2f}(a{a},g{g})" for l, a, g in r["multiplicities"])
    print(f"{name:24} real {str(r['all_real']):5} "
          f"det=prod {str(r['det_matches_product']):5} tr=sum {str(r['trace_matches_sum']):5} "
          f"defective {str(r['defective']):5}  {mult}")
output
Ex 4.5  [[4,2],[1,3]]    real True  det=prod True  tr=sum True  defective False  +2.00(a1,g1), +5.00(a1,g1)
Ex 4.6  [[2,1],[0,2]]    real True  det=prod True  tr=sum True  defective True   +2.00(a2,g1)
Ex 4.8  3x3 symmetric    real True  det=prod True  tr=sum True  defective False  +1.00(a2,g2), +7.00(a1,g1)
identity (Ex 4.4)        real True  det=prod True  tr=sum True  defective False  +1.00(a3,g3)
rotation by 30 deg       real False det=prod True  tr=sum True  defective True   
A^T A for a 2x3 A        real True  det=prod True  tr=sum True  defective False  -0.00(a1,g1), +1.00(a1,g1), +6.00(a1,g1)

Four things to read off that table.

Example 4.4, the identity. pI(λ)=(1λ)np_{\mathbf{I}}(\lambda) = (1-\lambda)^n, so λ=1\lambda = 1 with algebraic multiplicity nn — and geometric multiplicity nn too, because Ix=1x\mathbf{I}\mathbf{x} = 1\mathbf{x} for every vector. The sole eigenspace E1E_1 spans all of Rn\mathbb{R}^n and every standard basis vector is an eigenvector.

The rotation. all_real is False, the multiplicity list is empty, and it is reported defective — correctly, because over the reals it has no eigenvectors at all. Note that det=prod and tr=sum still hold: the complex eigenvalues 0.866±0.5i0.866 \pm 0.5i multiply to 11 and add to 1.7321.732, both real, because conjugate pairs cancel their imaginary parts.

AA\mathbf{A}^\top\mathbf{A}. Eigenvalues 00, 11, 66 — all real and all non-negative, which is Theorem 4.14. It is positive semidefinite rather than definite here because the 2×32\times3 matrix has rank 2<32 < 3, so one eigenvalue is exactly zero. Those numbers reappear in §4.5: the singular values are 6\sqrt{6} and 11.

Example 4.6. Algebraic 22, geometric 11, defective — and det=prod still holds with the repeated eigenvalue counted twice, 2×2=42 \times 2 = 4.

figure The book's Figure 4.4, rebuilt matplotlib
A two-row grid of five panels. The top row shows the same colour-coded square grid of points five times; the bottom row shows each one after a different linear map, with eigenvector arrows drawn and eigenvalues and determinants printed. A two-row grid of five panels. The top row shows the same colour-coded square grid of points five times; the bottom row shows each one after a different linear map, with eigenvector arrows drawn and eigenvalues and determinants printed.
Five qualitatively different cases: two distinct real eigenvalues with det 1; a shear with a repeated eigenvalue and collinear eigenvectors; a rotation with a complex pair and no eigenvectors drawn; a map with a zero eigenvalue that collapses the plane to a line; and a shear-and-stretch with det 0.75.
figure The shape of Example 4.7 matplotlib
Two black-and-white adjacency-matrix images side by side, one showing a banded clustered structure and one showing uniform scatter, with a third panel plotting both sorted eigenvalue spectra and a measured shape profile. Two black-and-white adjacency-matrix images side by side, one showing a banded clustered structure and one showing uniform scatter, with a third panel plotting both sorted eigenvalue spectra and a measured shape profile.
Synthetic networks, not the C. elegans data. Both are symmetrised as A plus A-transpose so every eigenvalue is real. The clustered spectrum drops from 0.75 to 0.26 of its range by the halfway index; the random one only reaches 0.39 — the knee is what local clustering produces.
figure Example 4.9: PageRank is an eigenvector matplotlib
Left, a bar chart comparing a uniform starting distribution with the converged PageRank vector over six pages. Right, a log plot of the distance to that eigenvector against iteration count, with a dashed reference line at the eigenvalue ratio. Left, a bar chart comparing a uniform starting distribution with the converged PageRank vector over six pages. Right, a log plot of the distance to that eigenvector against iteration count, with a dashed reference line at the eigenvalue ratio.
Repeated multiplication by the transition matrix converges to the eigenvector of eigenvalue 1. The measured decay rate is 0.5719 against an eigenvalue ratio of 0.5755 — geometric convergence at exactly the rate the second eigenvalue predicts.

From the five mappings. Every case in the table below is a real possibility you will meet, and the figure has one of each:

matrixeigenvaluesdeterminantwhat it does
diag(12,2)\mathrm{diag}(\tfrac12, 2)0.50.5, 2211stretches one axis, compresses the other; area preserved
[11201]\begin{bmatrix}1&\tfrac12\\0&1\end{bmatrix}11, 1111a shear; one eigendirection, drawn twice in opposite directions
R(30°)\mathbf{R}(30°)0.866±0.5i0.866 \pm 0.5i11a rotation; no real eigenvectors, so none are drawn
[1111]\begin{bmatrix}1&-1\\-1&1\end{bmatrix}00, 2200collapses the plane onto a line; area zero
[112121]\begin{bmatrix}1&\tfrac12\\\tfrac12&1\end{bmatrix}0.50.5, 1.51.50.750.75shear and stretch; symmetric, so the eigenvectors are orthogonal

The two to dwell on are the third and fourth. The rotation has determinant 11 — it preserves area perfectly — and yet has no eigenvectors, which shows that “well behaved” and “has eigenvectors” are unrelated. The collapsing map has a zero eigenvalue, and a zero eigenvalue is exactly a nonzero vector in the kernel: Ax=0x=0\mathbf{A}\mathbf{x} = 0\mathbf{x} = \mathbf{0}. So λ=0\lambda = 0 appearing in a spectrum is the eigenvalue statement of singularity.

From the eigenspectrum. Both matrices are symmetrised as A+A\mathbf{A} + \mathbf{A}^\top, exactly as the book does for the C. elegans connectivity matrix, and for exactly the reason the book gives: the raw connectivity matrix is not symmetric, so its eigenvalues need not be real. After symmetrising, Theorem 4.15 guarantees they are.

The shape measurement is the interesting part. Rescale each sorted spectrum to [0,1][0,1] and read its height at fixed index fractions: the clustered network gives 0.75,0.38,0.26,0.16,0.090.75, 0.38, 0.26, 0.16, 0.09 and the random one 0.65,0.54,0.39,0.23,0.120.65, 0.54, 0.39, 0.23, 0.12. The random spectrum is close to a straight line; the clustered one falls off a cliff and then flattens. That knee is the book’s S-shape, and it comes from local clustering rather than from anything biological.

From PageRank. The bar chart is the fixed point of Ax=x\mathbf{A}\mathbf{x} = \mathbf{x}: page 3 gets the most weight at 0.36360.3636 because everything links to it, and page 6 the least at 0.05190.0519. The book’s description is exact — the sequence x,Ax,A2x,\mathbf{x}, \mathbf{A}\mathbf{x}, \mathbf{A}^2\mathbf{x}, \dots converges to an x\mathbf{x}^* with Ax=x\mathbf{A}\mathbf{x}^* = \mathbf{x}^*, i.e. an eigenvector with eigenvalue 11.

The right panel measures the rate. λ1=1\lvert\lambda_1\rvert = 1 exactly (the matrix is column-stochastic, so it must be), λ2=0.575482\lvert\lambda_2\rvert = 0.575482, and the fitted decay rate over iterations 55 to 3535 is 0.5719110.571911. The error falls from 1.77×1011.77\times10^{-1} at one iteration to 2.06×10152.06\times10^{-15} at sixty.

That ratio is the whole story of why PageRank was practical: the number of iterations you need depends on the spectral gap, not on the size of the web. A gap of 0.5750.575 buys about one decimal digit every four iterations regardless of how many pages there are.

quantitywhat it isbasis independent?how many
eigenvaluea scale factor λ\lambda with Ax=λx\mathbf{A}\mathbf{x} = \lambda\mathbf{x}yesat most nn distinct
eigenvectora direction the matrix only scalesno (it moves with the basis)a whole line per eigenvalue, at least
eigenspace EλE_\lambdaker(AλI)\ker(\mathbf{A}-\lambda\mathbf{I})as a subspace, yesone per eigenvalue
algebraic multiplicityroot multiplicity in pAp_{\mathbf{A}}yessums to exactly nn over C\mathbb{C}
geometric multiplicitydimEλ\dim E_\lambdayesbetween 11 and the algebraic multiplicity
eigenspectrumthe set of all eigenvaluesyes
pch.quizTag Check your understanding
  1. Why does Definition 4.6 insist the eigenvector be nonzero?

    pch.quizShowAnswer

    B — Because A times the zero vector equals lambda times the zero vector for every lambda — without the exclusion, every number would be an eigenvalue of every matrix — The same reason forces the eigenspace to be defined as the eigenvectors TOGETHER WITH zero: the eigenvectors alone are not a subspace, since they exclude the origin.

  2. A 3x3 matrix has one eigenvalue with algebraic multiplicity 2 and geometric multiplicity 1, plus one simple eigenvalue. What follows?

    pch.quizShowAnswer

    B — The eigenspace dimensions add to 2 out of 3, so there is no eigenbasis, the matrix is defective, and Theorem 4.20 will refuse to diagonalise it — That is the book's Exercise 4.6(a) exactly: eigenvalues 1 (twice, one eigenvector) and 5. The geometric multiplicity can never exceed the algebraic one and here it is strictly less.

  3. A rotation by 30 degrees has determinant 1 and no real eigenvectors. What does that combination show?

    pch.quizShowAnswer

    B — That being well behaved and having eigenvectors are unrelated — the map is invertible, area-preserving and perfectly conditioned, and still fixes no direction, because its eigenvalues are the complex pair 0.866 plus or minus 0.5i — The determinant and trace theorems still hold: the conjugate pair multiplies to 1 and adds to 1.732, both real, because the imaginary parts cancel.

  4. In the PageRank measurement, the error decays at 0.5719 per iteration against an eigenvalue ratio of 0.5755. What does that rate depend on?

    pch.quizShowAnswer

    B — The spectral gap — the ratio of the second-largest to the largest eigenvalue modulus — and not on the size of the graph at all — That independence from size is why the method scaled. A gap of 0.575 buys roughly one decimal digit every four iterations whether the graph has six nodes or six billion.

  5. Theorem 4.14 says A-transpose A is symmetric and positive semidefinite for any A. Why does the chapter need that?

    pch.quizShowAnswer

    B — Because it turns any matrix, of any shape, into a symmetric one — and the spectral theorem then gives that symmetric matrix a real orthonormal eigenbasis, which is exactly how section 4.5 constructs the SVD — Both halves are one line: symmetry from transposing the product, and semidefiniteness because x-transpose A-transpose A x is the squared length of Ax. Measured on a 2x3 matrix, the eigenvalues of A-transpose A come out 0, 1 and 6 — non-negative, with a zero because the rank is only 2.

Exercise 2 – Algebraic against geometric multiplicity

Section titled “Exercise 2 – Algebraic against geometric multiplicity”

Exercise 3 – The rotation has no real eigenvectors

Section titled “Exercise 3 – The rotation has no real eigenvectors”

Exercise 4 – Fix Example 4.8’s non-orthogonal eigenbasis

Section titled “Exercise 4 – Fix Example 4.8’s non-orthogonal eigenbasis”

Exercise 5 – Power iteration and the spectral gap

Section titled “Exercise 5 – Power iteration and the spectral gap”
  • An eigenvector is a nonzero direction the matrix only scales, and the eigenvalue is the scale factor. Every collinear vector is also an eigenvector, so an eigenvector is really a line.
  • Four equivalent conditions: a nonzero solution of Ax = lambda x, a nontrivial null space for A minus lambda I, rank below n, determinant zero — which is why the eigenvalues are the roots of the characteristic polynomial.
  • Algebraic multiplicity counts polynomial roots; geometric multiplicity is the eigenspace dimension. Geometric is at least one and never exceeds algebraic.
  • A matrix is defective when the eigenspace dimensions add to less than n, and then no eigenbasis exists. Distinct eigenvalues are sufficient for a basis but not necessary.
  • The spectral theorem is the result to remember: a symmetric matrix has real eigenvalues and an orthonormal eigenbasis — but not necessarily the basis you computed, so Gram-Schmidt within a repeated eigenspace may be needed.
  • A-transpose A is symmetric and positive semidefinite for any A, which is how section 4.5 turns an arbitrary matrix into one the spectral theorem applies to.
  • The determinant is the product of the eigenvalues and the trace is their sum, repeats included, and both hold for complex eigenvalues because conjugate pairs cancel.
  • A rotation has no real eigenvectors despite being invertible and area-preserving, so being well behaved and having eigenvectors are unrelated.
  • Never compute eigenvalues from the characteristic polynomial. Root-finding is badly conditioned, a double root lands about 1e-8 off, and an eigenvalue that far off destroys the eigenspace computation entirely.
  • PageRank is the dominant eigenvector of a column-stochastic matrix, and power iteration converges at the spectral gap — measured 0.5719 against a predicted 0.5755, independent of graph size.

Next: Cholesky Decomposition — the first factorisation, and the one with the strictest hypothesis.

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading