🧮 Linear Algebra Kingdom · Linear Algebra
Diagonalization & Its Uses
Choosing the basis that makes a matrix simple: decide whether a matrix can be diagonalised, write down the diagonal matrix of eigenvalues, raise a matrix to a high power through its eigenbasis, and read the long run of a two-state chain or a population model off the eigenvalues.
In short
- A = P·D·P^-1 puts eigenvectors in the columns of P and their eigenvalues on the diagonal of D, in matching order.
- A 2 by 2 matrix is diagonalisable exactly when it has two independent eigenvectors; two different eigenvalues guarantee that, and a repeated one has to be checked.
- An = P·D^n·P^-1, and a diagonal matrix is raised to a power one entry at a time.
- The eigenvalue of largest size decides the long run, and an eigenvalue of exactly 1 is the steady state a chain settles into.
Choosing a better set of directions
A matrix looks complicated because of the basis it is written in, not because of what it does. Change the basis to the one made of its own eigenvectors and the complication disappears: every direction is simply rescaled, and the matrix becomes diagonal.
Written out, that is the statement
A = P·D·P^-1
where the columns of P are eigenvectors of A and D holds the matching eigenvalues on its diagonal, zeros elsewhere. Read the right-hand side from the right: P-1 rewrites an arrow in eigenvector coordinates, D scales each coordinate by its own eigenvalue, and P puts the answer back into ordinary coordinates.
The order is not free. The eigenvalue in the top-left corner of D must be the eigenvalue of the eigenvector in the first column of P. Swap the columns of P and you must swap the diagonal of D to match; leaving them out of step is the classic error here and produces a matrix that is not A at all.
For A = [[4, 1], [2, 3]], with eigenvalues 5 and 2 and eigenvectors (1, 1) and (1, -2):
P = [[1, 1], [1, -2]], D = [[5, 0], [0, 2]]
Only the direction of each column matters, not its length: replacing a column by twice itself, or by its opposite, still gives a valid P with exactly the same D.
When it can be done, and when it cannot
A 2 by 2 matrix is diagonalisable exactly when it has two independent eigenvectors — enough of them to fill the columns of P and leave P invertible.
Two different eigenvalues is always enough. Eigenvectors belonging to different eigenvalues can never lie on the same line, so if the characteristic equation has two distinct roots, you are finished before you start.
A repeated eigenvalue needs one more look, and the two cases could not be further apart.
[[3, 0], [0, 3]] is 3I: every arrow is an eigenvector, and it is already diagonal [[3, 1], [0, 3]] has the same eigenvalue 3 twice, and only one line of eigenvectors
For that second matrix, A - 3I = [[0, 1], [0, 0]], which sends (x, y) to (y, 0). That is zero only when y = 0, so the eigenvectors are exactly the multiples of (1, 0) — a single line, and no second column for P. That matrix is not diagonalisable, and no amount of work will make it so.
Two things a repeated eigenvalue is often confused with are worth ruling out. A determinant of 0 says nothing about diagonalisability: [[1, 0], [0, 0]] has determinant 0 and is already diagonal. And a matrix does not have to be symmetric — [[4, 1], [2, 3]] is not, and diagonalises perfectly well.
What it is for: powers, chains and models
The reason to do any of this is that Dn is trivial and An is not.
An = (P·D·P^-1)(P·D·P^-1)...(P·D·P^-1) = P·D^n·P^-1
because every P^-1·P in the middle collapses to the identity. And a diagonal matrix is raised to a power one entry at a time, so Dn just holds each eigenvalue raised to n. A10 is then three multiplications rather than nine.
The same idea answers "what happens in the long run?" without any matrix at all. Split a starting vector along the eigenvectors:
v = c1*u1 + c2*u2 => Ak v = c1*(lambda1^k)*u1 + c2*(lambda2^k)*u2
Each piece carries its own eigenvalue to the power k. As k grows, the piece with the largest eigenvalue by size runs away from the other one, and the whole vector lines up with that eigenvector. That single number decides everything:
- size more than 1: the vector grows without bound
- size exactly 1: it settles onto a fixed direction and stops changing
- size less than 1: it shrinks towards the zero vector
- exactly -1: it swaps to the opposite side each step, keeping the same size
In a population model the dominant eigenvalue is the long-run growth factor — 1.2 means about 20% growth per season, 0.9 means about 10% shrinkage — and its eigenvector is the proportion the population settles into. In a graphics matrix the eigenvalues are the stretch factors and the eigenvectors are the axes they act along.
Two-state chains and their steady state
A chain moves a population between two places by fixed percentages, and it always ends up somewhere. Suppose each season 20% of the surveyors at the Mill walk over to the Hall, and 30% of those at the Hall walk back.
The transition matrix has an eigenvalue of exactly 1, and its eigenvector — scaled so the two entries add to 1 — is the steady state: the split the season leaves exactly as it found it. The other eigenvalue is smaller than 1 in size, so whatever else the starting split contained fades away, and every start ends at the same place.
You do not need the matrix to find it. A split stops changing exactly when the two flows across the isle are equal:
(share at the Mill) * 20% = (share at the Hall) * 30%
so the shares are in the ratio 30 to 20, that is 3 to 2. Out of 5 parts, 3 are at the Mill and 2 at the Hall: the steady state is (3/5, 2/5).
Read the ratio carefully — it comes out swapped. The bigger share settles where the smaller leaving rate is, because fewer of them walk away each season. That is the one place people reliably go wrong, and checking it against common sense takes a moment: with 20% leaving the Mill and 30% leaving the Hall, of course the Mill ends up fuller.
Since the percentages are whole numbers, the steady state is always an exact fraction. There is never a rounded decimal here.
Worked examples
Example 1
A = [[4, 1], [2, 3]] and P = [[1, 1], [1, -2]], whose columns are eigenvectors of A. Write the D for which A = P·D·P^-1.
- Push the first column of P through A: A(1, 1) = (4 + 1, 2 + 3) = (5, 5) = 5 * (1, 1), so it belongs to the eigenvalue 5.
- Push the second column through A: A(1, -2) = (4 - 2, 2 - 6) = (2, -4) = 2 * (1, -2), so it belongs to the eigenvalue 2.
- D holds those eigenvalues on the diagonal, in the order the columns of P set: 5 first, then 2.
- So D = [[5, 0], [0, 2]], with zeros in the other two corners.
Example 2
A has eigenvalues 3 and -1, with eigenvectors u = (1, 1) and w = (1, -3). Find A3 v for v = 2u + w.
- Applying A three times multiplies each eigenvector piece by its own eigenvalue cubed.
- For u: 33 = 27, so the u piece becomes 2 * 27 = 54 lots of u.
- For w: (-1)3 = -1, so the w piece becomes -1 lot of w.
- A3 v = 54 * (1, 1) - 1 * (1, -3) = (54 - 1, 54 + 3).
- So A3 v = (53, 57).
Example 3
Each season 25% of the crystals at the Mill are moved to the Hall, and 75% of those at the Hall are moved back. Where does the split settle?
- A settled split is one the season leaves alone, so the two flows must match.
- That gives (share at the Mill) * 25% = (share at the Hall) * 75%.
- So the shares are in the ratio 75 to 25, which is 3 to 1: the Mill holds three times as much as the Hall.
- Three parts and one part make four parts in total.
- The steady state is (3/4, 1/4) — and the Mill is the fuller of the two because less leaves it each season.
Practice problems, with solutions
Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.
Problem 1
Difficulty 1 of 5A = [[2, 0], [0, 2]] Can A be written as P·D·P^-1 with D diagonal, and why?
- yes: the eigenvalue is repeated, but every direction is an eigenvector of it, so it is already a multiple of the identity
- no: the determinant is 0, so there is no P to conjugate by
- yes: it has two different eigenvalues, so it has two independent eigenvectors
- no: the eigenvalue is repeated and all of its eigenvectors lie on one single line
Answer: A. yes: the eigenvalue is repeated, but every direction is an eigenvector of it, so it is already a multiple of the identity
- trace A = 4 and det A = 4, so the characteristic equation is lambda^2 - 4lambda + 4 = 0.
- It has one repeated root, and A - lambda*I is the zero matrix, so every direction is an eigenvector.
- Two independent eigenvectors fill the columns of P, so the answer is: yes: the eigenvalue is repeated, but every direction is an eigenvector of it, so it is already a multiple of the identity.
Problem 2
Difficulty 3 of 5A = [[-7, 6], [-9, 8]], and the columns of P = [[2, 1], [3, 1]] are eigenvectors of A. Write the D for which A = P·D·P^-1. Write the matrix row by row, entries separated by commas and rows by a semicolon, like 1,2;3,4.
Answer: [[2,0],[0,-1]]
- A * (2, 3) = (4, 6) = 2 * (2, 3), so the first column belongs to 2.
- A * (1, 1) = (-1, -1) = -1 * (1, 1), so the second column belongs to -1.
- Those go on the diagonal in that order: D = [[2, 0], [0, -1]].
Problem 3
Difficulty 4 of 5A = [[0, 3], [-2, 5]]. Its eigenvalues are 2 and 3. Find the entry of A5 in row 1 and column 1.
Answer: -390
- A5 = P·D^5·P^-1, and D5 = [[32, 0], [0, 243]].
- Multiplying P·D^5·P^-1 gives A5 = [[-390, 633], [-422, 665]].
- The entry in row 1 and column 1 is -390.
Common mistakes
- Putting the eigenvalues in D in the opposite order from the eigenvectors in P, which builds a matrix that is not A.
- Assuming a repeated eigenvalue always blocks diagonalisation — a multiple of the identity repeats its eigenvalue and is already diagonal.
- Reading a steady state straight off the percentages instead of swapping them: the bigger share settles where the smaller leaving rate is.
- Multiplying an eigenvalue by k instead of raising it to the power k when working out Ak v.
What you should be able to do
- Decide whether a matrix is diagonalisable, and say why when it is not.
- Give the diagonal matrix D in A = PDP⁻¹, and an entry of a matrix power computed through it.
- Find the steady-state vector of a two-state chain.
- Say which eigenvalue governs the long-run behaviour of a model, and what the eigenvalues mean in it.
Where this fits in the curriculum
Common Core
- HSN-VM.C.8
High school — Add, subtract and multiply matrices of appropriate dimensions.
HSN-VM.C.8 is a (+) standard — beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II. A = PDP⁻¹, and every power of A read through it, is matrix multiplication of exactly these shapes.
- HSN-VM.C.10
High school — Understand that the zero and identity matrices play a role in matrix addition and multiplication similar to the role of 0 and 1 in the real numbers; the determinant of a square matrix is nonzero if and only if the matrix has a multiplicative inverse.
HSN-VM.C.10 is a (+) standard — beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II. HSN-VM.C.10 covers the identity matrix and the determinant test that says the P in A = PDP⁻¹ can be inverted at all. Diagonalization itself, and reading the long run of a Markov chain or a population model off the eigenvalues, is university content; the Common Core stops before it.