Print this page and work through it on paper. Revealed answers are never printed, so you can check one question and still print a clean sheet.
Linear Algebra · Chapter test
The Singular Value Decomposition
Work this sheet on paper, showing every step — the solutions give the full method so you can check your route, not only your final matrix. Name each result you use (“by the Spectral Theorem”, “by Eckart–Young”, “by the four-subspaces theorem”, “by the Penrose conditions”), and whenever you write down a singular vector say which formula or which null space produced it. No calculator is needed anywhere: every number on this sheet is an integer, a fraction or a surd. Full worked solutions are on a separate page, and each question has its own reveal so you can check one answer without seeing the rest.
- 1.Computation · 6 min
Find the singular values of each matrix exactly. In each case say which Gram matrix you diagonalised and why that one, and give one independent arithmetic check on your answer (a trace identity or a determinant identity).
- (a). What does do to the unit circle?
- (b). Compare the singular values with the eigenvalues of and comment.
- (c). Explain, before computing anything, how many singular values must be zero.
Show the solution to question 1
(a) Diagonalise . Both Gram matrices are , so either will do; take :
Both eigenvalues are , so . Every direction is stretched by the same factor: indeed is the rotation matrix through , so is times a rotation and sends the unit circle to a circle of radius . Check: . ✓
(b) A shear. , with trace and determinant , so the characteristic polynomial is and
Hence and . Two checks: ✓, and ✓.
Note that both eigenvalues of are , while its singular values are about and . Singular values are the absolute eigenvalues only for symmetric matrices, and a shear is the standard counterexample.
(c) Rank one, so only one singular value is nonzero. is , so is and is the smaller Gram matrix:
Its determinant is and its trace is , so the eigenvalues are and : , . This had to happen: the second column of is twice the first, so and exactly one singular value is nonzero. Check: , the sum of the squares of all six entries. ✓
- 2.Sketch · 7 min
Let . A sketch with no singular values written beside it earns nothing here: every feature you draw must be justified by a computation.
- (a)Find the singular values and the right singular vectors of . Explain why, for this particular matrix, the images of and are the semi-axes of the image ellipse, and find the unit vectors along those axes.
- (b)On one pair of axes sketch the unit circle and its image under . Mark and on the circle and their images on the ellipse, draw both axes of the ellipse, and state whether preserves or reverses orientation and how you know.
- (c)Verify that the image of lies on your ellipse by writing in the frame and checking the ellipse equation, and check the area of the ellipse against .
Show the solution to question 2
(a) Singular values and right singular vectors.
The Gram matrix is already diagonal, so its unit eigenvectors are (eigenvalue ) and (eigenvalue ), and , . By the ellipsoid theorem the semi-axes of the image ellipse are , and here those are the images of the standard basis vectors: , of length ✓, and , of length ✓. The axis directions are and , which are perpendicular, as they must be.
(b) The sketch. On one set of axes draw the unit circle and, on it, the points and . The image is an ellipse centred at the origin, tilted : its long axis runs along the line and ends at , its short axis runs along and ends at . Mark as the image of and as the image of , and draw both axes of the ellipse as dashed lines through the origin. The ellipse should enclose the circle without touching it: the smallest stretch is , so every point of the circle is pushed outward. Finally, since , orientation is preserved: travelling counterclockwise from to on the circle corresponds to travelling counterclockwise from (at angle ) to (at angle ) on the ellipse.
(c) Two checks. For , . Its coordinates in the frame are
and , so lies on the ellipse ✓ (plot it at roughly ). Area: , and the unit disc's area scaled by is also ✓.
- 3.Computation · 10 min
Let . Compute a full SVD by hand. State the size of each factor before you start.
- (a)Find the singular values and an orthonormal set of right singular vectors, and write down .
- (b)Find and from the right singular vectors, then find the remaining column of . Explain why that last column cannot come from the same formula as the first two, and check it is orthogonal to both.
- (c)Write down , and with their correct shapes, verify two entries of against , and write in outer product form.
Show the solution to question 3
Sizes. is , so is , is and is .
(a) Singular values and . The smaller Gram matrix is ():
Trace , determinant , so : , , and , . Both are nonzero, so : full column rank.
For , forces , so . For , forces , so . Thus . Check: , the sum of squared entries of . ✓
(b) Left singular vectors from the formula, then one from the null space.
(Norm check on : ✓.) The formula produces only vectors, and there is no at all, since is ; the third column of carries no information about beyond being orthogonal to the first two, which is exactly the statement that it spans . Solve :
Subtracting gives , and then , so : . Orthogonality check: ✓ and ✓.
(c) Assemble, check, reduce. has the shape of , a diagonal block with a zero row beneath:
Entry of is ✓. Entry is ✓.
The reduced SVD drops and the zero row of ; in outer product form,
- 4.Computation · 7 min
A matrix is given in outer product form,
Do not multiply out the entries of at any point; everything asked can be read off the factorisation.
- (a)State and the dimension of each of the four fundamental subspaces, and write down orthonormal bases for and . Say what you checked to be sure the given expression is a legitimate SVD.
- (b)Find orthonormal bases for and .
- (c)Compute for and for . Then decide whether is solvable for and for , giving a solution when one exists.
Show the solution to question 4
(a) Dimensions and the two easy bases. First confirm this really is an SVD in outer product form: , , and all four vectors have unit length (, , ). The weights are decreasing, so , and .
By the four-subspaces theorem: has dimension ; has dimension ; has dimension ; has dimension . The listed 's and 's are already orthonormal bases of the column and row spaces.
(b) The two null spaces. is the orthogonal complement of in , so it is spanned by any vector perpendicular to and ; the cross product works, and normalising gives
Check: ✓, ✓.
is the orthogonal complement of in : means and . Adding and subtracting, and , so
which are orthogonal to each other and to ✓. (Any orthonormal basis of this plane is acceptable — it is the repeated singular value leaving the choice free.)
(c) Using the factorisation directly. , and , so
lies in , so : both and vanish.
is solvable exactly when , i.e. when , because . For : , so no solution exists. For : it lies in , and since , the vector is a solution. It is not the only one — add anything in — but it is the one of smallest norm, being the one in .
- 5.Proof · 9 min
Let be a real matrix of rank with singular values . You may quote , , and the definition of the spectral norm as a maximum of .
- (a)Prove that , and determine exactly which matrices make each inequality an equality.
- (b)Prove from the definition that whenever the product is defined, and give a example in which the inequality is strict.
- (c)Prove that an matrix is orthogonal if and only if all of its singular values equal . Deduce and for an orthogonal , and give an example showing that alone does not make orthogonal.
Show the solution to question 5
(a) The sandwich. Every is positive, so
and since for each ,
Taking square roots gives . The left inequality is an equality exactly when , i.e. when : rank-one matrices and the zero matrix. The right inequality is an equality exactly when for every : all nonzero singular values equal. Orthogonal matrices, and more generally scalar multiples of matrices with orthonormal columns, are the examples.
(b) Submultiplicativity. The definition of as a maximum gives for every (trivially when ). Apply it twice: for any ,
Divide by and take the maximum over : .
Strictness: and each have spectral norm , but has norm . The direction stretches most is the direction kills.
(c) Orthogonal matrices are exactly the matrices with all singular values . If is orthogonal then , whose eigenvalues are all , so every singular value of is . Conversely, if is with all singular values equal to , then and , so the SVD reads , a product of orthogonal matrices and hence orthogonal ().
Consequently and , which is the right-hand equality case of (a) with . The converse of the first claim fails: has but is singular. The spectral norm reports only the largest stretch and is silent about the others; orthogonality is a statement about all of them.
- 6.Computation · 9 min
Condition numbers throughout are in the -norm, . Give every value exactly.
- (a)Find for the shear , and use the rule of thumb to say how many decimal digits solving can lose. Cross-check your value against .
- (b)Let be invertible. Prove that and , and state the practical consequence of the first identity for solving least-squares problems through the normal equations.
- (c)Compute and for and , compare each with its determinant, and explain what the comparison shows. Then exhibit a and a for which the error amplification bound for is attained exactly, showing the ratio.
Show the solution to question 6
(a) The shear. has eigenvalues , so and and
The rule of thumb says a condition number near costs about digits; , so solving loses less than one decimal digit. Cross-check: , and indeed is another shear with the same Gram eigenvalues, so ✓.
(b) Squaring and inverting. From , , which is an orthogonal diagonalisation of a symmetric positive definite matrix; its eigenvalues are positive, and for a symmetric positive definite matrix the eigenvalues are the singular values (the orthogonal diagonalisation is itself an SVD). Hence
Likewise is an SVD of up to reordering, with singular values , so . Practical consequence: forming the normal equations to solve a least-squares problem squares the condition number, so a matrix that loses digits loses once squared. This is why least-squares software works with directly (via QR or the SVD) rather than with .
(c) Determinant versus conditioning, and attainment. is symmetric with eigenvalues , namely and , both positive, so those are its singular values and
has both singular values , so while . The larger determinant belongs to the perfectly conditioned matrix and the tiny determinant to the badly conditioned one, but that is a coincidence of scale, not a rule: has determinant and is also perfectly conditioned. The determinant is the product of the singular values and confuses overall size with the spread between directions; the condition number is a ratio and sees only the spread. Solving can lose about digits.
Attainment: the eigenvectors of are for and for , and for a symmetric positive definite matrix these serve as both left and right singular vectors. Take , so , and perturb along the weak direction, , so . Then
so the ratio is exactly ✓. With , a error in becomes a error in : the computed solution is worse than useless.
- 7.Computation · 8 min
The matrix has singular values , , with , , and . (You may take these as given, or check them.)
- (a)Write down the best rank-one approximation , verify directly that it has rank one, compute , and find and both from the singular values and directly from the entries.
- (b)A student proposes instead , arguing that keeping the largest row is a rank-one approximation. Compute and a lower bound for , compare with (a), and name the theorem that guarantees the outcome.
- (c)A matrix has singular values and all others zero. Find the smallest for which retains at least of , give in both norms for that , and compare the storage of with that of the full matrix.
Show the solution to question 7
(a) The truncation.
since . Its rank is one (every column is a multiple of ). The error is
as the truncation lemma promises. Hence and . Direct check of the Frobenius value from the entries: , so ✓. The two norms agree because the error matrix has rank one.
(b) Deleting rows is not the same as truncating. has rank one, so it is a legitimate competitor. The error is
For the spectral norm a lower bound suffices: . So is worse than in both norms. The Eckart–Young theorem says this was inevitable: no matrix of rank at most can come closer to than in either norm. The best rank- approximation zeroes the small singular values, which touches every entry of ; zeroing entries, rows or columns is a different and inferior operation.
(c) Choosing from an energy target. Squares: , total . Cumulative fractions:
The first to reach is at , and falls short at , so is the smallest. The errors are and . Check: ✓, the Pythagorean split of the Frobenius norm.
Storage: the rank- truncation needs numbers against for the matrix itself, a ratio of , so about of the original.
- 8.Proof · 10 min
Throughout, is of rank and denotes its -th singular value, with the convention for . Quote the Eckart–Young theorem in the form
together with the truncation lemma . (The edge cases and are immediate and you should say why.)
- (a)Let be any matrix. Prove that , and deduce that for every . Explain in a sentence why this inequality is what makes numerical rank a meaningful quantity.
- (b)Prove that for every , and describe the geometric content of the identity.
- (c)Let be and invertible. Prove that the spectral-norm distance from to the nearest singular matrix is exactly , exhibit a singular matrix at that distance, and deduce that . What is the distance for the shear ?
Show the solution to question 8
Edge cases first. For the only matrix of rank is and , so the formula holds. For the choice is allowed and gives distance . For it is the theorem as stated.
(a) Singular values move by at most the size of the perturbation. Since has rank at most , it is an admissible for the matrix , so
using the triangle inequality for the spectral norm (which holds because for every ) and then the truncation lemma. Now exchange roles: and , so the same argument gives . Together, with ,
This is what makes numerical rank meaningful: if the data carry noise of size , every singular value of the measured matrix lies within of the corresponding singular value of the true matrix, so a singular value far above the noise level is genuine and one below it cannot be distinguished from zero. Pivots in row reduction satisfy no such inequality, which is why they cannot be trusted to measure rank on measured data.
(b) Pythagoras for the truncation. The expressions and are each of SVD form (orthonormal 's, orthonormal 's, decreasing positive weights), so by the uniqueness theorem their singular values are and respectively. The Frobenius formula then gives
The geometric content: under the inner product , whose norm is the Frobenius norm, and are orthogonal — indeed because for . Truncation is an orthogonal projection of onto the span of its first outer products, and Pythagoras follows.
(c) The condition number is a relative distance to singularity. An matrix is singular exactly when its rank is at most . Apply Eckart–Young with (legitimate, as ):
attained by , which is singular. Therefore
A matrix is ill-conditioned precisely when it is close to a singular matrix relative to its own size, which is why scaling by a constant changes nothing. For the shear , with , there is a singular matrix within spectral distance , and none closer.
- 9.Critique · 8 min
A student is asked for with and , and writes the following.
Step 1. is not a multiple of , so has no solution and I look for a least-squares solution instead.
Step 2. The least-squares solutions are the with , where is the projection of onto . With , .
Step 3. reduces to the single equation , whose solutions are for any .
Step 4. By the Penrose conditions is unique, so the least-squares solution is unique. Taking gives .
Exactly one step contains an error, and the final answer is wrong.
- (a)Identify the erroneous step. State precisely which two things are being confused, and say in words which of the vectors the pseudoinverse actually returns. Find it by minimising along the line.
- (b)Compute from an SVD of and hence . Check that your answer is a least-squares solution and compare its norm with the student's answer.
- (c)The student adds: “As a check, should equal .” Explain why it will not, compute , and identify the matrix you get.
Show the solution to question 9
(a) The error is in Step 4. Steps 1 to 3 are correct: is not a multiple of ; the projection formula onto a line is applied correctly, with and ; and the solution set of is indeed the line .
Step 4 confuses two different uniqueness statements. The Penrose conditions say that the matrix is unique. They say nothing about least-squares solutions being unique, and here they are not: is a line, so every minimiser can be shifted along it without changing , which is exactly what Step 3 found. The least-squares theorem for the pseudoinverse says which minimiser is: the one of smallest norm, equivalently the unique minimiser lying in . Choosing picked an arbitrary point of the line, not the closest one to the origin.
Minimising along the line: , with derivative , zero at . So the correct value is , which is indeed a multiple of ✓.
(b) The pseudoinverse from an SVD. has trace and determinant , so , : , . (The full-column-rank formula is unavailable, which is presumably why the student avoided it.) The eigenvector for satisfies , i.e. , so and
Then
agreeing with (a). Check it is a least-squares solution: ✓, and the residual is orthogonal to since ✓. Norms: , against for the student's answer. Both fit the data equally well; only one is the pseudoinverse solution.
(c) is a projection, not the identity. would force , i.e. full row rank, and has rank . Computing,
This is symmetric and idempotent — is itself again — with column space : it is the orthogonal projection onto , which is what always is (write ). Applied to it returns , the projection the student computed by hand in Step 2 ✓. The correct check for a matrix of this shape is the Penrose condition , not .
- 10.Computation · 10 min
Four observations of two variables are recorded: , , , . Observations are rows, and .
- (a)Centre the data, write the centred matrix , and compute and the sample covariance matrix .
- (b)Find both principal components, the singular values of , the variance explained by each component, and the fraction of total variance explained by the first.
- (c)Compute the scores of the four observations on the first component and verify that their sample variance equals the eigenvalue from (b). Then form the rank-one truncation , add the mean back, describe geometrically where each point has gone, and check that .
- (d)Let be the raw (uncentred) matrix and the mean vector. Prove that , evaluate it for these data, and explain what an analysis that skips the centring would report and why it is misleading.
Show the solution to question 10
(a) Centre and form the covariance. Means: , . Subtracting from each row,
The diagonal entries are the sample variances of the two variables and the off-diagonal is their covariance.
(b) Principal components. has trace and determinant , so : eigenvalues and , hence singular values of are and . For , gives ; for , gives . The variances explained are : and , whose sum ✓. The first component explains
so a single coordinate along the line (through the mean) captures of the spread.
(c) Scores, and the reconstruction. The scores are . They have mean zero, so their sample variance is
— the first-component-maximises-variance theorem in action. Since , , and the rank-one truncation is
Adding the mean back, the reconstructed points are : each original point has been dropped perpendicularly onto the line . The residual is , with rows , so ✓, which is the sum of the squared distances from the points to the line. That equality is Eckart–Young: no other line through the mean has a smaller total squared distance to the data.
(d) What forgetting to centre does. Write for the all-ones vector in , so that . Then
because is the vector of column sums of the centred matrix, which is , and .
Here , so (direct check from the raw rows: and ✓). Its eigenvalues are , namely and , so the uncentred procedure reports a leading direction with “explained fraction” instead of the true . The extra term is rank one, points along the mean , and has eigenvalue — it measures where the cloud sits, not how it varies, and it dominates whenever the mean is large compared with the spread. In this example the direction happened to survive only because lies along the genuine first component; move the data to have mean and the uncentred leading direction would swing to , the wrong axis entirely.
- 11.Computation · 10 min
Let . Its polar decomposition is with orthogonal and symmetric positive semidefinite.
- (a)Compute by diagonalising , then . Verify that is orthogonal and that .
- (b)Compute an SVD of , form and , and confirm they agree with (a). Explain why the sign freedom in the singular vectors cannot change or , and describe geometrically.
- (c)Prove that for an invertible , is a rotation () if and only if , and classify the found above. Then show that and evaluate it, checking directly from the entries of .
Show the solution to question 11
(a) The stretch factor from a square root. is symmetric, so , with eigenvalues , namely and , and eigenvectors and . The positive definite square root acts as and on those eigenspaces:
Check: ✓, and is positive definite (eigenvalues ). Since , and
✓, and ✓. Uniqueness of the polar factors of an invertible matrix says these are the factors.
(b) The same factors from the SVD. Singular values are and , with , , and
(The eigenvalue of has become the singular value , and the sign has moved into .) Then
and , which is the sum computed in (a). Both agree ✓. Sign choices cannot matter: replacing by leaves each product and unchanged, and if a singular value were repeated, summed over its eigenspace would likewise be basis-independent.
Geometrically swaps the coordinates: it is the reflection across the line , not a rotation. So is “stretch by along and by along , then reflect in the line ”.
(c) Rotation or reflection, and the distance to . From , . The eigenvalues of are the singular values , so , and since is orthogonal. Hence exactly when . Here , so and is a reflection, in agreement with (b).
For the distance, and orthogonal invariance of the Frobenius norm give
Direct check: , whose entries square to ✓. Since is the orthogonal matrix nearest to , no orthogonal matrix lies within Frobenius distance of .
- 12.Proof · 11 min
Let be a full SVD of an matrix of rank , let , and write for the coordinates of in the basis . Write . This question is about truncated SVD regularisation: fixing a threshold , letting be the number of singular values with , and using
in place of .
- (a)Show that . Deduce that if is replaced by then changes by at most , and identify a for which this is an equality.
- (b)Prove that , where is the rank- truncation of , and that a perturbation changes by less than , whatever the value of .
- (c)Prove that . Then illustrate (a), (b) and (c) with , , and , computing every quantity exactly.
Show the solution to question 12
(a) The pseudoinverse solution, coordinate by coordinate. By definition , so
Each component of along is divided by : the smallest singular value is the largest amplifier. Replacing by changes by , and because the are orthonormal,
the last step being Parseval for the orthonormal basis of . So , with equality when is a multiple of , since then only the term survives and both inequalities are equalities.
(b) The truncated solution is a pseudoinverse solution for . The truncation is written in SVD form with rank , so its pseudoinverse, by the definition applied to that SVD, is , and
(Uniqueness via the Penrose conditions guarantees this does not depend on which SVD of we started from.) A perturbation now moves by , and the computation of (a) with replaced by gives
because every retained exceeds . For at least one of the two inequalities is strict: the first if some with is nonzero (as there), and otherwise the second, since then all of sits in the omitted terms . So the amplification is capped at , a number chosen by the user, however tiny may be.
(c) The price: a larger residual. Expand . Since ,
The first is the projection of onto , as it should be. Subtracting from and using orthonormality of the ,
and the difference is : exactly the part of that lived in the discarded singular directions. Regularisation trades a controlled amount of misfit (bias) for immunity to noise (variance).
The example. is its own SVD with , , , , and .
By (a), , and gives : a perturbation of length moved the solution by , which is exactly, the equality case.
With we have , so and . The same has , so does not move at all — comfortably within the cap from (b).
Residuals: , while , of squared length , matching (c) with , . The regularised fit misses by in the direction it has chosen not to trust, and in exchange a change in the data no longer produces a change in the answer.
Solutions: calc-path.com/linear-algebra/test/svd/answers