They are v1=(2,3) with λ1=4, and v2=(1,−1) with λ2=−1. The two do not lie on one line, so they form a basis of the plane (lesson 3.5.1): every vector is a combination c1v1+c2v2. The numbers c1 and c2 are its coordinates in the eigenvector basis.
Take x=(4,1). The two equations 2c1+c2=4 and 3c1−c2=1 add up to 5c1=5. So c1=1, c2=2, and x=v1+2v2.
A linear map keeps combinations (lesson 3.2.2), and it multiplies each eigenvector by its eigenvalue:
Ax=Av1+2Av2=4v1−2v2=(8,12)+(−2,2)=(6,14)
Multiplying directly agrees: A(4,1)=(4+2,12+2)=(6,14). In eigenvector coordinates, A turned (1,2) into (4,−2): it multiplied each coordinate by its own eigenvalue.
Each further multiplication does the same again, so Akx=4kv1+2(−1)kv2. Here Ak means A times itself k times, and A0=I.
k
0
1
2
3
4
5
Akx
(4,1)
(6,14)
(34,46)
(126,194)
(514,766)
(2046,3074)
For k=3 the formula gives 64(2,3)−2(1,−1)=(126,194), without multiplying by A three times.
Rule: Powers along the eigenvectors
x=c1v1+c2v2Akx=c1λ1kv1+c2λ2kv2
Split x along the eigenvectors, raise each eigenvalue to the power k, and add the parts back up. The same holds with n terms for an n×n matrix with n independent eigenvectors.
Try it
np.linalg.solve finds the coordinates (c1,c2)=(1,2): it solves c1v1+c2v2=x, a system whose columns are the eigenvectors.
np.linalg.matrix_power(A, k) multiplies A by itself k times. Each line shows the direct answer and the formula.
⌘/Ctrl + Enter runs the cell
Diagonalisation
Put the eigenvectors side by side as the columns of a matrix P. Put the eigenvalues, in the same order, on the diagonal of Λ (capital lambda):
P=(231−1)Λ=(400−1)
Column j of AP is Avj=λjvj, and so is column j of PΛ. So AP=PΛ. When P has an inverse, multiplying both sides by P−1 on the right gives the factorisation.
Rule: Diagonalisation
A=PΛP−1
P holds the eigenvectors as columns and Λ the eigenvalues on its diagonal, in the same order. It works exactly when A has n independent eigenvectors, so that P has an inverse; A is then called diagonalisable. A matrix with n different eigenvalues always is.
Read the product from right to left, as in lesson 3.2.2. P−1 finds the coordinates of x along the eigenvectors, Λ multiplies each coordinate by its eigenvalue, and P builds the vector back.
P has ad−bc=−2−3=−5, so the formula of lesson 3.2.3 gives
P−1=−51(−1−3−12)=(0.20.60.2−0.4)
and P−1(4,1)=(1,2): the coordinates found above.
P is not the only choice. Any nonzero multiples of the eigenvectors work, such as (1,1.5) for (2,3), and so does another order, as long as Λ follows it.
Try it
The cell checks AP=PΛ exactly, then PΛP−1=A with np.allclose, because P−1 is computed in decimals.
The last line uses P−1 to find the coordinates of (4,1).
⌘/Ctrl + Enter runs the cell
Matrix powers
Squaring the factorisation, the P−1P in the middle is I and drops out:
A2=PΛP−1PΛP−1=PΛ2P−1
Every further factor does the same, so only Λ is raised to the power. A power of a diagonal matrix is just the powers of its diagonal entries.
Rule: Powers of a diagonalisable matrix
Ak=PΛkP−1Λk=(λ1k00λ2k)
Ak has the same eigenvectors as A, and eigenvalues λ1k and λ2k. If no eigenvalue is 0, the inverse works the same way: A−1=PΛ−1P−1.
For k=5, Λ5 has the diagonal 45=1024 and (−1)5=−1:
PΛ5=(20483072−11)A5=PΛ5P−1=(409615410614)
For k=10 the work is the same: two numbers to raise, two products to form. The answer is (419431629145419430629146), which nine multiplications by A confirm.
The inverse has eigenvalues 41 and −1, and PΛ−1P−1=(−0.50.750.5−0.25), the same as np.linalg.inv(A).
Try it
For k=5 and k=10, the cell builds Λk from the two powers with np.diag, prints PΛkP−1, then matrix_power for comparison.
The last line compares PΛ−1P−1 with np.linalg.inv(A).
⌘/Ctrl + Enter runs the cell
The largest eigenvalue takes over
In Akx=4kv1+2(−1)kv2, the first part grows four times at each step while the second keeps its size. Divide by 4k:
k
0
1
2
3
4
5
Akx/4k
(4,1)
(1.5,3.5)
(2.125,2.875)
(1.9688,3.0312)
(2.0078,2.9922)
(1.998,3.002)
The rows close in on v1=(2,3), from alternate sides because λ2 is negative. What is left of v2 is 2(−41)kv2, a quarter of its size at each step.
Rule: The dominant eigenvalue
Akx≈c1λ1kv1when ∣λ1∣>∣λ2∣
For large k, the eigenvalue of largest size wins, as long as c1=0. The rest shrinks like ∣λ2/λ1∣k. In the long run Akx grows if ∣λ1∣>1, settles if λ1=1, and dies away if ∣λ1∣<1.
Try it
Each line divides Akx by 4k, rounded to 4 places, then prints the part left over from v2, which is 2(−41)kv2.
⌘/Ctrl + Enter runs the cell
Two towns that swap people
Each year 10% of the people in town A move to town B, and 20% of those in town B move to town A. Write s=(sA,sB) for the shares of the people living in each town, so sA+sB=1.
Next year A keeps 90% of its own and gains 20% of B's: 0.9sA+0.2sB. B gets the rest: 0.1sA+0.8sB. So each year multiplies s by
M=(0.90.10.20.8)
Column j says where the people of town j go. Each column adds up to 1, so nobody is lost and the shares still add up to 1.
M has trace 1.7 and determinant 0.72−0.02=0.7. Its polynomial is λ2−1.7λ+0.7=(λ−1)(λ−0.7), so the eigenvalues are 1 and 0.7.
λ1=1: the shortcut of lesson 3.6.1 gives (0.2,0.1), or as shares, (32,31). Here Ms=s: a steady state that stays put year after year.
λ2=0.7: the eigenvector (1,−1) moves people from one town to the other. It shrinks by 0.7 each year.
Start from s0=(0.5,0.5), which is (32,31)−61(1,−1). After k years the shares are
sk=(32,31)−61(0.7)k(1,−1)
After 10 years, 0.710≈0.0282 and s10≈(0.662,0.338). The gap to the steady state is multiplied by 0.7 each year, so it halves about every two years, since 0.72=0.49.
From any start, the share in town A settles on 32, the eigenvector of λ=1. On a log scale the gaps are straight lines: each year multiplies them by the other eigenvalue, 0.7.
Lesson 5.11.2 reads such shares as probabilities: M becomes a Markov chain, and the eigenvector of λ=1 its long-run distribution.
Try it
The loop moves the shares forward one year at a time and prints some years. V[:, 0] / V[:, 0].sum() scales the eigenvector of λ=1 so its entries add up to 1, which also fixes its sign.
The last line is the formula for s10.
⌘/Ctrl + Enter runs the cell
When a matrix cannot be diagonalised
The shear H=(1011) has the eigenvalue 1 twice, and only one eigenvector line, the x1-axis (lesson 3.6.1). Any two of its eigenvectors lie on that line, so a matrix P built from them is singular. H is not diagonalisable.
Its powers show it. Three shears make a shear by 3 (lesson 3.2.2), and in general Hk=(10k1). The corner grows by 1 at every step, which no power of the eigenvalue 1 can produce.
A repeated eigenvalue alone is not the problem. 2I also has one eigenvalue twice, and it is already diagonal. What matters is whether there are n independent eigenvectors.
Complex eigenvalues are another matter. The quarter turn R has eigenvalues i and −i, and it can be diagonalised with complex numbers, which is what eig does. For example R4=I, matching i4=1 (lesson 1.7.2).
Try it
eig returns two eigenvector columns for H, but with signs fixed both are (1,0). The determinant of that P is 0 up to rounding, so the cell compares it with 10−12 rather than printing it.
Then come H2, H3 and H10, and R4=I.
⌘/Ctrl + Enter runs the cell
The power method
The dominant eigenvalue gives a way to find it without the characteristic polynomial. Multiply a starting vector by A again and again: its direction settles on v1. Rescale it to length 1 at every step, so the numbers neither explode nor vanish.
To read off λ1, use the dot product x⋅(Ax) for the current unit vector x. If x were exactly a unit eigenvector, this would be x⋅λ1x=λ1.
Rule: The power method
x←∥Ax∥Axλ1≈x⋅(Ax)
Repeat until the estimate stops changing. The error shrinks like ∣λ2/λ1∣k, so it is fast when λ1 is far ahead and slow when λ2 is close behind.
From (1,0), the estimates for A run 3.4, 4.0462, 3.9804, 4.0044, 3.9989, … The error falls about four times at each step, since ∣λ2/λ1∣=41. After 8 steps x≈(0.5547,0.832), which is (2,3) scaled to length 1.
The method fails in two cases:
No single winner. If ∣λ1∣=∣λ2∣, as for the reflection (100−1) or any turn, the direction never settles.
A start with c1=0. From (1,−1), A only flips the vector, and the method finds λ2=−1. A random start almost never has c1=0 exactly.
NumPy's eig uses a refined descendant of this idea, the QR algorithm. The power method itself is used for very large matrices when only the top eigenvalue is needed. Practice set 3.6.4 asks you to write it.
Try it
Each step multiplies by A and rescales. The line prints the step, x, the estimate of λ1, and its distance from 4.
⌘/Ctrl + Enter runs the cell
Common mistakes
Match the order. Column j of P must be the eigenvector of the j-th diagonal entry of Λ.
PΛP−1, not P−1ΛP. Reading right to left, P−1 acts first and finds the eigenvector coordinates.
A matrix power is not a power of each entry.A**3 in NumPy cubes every entry. Use np.linalg.matrix_power(A, 3) or A @ A @ A.
Size decides who wins. With eigenvalues −5 and 3, the −5 takes over, and Akx flips direction at every step.
A repeated eigenvalue does not settle the question.2I is diagonalisable and the shear is not: count the independent eigenvectors.
The power method needs a clear winner and a start with some part along v1.
Diagonalisation and matrix powers
0 of 12 correct
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
How to type answers
Powers with ^: x^7, 2^(1/3), a^-2.
Multiply with * or by writing side by side: 3x^2, 2(x+1).
ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
Your first answer to each question is saved: it counts towards your score and brings the question back for review.
Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.
Summary card
Write x=c1v1+c2v2 in the eigenvector basis; then Akx=c1λ1kv1+c2λ2kv2.
A=PΛP−1, with the eigenvectors as the columns of P and the eigenvalues on the diagonal of Λ, in the same order. It needs n independent eigenvectors; n different eigenvalues guarantee them.
Ak=PΛkP−1: raise only the eigenvalues. Ak has eigenvalues λk, so trAk=λ1k+λ2k.
The eigenvalue of largest size takes over, and the rest shrinks like ∣λ2/λ1∣k. With λ1=1, the shares settle on its eigenvector, the steady state.
The shear has one eigenvector line and is not diagonalisable: Hk=(10k1).
The power method: x←Ax/∥Ax∥, λ1≈x⋅(Ax). It needs ∣λ1∣>∣λ2∣.