Linear transformations and diagonalisation — exam-style exercises with a filter that wipes out greys, powers with two eigenvalues and a parameter that decides everything (and the P that did not match its D)
In the class mock exam on this topic I diagonalised a 3 × 3 matrix correctly and still lost half a point: I had put the eigenvectors in one order and the eigenvalues in another. Every calculation was right; and just did not go together, so did not give my . If I had checked with a single column, I would have seen it in ten seconds. That slip is the first snippet in «What is wrong here?».
Table of Contents
How to use this article
First of all, how this counts in the AG exam. The exam mark is : is a 20-question test taken from the Campus quizzes and is written exercises. If , the final mark is (the quizzes and the lab assignments, up to 1.5 points each); otherwise, the final mark is . The sums are done for you in the AG grade calculator.
This topic carries the most weight in the written part: in recent years’ exams there is always an exercise on an endomorphism with a parameter, with kernel and image, diagonalisation depending on the parameter and a power . So here you have exercises in the format of an exam question (with points and marking criteria), the last one exactly as it appears, and a 20-question quiz like the Campus one for the T part.
- Do each exercise on paper, without a calculator, with every system row reduced and every rank justified.
- Compare with the expected result and, if it does not match, open the hint before looking at the solution.
- Read «What is wrong here?» trying to find the mistake yourself before reading the explanation.
- Take the quiz at the end and check everything in MATLAB.
- If you get stuck on method, go back to the guided practice, which has the same kinds of problem solved step by step.
If you want to see what the 2 × 2 matrices in these exercises do, the Plane transformations simulator deforms the grid with the matrix you type, marks the directions that do not turn and shows you step by step.
Exercise 1 (basic level): the filter that wipes out greys
Exercise 1. [3 points] An «edges» filter turns each colour into two numbers: . a) (1 point) Write the associated matrix in the standard bases and compute . b) (1 point) Compute a basis and the dimension of and of . c) (1 point) Is it injective? Surjective? Compute the preimage of .
Expected result: is ; ; the kernel is the line of greys, with basis ; the image is the whole of ; surjective yes, injective no; the preimage of is a line through .
Before computing anything, look at the dimensions: . Can it be injective? And for the kernel, think about which colours have and at the same time.
Exercise 2 (intermediate level): two eigenvalues and their powers
Exercise 2. [4 points] Let the endomorphism of be . a) (1 point) Compute its eigenvalues and a basis of each eigenspace. b) (1 point) Justify that it is diagonalisable and give and . c) (1 point) Compute the matrix of in the basis with and explain the result. d) (1 point) Compute and check the formula with .
Expected result: eigenvalues 2 and 3, with eigenvectors and ; is diagonal; .
Two distinct real eigenvalues in a 2 × 2 matrix are enough to diagonalise, without computing any multiplicity. In c), look at which vectors make up before multiplying.
Exercise 3 (challenge): this is how it appears in the exam
Exercise 3. [10 points] Let be given by , with . a) (3 points) Depending on the values of , compute a basis and the dimension of and of , and justify whether is bijective. b) (4 points) Study for which values of the matrix of in the standard basis is diagonalisable over . c) (3 points) For the value of found in b), compute , and .
Expected result: the eigenvalues are 0 (double) and 2 for every ; is never bijective; the kernel has dimension 1 if and 2 if ; is diagonalisable only if , and then .
The eigenvalue 0 is directly related to the kernel: . As soon as you have a) done, half of b) is too. And for c), if comes out with all its numbers equal to , look at again.
What is wrong here?
Three classmates’ solutions with one mistake each. Read the solution, try to find the flaw and then read the explanation.
Snippet 1: the P that did not match its D
A = | 2 1 1 | eigenvalues: 1 (double) and 4
| 1 2 1 | U1 = <(-1,1,0), (-1,0,1)> U4 = <(1,1,1)>
| 1 1 2 |
P = | 1 -1 -1 | D = | 1 0 0 |
| 1 1 0 | | 0 1 0 |
| 1 0 1 | | 0 0 4 |
Predict: does this satisfy ?
No. In , the first column is , the eigenvector of , but in the first number is a 1. Checking that column is enough: , while the first column of is . The eigenvectors and eigenvalues are correct; what fails is the order. With this , the right is .
Building and separately. First write the list of pairs (eigenvector, eigenvalue) and copy each pair at once: the vector in column of and its eigenvalue in position of .
The check is done column by column and needs no : times column of must be the number times that same column.
Snippet 2: real, therefore diagonalisable
A = | 2 1 0 |
| 0 2 0 | |A - λI| = (2 - λ)^2 (3 - λ)
| 0 0 3 |
Eigenvalues: 2, 2 and 3. They are all real, so A is diagonalisable
and D = diag(2, 2, 3).
Predict: is it diagonalisable?
No. All eigenvalues being real is only the first condition. The second one is still missing for the double eigenvalue:
The eigenvalue 2 has only one direction of eigenvectors, . The corner is a shear like the one in the theory. There is no basis of eigenvectors, so it is not diagonalisable and that does not exist.
Stopping at the first condition. The Campus quizzes often ask about this with an option like «all eigenvalues are real» marked as sufficient: it is not. The full condition is «real and with for every one».
Snippet 3: the change of basis turned around
f(x, y) = (x + 2y, 3y) A = | 1 2 | B' = {(1, 0), (1, 1)}
| 0 3 |
C = | 1 1 | C^-1 = | 1 -1 |
| 0 1 | | 0 1 |
A' = C · A · C^-1 = | 1 1 | | 1 2 | | 1 -1 | = | 1 5 | | 1 -1 | = | 1 4 |
| 0 1 | | 0 3 | | 0 1 | | 0 3 | | 0 1 | | 0 3 |
Predict: is that the matrix of in ?
No: with going from to the standard basis (the vectors of in columns), the formula is . The arithmetic in the solution is right, but it is the wrong product. The correct one:
Diagonal! That was a clue something was off: is exactly the eigenvectors of (), so in that basis had to come out diagonal. The check with the definition confirms it: , coordinates , which is the second column of the right one.
Memorising «, , » without knowing what is. Ask yourself what each matrix does to a vector of new coordinates, right to left: first go to the old basis (), then apply , then come back to the new one ().
Solutions
Exercise 1
Before the working, the plan. All three parts come from the matrix : is a product, the rank gives the dimensions in b) and the preimage in c) is a system. That’s why it’s worth making sure of it.
There are two ways to write it, and it pays to know both, because each one checks the other:
- By rows: each output coordinate is a row with its coefficients. gives the row and gives .
- By columns: column is the image of basis vector . , and : exactly the three columns below.
Writing the coefficients of as a column. You get a matrix, and that alone tells you it’s wrong: it has to take in colours of three numbers and give back two.
a) The coefficients in rows (one row per output coordinate):
It is : three columns because it starts in , two rows because it lands in . And .
b) is already in echelon form and has two pivots: . So and .
Kernel: and , that is, . With free:
These are the greys: the edges filter turns all of them into , because a grey has no differences between channels.
Image: a subspace of of dimension 2, so it is the whole of . A basis: the pivot columns, , or the standard one.
For c), the obvious route would be to go to the definition (are there two different colours with the same image?) and look for an example. No need: b) already answers it.
- Injective means kernel equal to . Here it’s a line: and both give .
- Surjective means image equal to the whole target space. Dimension 2 inside : yes.
The preimage of is every colour the filter turns into : the kernel’s system, with on the right instead of zeros. That’s why it comes out with the same shape as the kernel (one parameter), just shifted:
| Step | Equation | What you get | Why |
|---|---|---|---|
| 1 | has no pivot: it’s the free variable, as in the kernel | ||
| 2 | Solved from the bottom up | ||
| 3 | With already known |
c) It is not injective (); it is surjective (). The preimage of : and . With : , :
A particular solution plus the kernel, as always. Check: .
Why it is done this way: in b), the rank first gives both dimensions without solving anything, and it acts as a check: the kernel must come out with a single parameter. In c), writing the preimage as «particular + kernel» shows you understand where it comes from.
How it is marked (rough split, mine, not the official one):
| Part | What is assessed | Points |
|---|---|---|
| a) | matrix laid out correctly | 0.5 |
| a) | 0.5 | |
| b) | Rank and both dimensions | 0.25 |
| b) | Kernel basis | 0.5 |
| b) | Image basis | 0.25 |
| c) | Injective and surjective, justified | 0.5 |
| c) | Preimage of | 0.5 |
Exercise 2
a) With :
Eigenvalues 2 and 3 (check: , ).
Now the eigenvectors. The plan is always the same: for each eigenvalue, solve . And before solving there’s a free check: since exactly at the eigenvalues, the two rows of must be proportional. With , is twice ; with , both rows are . That’s why each one gives a single equation.
The rows don’t come out proportional and you carry on anyway. Then the system only has the solution , and zero is not an eigenvector. If it happens to you, the mistake is earlier: in the polynomial or when subtracting on the diagonal.
- : , equation . .
- : , equation . .
b) Two distinct real eigenvalues in dimension 2: both are simple, for each. Diagonalisable:
c) is the eigenvectors, in the same order: . So . Doing the sums, with and :
It comes out diagonal because in the eigenvector basis only stretches: by 2 and by 3.
For d), the obvious route would be to multiply: , … and look for a pattern. None shows up, and the exam asks for a formula for any . Diagonalisation fixes this for two reasons:
- Powers of a diagonal matrix are done entry by entry: has and on the diagonal, with no multiplying at all.
- When you multiply by itself, the in the middle cancels: , and the same for any .
So the plan is: , then , then in front. You already have from c), because .
Check you’ve got it: what does the formula for A^n give with n = 3?
, the same as multiplying.
Step by step: and . Top row, and . Bottom row, and . It’s a better check than : if you write instead of , with both are 4 and you don’t notice; with , 64 and 16.
d) . First (row 1 times , row 2 times ):
With : . Correct.
Why it is done this way: in c) the point is to recognise that is the eigenvectors; whoever sees it writes with no calculation (and does the sums only to check). In d), multiplying first is easier than , because multiplies whole rows.
How it is marked (rough split, mine, not the official one):
| Part | What is assessed | Points |
|---|---|---|
| a) | Polynomial and eigenvalues | 0.5 |
| a) | Both eigenvectors | 0.5 |
| b) | Justification (distinct ⇒ diagonalisable) and , matching | 1 |
| c) | and the explanation of why it is diagonal | 1 |
| d) | multiplied correctly | 0.75 |
| d) | Check with | 0.25 |
Exercise 3
a) The third column is zero, so for every : is never bijective. The rank, row reducing ():
- If : two non-zero rows, . , . Kernel: and , so , and free: . Image: columns 1 and 2 of , (or, subtracting them, ).
- If : one non-zero row, . , . Kernel: , with free: . Image: .
For b), what you need to decide before the working is how to get the eigenvalues without getting into everything.
The obvious route would be Sarrus: six products to check one by one, with inside. But the third column of is : expanding along it leaves a single term, and when you cross out row 3 for its minor, goes with it. That’s why the eigenvalues don’t depend on : can only change the eigenspaces.
After that, only one eigenvalue matters:
- is simple, so : it’s 1 for sure, with no working.
- is double, and can be 1 or 2. Since , , and you already have that rank from a).
Check you’ve got it: why don’t you need the eigenspace of 2 in b)?
Because 2 is a simple eigenvalue, and the eigenspace of a simple eigenvalue always has dimension 1.
Step by step: that dimension lies between 1 (every eigenvalue has at least one eigenvector) and the multiplicity, which is 1. Only a repeated eigenvalue can stop you diagonalising. The eigenspace of 2 is needed in c), to build .
b) Expanding along the third column (only remains, in position ):
Eigenvalues , double, and , simple, real and free of . The simple one has . For , and its eigenspace is the kernel from a):
- If : . Not diagonalisable.
- If : . Diagonalisable.
c) With , . We already have the basis of from a). For :
For , : only the third row of survives, multiplied by :
It makes sense: (check it: ), so each multiplication by just doubles. With , .
Why it is done this way: the idea that saves half the exercise is that . If you do not see it, you solve the same system twice. And in c) it is better to give for : with , and .
How it is marked (rough split, mine, not the official one):
| Part | What is assessed | Points |
|---|---|---|
| a) | : never bijective | 0.5 |
| a) | Rank depending on , justified | 1 |
| a) | Bases and dimensions in both cases | 1.5 |
| b) | Characteristic polynomial and eigenvalues | 1.5 |
| b) | depending on (via the kernel or the rank) | 1.5 |
| b) | Conclusion: only | 1 |
| c) | , matching and | 1.5 |
| c) | 1.5 |
Check it in MATLAB
This script checks all three exercises. Run it after doing them on paper:
format rat %% Exercise 1 A1 = [1 -1 0; 0 1 -1]; A1*[5; 2; 1] % (3, 1) rank(A1), null(A1, 'r') % rank 2; kernel: the greys rref([A1 [1; 1]]) % preimage of (1, 1) %% Exercise 2 A2 = [4 -2; 1 1]; eig(A2) % 3 and 2 (MATLAB's order) P2 = [1 2; 1 1]; inv(P2)*A2*P2 % diagonal: c) A2^4 % the formula with n = 4 %% Exercise 3 syms k A3 = [1 1 0; 1 1 0; 0 k 0]; rank(subs(A3, k, 5)), rank(subs(A3, k, 0)) A30 = [1 1 0; 1 1 0; 0 0 0]; A30^6 - 2^5*A30 % zeros: A^n = 2^(n-1) A
Output:
ans =
3
1
ans =
2
ans =
1
1
1
ans =
1 0 -1 2
0 1 -1 1
ans =
3
2
ans =
2 0
0 3
ans =
146 -130
65 -49
ans =
2
ans =
1
ans =
0 0 0
0 0 0
0 0 0
In exercise 1, rref([A1 [1; 1]]) leaves free: the last column gives the solution with , . In exercise 2, the formula with gives , , and : the same as A2^4. And in exercise 3, the two ranks (2 with , 1 with ) are the two cases of part a).
Exam-style quiz
These 20 questions are like the ones in the Campus quiz on linear transformations and diagonalisation: true or false, single answer, multiple answers, matching and gap-fill, almost all theoretical and a few with a short calculation. They are original and part of the AG mock exam bank. The rules are those of the exam test: no negative marking, except in multiple-answer questions, where each wrong option ticked cancels a right one. Allow about 15 minutes and repeat it as many times as you like.
Say whether each map from to is linear:
Solution
- T —
- F —
- F —
- T —
A linear map only has, in each coordinate, sums of coordinates multiplied by numbers. sends to , and a linear map always sends zero to zero. is a product of coordinates: . The last one is linear even though it has a 0: the 0 is «0 times the coordinates».
The matrix in the standard bases of a linear map has size:
- 2 × 4
- 4 × 2
- 4 × 4
- 2 × 2
Solution
Answer: 2 × 4
Each column is the image of a basis vector of (4 columns), written with its 2 coordinates in (2 rows): .
Let . The image of is:
- (−2, 7)
- (−2, 5)
- (1, 7)
- (−2, 7, 0)
Solution
Answer: (−2, 7)
Substitute: .
Match each concept with its definition:
| Kernel | |
| Image | |
| Preimage of w | |
| Eigenspace |
Definitions:
- Eigenvectors of the same eigenvalue, together with 0
- Vectors of the initial space whose image is the zero vector
- Vectors of the initial space that land on w
- Vectors of the final space that are the image of some vector
- Vectors whose length does not change
Solution
- Kernel → Vectors of the initial space whose image is the zero vector
- Image → Vectors of the final space that are the image of some vector
- Preimage of w → Vectors of the initial space that land on w
- Eigenspace → Eigenvectors of the same eigenvalue, together with 0
The kernel is the preimage of the zero vector and lives in the initial space; the image lives in the final one. The eigenspace of is . «Vectors whose length does not change» is none of these concepts.
A linear map has . What is ?
- 2
- 0
- 3
- 5
Solution
Answer: 2
By the dimension formula, : , so . It uses the dimension of the initial space.
Let be linear with matrix of size . Tick the correct statements:
- is injective if and only if
- is surjective if and only if
- If , is bijective
- If , cannot be injective
Solution
Answer: is injective if and only if · is surjective if and only if · If , cannot be injective
Injective is equivalent to a trivial kernel, that is, (columns). Surjective, to the image filling : (rows). A square matrix can have determinant 0. And with more columns than rows, the rank cannot reach and the kernel is not trivial.
Fill in the gaps:
The kernel of a linear map is a subspace of the ____ space and the image is a subspace of the ____ space.
Words:
- eigen
- initial
- dual
- final
Solution
The kernel of a linear map is a subspace of the initial space and the image is a subspace of the final space.
The kernel is made of vectors of (those going to ) and the image of vectors of (those coming out of ).
If is the matrix of an endomorphism of , then:
- It is neither injective nor surjective
- It is injective but not surjective
- It is bijective
- It is surjective but not injective
Solution
Answer: It is neither injective nor surjective
Row 2 is twice row 1, so . In an endomorphism, all three properties depend on the same thing: either full rank (bijective) or none of them.
Fill in the gaps:
Two square matrices and that represent the same endomorphism in different bases are called ____, and they satisfy .
Words:
- congruent
- row-equivalent
- similar
Solution
Two square matrices and that represent the same endomorphism in different bases are called similar, and they satisfy .
Similar: . «Congruent» is a different relation, , the one for bilinear forms in topic 6.
About eigenvalues and eigenvectors of a square matrix :
- The zero vector is an eigenvector of every eigenvalue.
- An eigenvalue can be 0.
- If is an eigenvector, so is .
- has no inverse if and only if 0 is an eigenvalue of .
Solution
- F — The zero vector is an eigenvector of every eigenvalue.
- T — An eigenvalue can be 0.
- T — If is an eigenvector, so is .
- T — has no inverse if and only if 0 is an eigenvalue of .
By definition, an eigenvector is different from . The eigenvalue can be 0: then and lies in the kernel, so . Non-zero multiples of an eigenvector are eigenvectors of the same eigenvalue.
The eigenvalues of are:
- 5 and −1
- 5 and 2
- 4 and 0
- 7 and −3
Solution
Answer: 5 and −1
In a triangular matrix, : the eigenvalues are the numbers on the diagonal. Check: .
A matrix has characteristic polynomial and . What is the geometric multiplicity of ?
- 1
- 2
- 0
- 3
Solution
Answer: 1
. Since , that matrix is not diagonalisable.
A real matrix of size is diagonalisable over if (tick the conditions that, on their own, guarantee it):
- It has distinct real eigenvalues
- All its eigenvalues are real and, for each one, the algebraic multiplicity equals the geometric one
- It is symmetric
- Its determinant is non-zero
- All its eigenvalues are real
Solution
Answer: It has distinct real eigenvalues · All its eigenvalues are real and, for each one, the algebraic multiplicity equals the geometric one · It is symmetric
The full condition is «real and for all». With distinct eigenvalues it certainly holds, and every real symmetric matrix is diagonalisable too. «All real» is only the first half: some Campus quizzes present it as sufficient, but it is not.
If with diagonal:
- The columns of are eigenvectors of .
- The numbers on the diagonal of are the eigenvalues of .
- The rows of are eigenvectors of .
- The eigenvector in column of goes with the eigenvalue in position of .
Solution
- T — The columns of are eigenvectors of .
- T — The numbers on the diagonal of are the eigenvalues of .
- F — The rows of are eigenvectors of .
- T — The eigenvector in column of goes with the eigenvalue in position of .
From , each column of satisfies . That is why they go in columns and in the same order as the diagonal of .
If with , then is:
Solution
Answer:
and .
About similar matrices and :
- They have the same determinant.
- They have the same eigenvalues.
- They have the same trace.
- They have the same eigenvectors.
Solution
- T — They have the same determinant.
- T — They have the same eigenvalues.
- T — They have the same trace.
- F — They have the same eigenvectors.
Determinant, trace, rank and eigenvalues do not depend on the basis. Eigenvectors do: works with coordinates in another basis, so its eigenvectors are those of written in that basis, .
The kernel of is:
Solution
Answer:
Solve , : and . With , . Check: .
Fill in the gaps:
If with , we say that is an ____ of and that is an associated ____.
Words:
- determinant
- eigenvector
- eigenvalue
- pivot
Solution
If with , we say that is an eigenvalue of and that is an associated eigenvector.
That is the definition: the eigenvector keeps its direction and the eigenvalue is the factor it is multiplied by.
The matrix of the 90° rotation in the plane, :
- Is not diagonalisable over because it has no real eigenvalues
- Is diagonalisable because it is invertible
- Is not diagonalisable because it has a double eigenvalue with a single eigenvector
- Is diagonalisable with
Solution
Answer: Is not diagonalisable over because it has no real eigenvalues
Its characteristic polynomial is , with no real roots: no direction stays on its line when rotated by 90°. The first condition fails.
The matrix of in the basis is:
Solution
Answer:
The columns of are the coordinates in of the images of the vectors of . , which is ; . Both are eigenvectors, which is why it comes out diagonal.
What next?
Today’s material comes back very soon. In topic 6, bilinear and quadratic forms, every matrix is symmetric, so it can always be diagonalised, and the signs of the eigenvalues tell you whether a surface is a bowl, a channel or a saddle. You will find it in the theory of bilinear and quadratic forms. Meanwhile, in the Plane transformations simulator you can type the 2 × 2 matrices from these exercises and see their eigenvectors, and in MATLAB, eig, null(·, 'r') and rank check any part.
Cheat sheet: linear transformations and diagonalisation
The essentials in 30 seconds: the matrix holds the images of the basis in columns; with ; the eigenvalues are the roots of ; diagonalisable real and for all, with ; and .
| I want… | By hand | MATLAB |
|---|---|---|
| The matrix of | in column (with standard bases, coefficients in rows) | A = [ ... ] |
| The image of | A*v | |
| The preimage of | Solve : particular + kernel, or empty | rref([A w]) |
| The kernel | Solve ; | null(A, 'r') |
| The image | Original pivot columns; | rank(A), rref(A) |
| Injective / surjective | (columns) / (rows) | rank(A) |
| Change of basis | ; endomorphism | inv(C)*A*C |
| Eigenvalues | Roots of ; sum = trace, product = det | eig(A) |
| Geometric multiplicity | n - rank(A - l*eye(n)) | |
| Eigenvectors | null(A - l*eye(n), 'r') | |
| Diagonalise | = eigenvectors, = eigenvalues, matching | inv(sym(P))*A*P |
| Powers | A^n, P*D^n*inv(P) |
Exercise templates:
- Kernel and image: matrix → rank → dimensions → kernel with parameters → image with the original columns → injective/surjective.
- Diagonalise: factorised → real? → of the repeated ones → eigenvectors → and matching → check .
- With a parameter: do the eigenvalues depend on ? If not, rank of depending on for the repeated one; if so, look separately at the where two eigenvalues coincide.
- : (rows times ) → times that → check with .
| Symptom | Likely cause |
|---|---|
| and in different orders, or a wrong eigenvector | |
| A geometric multiplicity of 0 | You looked at instead of |
| The image of is not the first column | Transposed matrix |
| An image basis with vectors not in the image | Columns of the echelon form instead of the original ones |
| Two proportional eigenvectors, or one missing | |
| with does not give | and swapped, or a multiplication slip |
Before handing in, ask yourself:
- Have I checked the matrix with the image of a basis vector?
- Have I justified every rank and dimension, and used as a check?
- Have I looked at both diagonalisation conditions for every repeated eigenvalue?
- Have I checked with one column and with ?
Did this article help you? Here is how you can support SergioLearns →
Ready for the exam?AG theory mock exam — the 20-question test with the Campus rules, no negative marking (and the catch in the several-correct ones)


