Skip to content

Diagonalizing a matrix

Write a matrix with n independent eigenvectors as A = SΛS⁻¹, use it to compute powers Aᵏ = SΛᵏS⁻¹, and find the steady state of a Markov chain from the eigenvector for λ = 1.

It opens on

Computing A¹⁰ for A = [[4, 1], [2, 3]] by multiplying ten times is tedious; is there a basis in which applying A ten times is as easy as raising two numbers to the tenth power?

Why it matters

Repeating a matrix many times (population models, Markov chains, PageRank, iterative algorithms) is hard entry by entry but trivial in the eigenvector basis, where the matrix is just a stretch along each axis.

Good to know first

  • The characteristic polynomial: eigenvalues of A = [[4, 1], [2, 3]] are 5 and 2 with eigenvectors (1, 1) and (1, −2)
  • The inverse matrix: the 2 × 2 inverse is 1/(ad − bc) times [[d, −b], [−c, a]]
  • Basis and dimension: two independent vectors in ℝ² form a basis

Step by step

  1. A is a stretch in the eigenvector basis

    Write x = (2, −1) in the eigenvector basis, see A stretch each coordinate by its eigenvalue, and package this as A = SΛS⁻¹.

    For x = (2, −1): c₁ + c₂ = 2 and c₁ − 2c₂ = −1 give c₂ = 1 and c₁ = 1, so x = v₁ + v₂, the diagonal of the dashed parallelogram.

    A common mix-up

    Any matrix can be diagonalized.

    In fact: Only one with n independent eigenvectors; the shear [[1, 1], [0, 1]] has a single eigen-line, so no invertible S exists.

  2. Powers from SΛᵏS⁻¹

    Compute Aᵏ = SΛᵏS⁻¹, check A², and see why Aᵏx turns toward the dominant eigenvector v₁.

    Aᵏ = (1/3)[[1, 1], [1, −2]][[5ᵏ, 0], [0, 2ᵏ]][[2, 1], [1, −1]] = (1/3)[[2·5ᵏ + 2ᵏ, 5ᵏ − 2ᵏ], [2·5ᵏ − 2·2ᵏ, 5ᵏ + 2·2ᵏ]].

    A common mix-up

    Aᵏ is found by raising each entry of A to the k-th power.

    In fact: Only for a diagonal matrix; A² = [[18, 7], [14, 11]], not [[16, 1], [4, 9]].

  3. Markov chains and the steady state

    Diagonalize a 2-state Markov matrix and read the steady state from its eigenvector for λ = 1.

    So M = [[0.9, 0.2], [0.1, 0.8]], and if xₖ holds the shares at A and B on day k, then xₖ₊₁ = Mxₖ and xₖ = Mᵏx₀.

    A common mix-up

    The steady state depends on where the bikes start.

    In fact: Any start with total share 1 has the same (1/3)(2, 1) part; only the fading (0.7)ᵏ part depends on the start.

Try it

Diagonalize B = [[1, 2], [2, 1]], whose eigenvectors are (1, 1) for 3 and (1, −1) for −1.Answer

S = [[1, 1], [1, −1]], Λ = [[3, 0], [0, −1]], S⁻¹ = (1/2)[[1, 1], [1, −1]]

Hint: Det S = −2

For B = [[1, 2], [2, 1]] = SΛS⁻¹ with Λ = [[3, 0], [0, −1]], compute B³.Answer

(1/2)[[27 − 1, 27 + 1], [27 + 1, 27 − 1]] = [[13, 14], [14, 13]]

Hint: Λ³ = [[27, 0], [0, −1]]

A chain has M = [[0.8, 0.3], [0.2, 0.7]]. Find the steady state and the factor by which the gap shrinks each step.Answer

(0.6, 0.4); 0.5

Hint: Trace 1.5, so the second eigenvalue is 1.5 − 1

Without multiplying A by x, what is Ax?Answer

Ax = 5v₁ + 2v₂ = (5, 5) + (2, −4) = (7, 1).

Put k = 2 in this formula: what is A²?Answer

(1/3)[[54, 21], [42, 33]] = [[18, 7], [14, 11]].

Diagonalizing a matrix

30 minutes every month. No card.