Week 4 · The special directions of a matrix
Read the words of the video
- Imagine stretching a rubber sheet with arrows drawn on it. Most arrows twist and turn, pointing to new places after the stretch.
- But a few special arrows only get longer or shorter, still pointing exactly the same way. These are called eigenvectors.
- How much each special arrow grows or shrinks along its path is its eigenvalue. This number tells us the exact stretch factor.
- Mathematically, applying a matrix 'A' to an eigenvector 'v' just scales 'v' by a number, lambda. The direction stays the same!
- To find these special stretch numbers, we solve an equation: the determinant of the matrix minus lambda times the identity matrix must be zero.
- For a two-by-two matrix, there's a neat shortcut! The sum of the eigenvalues is the trace, and their product equals the determinant.
- For example, if the sum of two numbers is seven and their product is ten, the numbers are easily found as two and five by a simple quadratic equation.
- If you know a matrix's eigenvalues, you can quickly find eigenvalues for its inverse, powers, or when a constant is added.
- If a matrix has a zero eigenvalue, it squashes space flat and cannot be reversed or 'un-squashed.' It is not invertible.
- When we have enough independent eigenvectors, we can rewrite the matrix in a special way to easily calculate high powers, saving huge effort.
- Beware of common traps! Inverse eigenvalues are reciprocals, not negatives. Also, a repeated eigenvalue does not always mean a matrix cannot be diagonalized.
- So, eigenvectors show special directions, and eigenvalues show how much things stretch. Together, they simplify complex matrix operations and transformations.
The one-minute story
Take a rubber sheet with a grid drawn on it and stretch it: pull it wider in one direction, squeeze it in another, maybe shear it. Now draw many arrows on the sheet before the stretch.
After the stretch, almost every arrow has been turned to point somewhere new. But a few special arrows only get longer or shorter, still pointing exactly the way they did (or exactly backwards). Those lucky arrows are the eigenvectors of the stretch. By how much each one grew or shrank is its eigenvalue.
Why care? Because along its special directions a complicated matrix behaves like plain multiplication by a number. Learn the special directions and the matrix stops being scary. Everything in PCA (MLF week 6, MLT week 1) is "find the special directions of the data".
By the end of this week you can:
- say what an eigenvalue and eigenvector are, and find them for matrices;
- use the trace and determinant shortcuts to get eigenvalues quickly;
- find eigenvalues of , , and without recomputing;
- decide when a matrix is diagonalisable and use to compute powers.
Words you need
- Eigenvector - a non-zero vector whose direction does not change.
- Eigenvalue - the stretch factor of that eigenvector: .
- Characteristic equation - ; its roots are the eigenvalues.
- Trace - the sum of the diagonal entries of a matrix.
- Determinant - a single number that says how a matrix scales area (or volume); zero means it squashes space flat.
- Diagonal matrix - zeros everywhere except the diagonal. Easy to multiply and raise to powers.
- Diagonalisable - can be rewritten as with diagonal.
Idea 1: The definition
Read it aloud: " applied to gives the same arrow, just scaled by ." We insist because the zero vector satisfies this for every and tells us nothing.
- : stretched. : shrunk. : flipped to point the opposite way. : squashed to nothing.
How to find them
Rewrite as . A non-zero can only be sent to zero if squashes space flat, i.e. its determinant is zero:
For a matrix this becomes a short quadratic with two handy facts:
The two free facts (true for every square matrix):
- sum of eigenvalues trace of
- product of eigenvalues determinant of
Use them to find a missing eigenvalue in seconds, or to sanity-check yours.
Question. Find the eigenvalues and eigenvectors of .
Solution.
- Trace , determinant . The equation is , which factorises as . So , .
- For : . Solving : , so . Take .
- For : . Then , so . Take .
- Check: and .
Any non-zero multiple of an eigenvector is also an eigenvector, so works just as well as .
Idea 2: Shortcuts that save marks
If , then, with the same eigenvector :
| Matrix | Its eigenvalue |
|---|---|
| (if it exists) | |
| the same (eigenvectors may change) | |
| for a polynomial |
Two more:
- Triangular and diagonal matrices: the eigenvalues are simply the diagonal entries.
- is invertible no eigenvalue is 0 . Because , a single zero eigenvalue makes the determinant zero.
(a) A matrix has trace 3 and determinant 2. Find its eigenvalues.
Solve : , so .
(b) The eigenvalues of a matrix are . Find .
The eigenvalues of are . Transposing does not change eigenvalues. The determinant is the product: .
(c) A matrix has eigenvalues . Find , and the eigenvalues of .
Trace . Determinant . For use : .
The last one shows is singular, because one eigenvalue is 0.
Idea 3: When eigenvalues are complex, repeated, or not enough
Complex eigenvalues. A rotation by , , turns every arrow, so no real arrow stays on its line. Its characteristic equation gives . Real matrices can have complex eigenvalues; real symmetric matrices cannot (week 5).
Repeated eigenvalues. The number of times appears as a root is its algebraic multiplicity. The number of independent eigenvectors it has is its geometric multiplicity, which is never bigger.
Diagonalisable means you can find enough eigenvectors: independent ones for an matrix. Then, with and :
Eigenvectors for different eigenvalues are always independent. Trouble only arises with repeated eigenvalues.
"The eigenvalue is repeated, so it is not diagonalisable" is wrong. So is "...so it is diagonalisable".
- The identity matrix has eigenvalue 1 twice and is already diagonal. Diagonalisable.
- The shear has eigenvalue 1 twice, but only has one independent eigenvector . Not diagonalisable.
A repeated eigenvalue by itself tells you nothing about diagonalisability. Check how many independent eigenvectors it has.
Question. For from Example 1, compute .
Solution. (columns are the eigenvectors), . Then and .
Check by brute force: , and . ✓. For the shortcut would be effortless while brute force would be hopeless: just replace and with and .
Question. Is diagonalisable?
Solution. It is triangular, so the eigenvalues are the diagonal entries: and (repeated). Solve : gives , so the only eigenvectors are multiples of . We need two independent eigenvectors and have only one. Not diagonalisable.
Your turn
Find the eigenvalues of and of .
Need a hint?
Both are triangular.
Show the full solution
Read off the diagonals: and .
A matrix has eigenvalues . Find: (a) (b) trace (c) eigenvalues of (d) eigenvalues of (e) is invertible?
Need a hint?
Sum and product give trace and determinant. Then apply each function to each eigenvalue.
Show the full solution
(a) . (b) . (c) . (d) . (e) Yes, because no eigenvalue is 0.
Find the eigenvalues and eigenvectors of . What do you notice about the eigenvectors?
Need a hint?
Trace 2, determinant .
Show the full solution
, so . For : gives . For : gives . They are perpendicular (). That is no accident: it is the spectral theorem of week 5.
A matrix has trace 6, determinant 6, and one eigenvalue equal to 1. Find the other two.
Need a hint?
The other two, call them , satisfy and .
Show the full solution
and , so they are the roots of : and . The eigenvalues are .
Without computing, can have real eigenvalues?
Need a hint?
Find .
Show the full solution
Trace , determinant . The equation has . No real eigenvalues: this matrix turns every real arrow.
Exam radar
Eigenvalues and eigenvectors appear in 20 of the 53 MLF Quiz 1 papers and in 29 of the 30 Quiz 2 papers that have a concept summary and in nearly every End Term. Diagonalisation appears in 7 Quiz 1 and 6 Quiz 2 papers.
Past End Terms keep returning to: the trace 3, determinant 2 puzzle (8 times), from eigenvalues with answer 8 (7 times), eigenvalues of and of powers of , and properties of symmetric and positive definite matrices (next week).
- Eigenvalues of are reciprocals, not negatives.
- Eigenvalues of shift by ; they do not multiply by anything.
- Product of eigenvalues is the determinant, sum is the trace. Do not swap.
- and share eigenvalues, but not necessarily eigenvectors.
- "Repeated eigenvalue" does not decide diagonalisability.
Quick quiz
A 2 by 2 matrix has trace 5 and determinant 6. Its eigenvalues are...
- 1 and 6
- 2 and 3
- 5 and 6
- 3 and 3
A has eigenvalues 2 and 5. The eigenvalues of A inverse are...
- -2 and -5
- 1/2 and 1/5
- 2 and 5
- 4 and 25
Which matrix is NOT diagonalisable?
- the identity matrix
- [[1, 1], [0, 1]]
- [[2, 0], [0, 3]]
- [[1, 2], [2, 1]]
Select all that are TRUE. (select all that apply)
- The sum of the eigenvalues equals the trace.
- A matrix with a zero eigenvalue is not invertible.
- Eigenvectors for different eigenvalues are always perpendicular.
- A repeated eigenvalue means the matrix cannot be diagonalised.
Recap
- : along special directions the matrix only stretches. Find from , then from .
- , . Triangular matrix: eigenvalues are the diagonal.
- , , , same . Invertible no zero eigenvalue.
- Diagonalisable independent eigenvectors; then and . Repeated eigenvalues alone decide nothing.
- ,
- :
- ,
- ; ; ;
- ,
- MLT week 1 - PCA: finding the best view of your data: Principal components ARE eigenvectors of the covariance matrix.
- MLT week 2 - Kernel PCA: curved views of data: Kernel PCA is eigen-analysis of a kernel matrix.
Practise with real exam questions
These come straight from past papers (with the real figures and the official answer key). Open 55 real questions on this week All Quiz 1 papers