Recitation 13 · Week 13· 44:19

Problem Sheet 13, worked through

The marked problems of Sheet 13, solved step by step on screen. Try them first; the rest of the sheet is for practice on your own, with full written solutions. Covers Lectures 49 to 52.

Play: Recitation 13
Recitation · 44:19 · Open on YouTube · Report a problem with this video
TranscriptThe full text of the recitation. Click any sentence to play the video from there.

Introduction and plan

Welcome to recitation thirteen, the last recitation of the course. This week brought the semester together. Lecture forty nine proved the spectral theorem for symmetric and Hermitian matrices. Lecture fifty used it to study quadratic forms. Lecture fifty one built the singular value decomposition. And lecture fifty two put it to work, approximating matrices by matrices of low rank. Problem Sheet thirteen covers lectures forty nine to fifty two. We will solve the eleven problems marked with the play symbol: problems one to five, problems seven, nine, ten and eleven, and problems thirteen and fourteen. The other five are for practice on your own, with full solutions in the solutions booklet. As always, pause the video before each problem, and try it yourself first. Then watch how we do it, and compare.

First, a quick recap. A real square matrix Q is orthogonal when Q transpose Q is the identity. Its columns are orthonormal, its inverse is its transpose, and it preserves lengths. The spectral theorem says that every real symmetric matrix A is Q D Q transpose, with Q orthogonal and D diagonal: its eigenvalues are real, and it has an orthonormal basis of eigenvectors. So A stretches the unit circle along perpendicular axes. Over the complex numbers, the same holds for Hermitian matrices, with a unitary Q. A quadratic form is x transpose A x, for a symmetric matrix A. In the coordinates y equal to Q transpose x, it becomes a sum of squares: each eigenvalue times the square of its coordinate. So the signs of the eigenvalues decide whether the form is positive definite, semidefinite, or indefinite.

Every real matrix has a singular value decomposition, A equals U sigma V transpose, with U and V orthogonal. The singular values on the diagonal of sigma are the square roots of the eigenvalues of A transpose A. And A sends each right singular vector v j to sigma j times the left singular vector u j. By Eckart and Young, keeping the first k terms of the singular value decomposition gives a closest matrix of rank at most k, and its error in the operator norm is the next singular value. One idea carries us through today: choose orthonormal coordinates that fit the matrix, and the matrix becomes diagonal.

Problem 1: an orthogonal matrix

Problem one is about orthogonal matrices. Recall from lecture forty nine: a real square matrix Q is orthogonal when Q transpose Q is the identity, which means that its columns form an orthonormal basis. Here Q is one eleventh of the matrix with first row (nine, minus two, minus six), second row (minus two, nine, minus six), and third row (minus six, minus six, minus seven). Part a asks us to show that Q is orthogonal, and to write down its inverse. Without the factor one eleventh, each column has squared length one hundred twenty one: eighty one plus four plus thirty six for the first, the same numbers for the second, and thirty six plus thirty six plus forty nine for the third. Divided by one hundred twenty one, that is one. So every column is a unit vector.

For the dot products, the first and second columns give minus eighteen, minus eighteen, plus thirty six, which is zero. The first and third give minus fifty four, plus twelve, plus forty two, which is zero. And the second and third give twelve, minus fifty four, plus forty two, which is also zero. So the columns are orthonormal, and Q transpose Q is the identity. Then Q inverse is Q transpose. And Q is symmetric, so Q inverse is Q itself. Part b takes x equal to the vector (one, one, one). It asks for Q x, and for a check that Q x has the same length as x.

Each entry of Q x is a row sum, over eleven. Nine minus two minus six is one, minus two plus nine minus six is one, and minus six minus six minus seven is minus nineteen. So Q x is one eleventh of the vector (one, one, minus nineteen). Its squared length is one plus one plus three hundred sixty one, over one hundred twenty one. That is three hundred sixty three over one hundred twenty one, which is three: the squared length of x. Orthogonal matrices preserve lengths. Part c takes u equal to one over root eleven, times the vector (one, one, three). It asks us to show that Q is the identity minus two u u transpose, to find Q u, and Q w for every w orthogonal to u, and to describe what Q does, with its eigenvalues and its determinant.

u u transpose is the column u times the row u transpose. The two factors one over root eleven give one eleventh, and each entry is an entry of the column times an entry of the row. In the first row, one times one is one, one times one is one, and one times three is three. The second row starts with one times one, which is one, and so on for every entry. Twice that, taken from the identity, gives one eleventh of a matrix with eleven minus two, eleven minus two, and eleven minus eighteen on its diagonal, and minus twice each product off it. That is exactly Q. Now Q u. We replace Q by the identity minus two u u transpose, so Q u is, the identity minus two u u transpose, times u. Opening the brackets gives u, minus two u, times u transpose u.

u transpose u is the squared length of u, and u is a unit vector, so it is one. So Q u is u minus two u, which is minus u. And for w orthogonal to u, u transpose w is zero, so Q w is w. So Q is the reflection across the plane orthogonal to u: it keeps every vector of the plane, and reverses u. Its eigenvalues are one, one and minus one, and its determinant is minus one. Part d takes B, with first row (two, three), and second row (three, minus two). Its columns are orthogonal, and the part asks whether B is an orthogonal matrix, and which multiple of B is.

B transpose B is thirteen times the identity, not the identity: each column has length root thirteen. So B is not orthogonal: orthogonal columns are not enough, they must also be unit vectors. Divided by root thirteen, the columns become orthonormal, so one over root thirteen, times B, is orthogonal.

Problem 2: orthogonal diagonalisation

Problem two orthogonally diagonalises a symmetric matrix. A has first row (eight, twelve), and second row (twelve, one). Part a asks for the eigenvalues of A, an eigenvector for each, and a check that the eigenvectors are orthogonal. The characteristic polynomial is the determinant of A minus t I: eight minus t, times, one minus t, minus twelve times twelve. That is t squared minus nine t minus one hundred thirty six, which factors as, t minus seventeen, times, t plus eight. So the eigenvalues are seventeen and minus eight.

For seventeen, A minus seventeen I has first row (minus nine, twelve). That row gives the equation minus nine x one plus twelve x two equals zero, so x one is four thirds of x two. Taking x two equal to three gives the eigenvector (four, three). For minus eight, A plus eight I has first row (sixteen, twelve). That row gives the equation sixteen x one plus twelve x two equals zero, so x two is minus four thirds of x one. Taking x one equal to three gives the eigenvector (three, minus four). Their dot product is twelve minus twelve, which is zero. Eigenvectors of a symmetric matrix for different eigenvalues are always orthogonal.

Part b asks for an orthogonal Q and a diagonal D with A equal to Q D Q transpose. Both eigenvectors have length five. Dividing by five gives the orthonormal columns q one and q two of Q, and D has seventeen and minus eight on its diagonal, in the same order. Then A is Q D Q transpose: the diagonalisation of lecture thirty nine, with Q inverse equal to Q transpose. Part c asks us to write A as lambda one q one q one transpose, plus lambda two q two q two transpose, and to check it entry by entry.

q one is one fifth of the vector (four, three). So q one q one transpose is one twenty fifth of the column (four, three), times the row (four, three). Its first row is four times four, and four times three: sixteen and twelve. Its second row is three times four, and three times three: twelve and nine. q two q two transpose works the same way. It is one twenty fifth of the matrix with first row (nine, minus twelve), and second row (minus twelve, sixteen).

Now seventeen times the first, minus eight times the second. In the top left entry, two hundred seventy two minus seventy two is two hundred. Off the diagonal, two hundred four plus ninety six is three hundred. And in the bottom right, one hundred fifty three minus one hundred twenty eight is twenty five. Divided by twenty five, that is eight, twelve, twelve and one: the matrix A. Each q j q j transpose projects onto the line through q j, so A stretches the line of q one by seventeen, and the line of q two by minus eight. Part d asks for A inverse from part c, with a check by the two by two inverse formula.

A inverse has the same eigenvectors, with the eigenvalues one seventeenth and minus one eighth. So it is one seventeenth of the first projection, minus one eighth of the second. Over the common denominator three thousand four hundred, that is eight times the first matrix, minus seventeen times the second. The result has first row (minus one over one hundred thirty six, three over thirty four), and second row (three over thirty four, minus one seventeenth). The determinant of A is eight minus one hundred forty four, which is minus one hundred thirty six. Swapping the diagonal entries, changing the signs of the other two, and dividing by minus one hundred thirty six gives the same matrix.

Problem 3: a Hermitian matrix

Problem three moves to complex matrices. Recall from lecture forty nine: the conjugate transpose A star is the transpose of A bar, and A is Hermitian when A star is A. A complex square matrix Q is unitary when Q star Q is the identity. Here A has first row (three, two i), and second row (minus two i, zero). Part a asks us to show that A is Hermitian, but not symmetric. Conjugating every entry gives first row (three, minus two i), and second row (two i, zero). Its transpose has first row (three, two i), and second row (minus two i, zero), which is A again. So A star is A. But A transpose has minus two i in its top right corner, so A is not symmetric.

Part b asks for the eigenvalues, an eigenvector for each, and whether the eigenvalues are real. The characteristic polynomial is, three minus t, times minus t, minus two i times minus two i. That is t squared minus three t, plus four i squared, which is t squared minus three t minus four, or, t minus four, times, t plus one. So the eigenvalues are four and minus one. Both are real, as for every Hermitian matrix. For four, A minus four I has first row (minus one, two i), so x one is two i x two, and an eigenvector is the vector (two i, one). For minus one, A plus I has second row (minus two i, one), so x two is two i x one, and an eigenvector is the vector (one, two i).

Part c asks us to show that the eigenvectors are orthogonal in C two, and to find a unitary Q and a real diagonal D with A equal to Q D Q star. In C two, the inner product conjugates the second vector. Two i times the conjugate of one, plus one times the conjugate of two i, is two i minus two i, which is zero. So the eigenvectors are orthogonal. Each has squared length, the absolute value of two i, squared, plus one, which is five. So Q is one over root five, times the matrix with first row (two i, one), and second row (one, two i). And D has four and minus one on its diagonal.

Part d takes C, with first row (one, i), and second row (i, minus one), which is symmetric but not Hermitian, and asks for its eigenvalues, and for a proof that C is not diagonalisable. Its characteristic polynomial is, one minus t, times, minus one minus t, minus i squared. That is t squared minus one, plus one, which is t squared. So zero is the only eigenvalue, with algebraic multiplicity two. But C is not the zero matrix. Its second row is i times its first, so its rank is one, and the eigenspace of zero has dimension one. The geometric multiplicity is smaller than the algebraic one, so C is not diagonalisable. Over the complex numbers, it is A star equal to A, not A transpose equal to A, that guarantees an orthonormal basis of eigenvectors.

Problem 4: classifying quadratic forms

Problem four classifies quadratic forms. Recall from lecture fifty: a quadratic form is x transpose A x, with A symmetric. It is positive definite if it is positive for every nonzero x, positive semidefinite if it is never negative, and indefinite if it takes both signs. For each form, we find A and classify the form. The diagonal of A holds the coefficients of the squares, and the coefficient of each cross term is split equally between the two entries off the diagonal. Then the signs of the eigenvalues decide. Part a is two x one squared, minus two x one x two, plus eight x two squared. It also asks for the value of the form at x equal to the vector (one, two).

The squares give two and eight on the diagonal, and minus two splits into minus one and minus one. At the vector (one, two), the form is two, minus four, plus thirty two, which is thirty. And x transpose A x agrees: A x is the vector (zero, fifteen), and its dot product with x is thirty. The characteristic polynomial is the determinant of A minus t I: two minus t, times, eight minus t, minus the product of the two minus ones. That is t squared minus ten t plus fifteen, with roots five plus or minus root ten. Root ten is less than five, so both roots are positive, and the form is positive definite. Part b is two x one squared, plus six x one x two, minus five x two squared.

Here A has first row (two, three), and second row (three, minus five). The product of the eigenvalues is the determinant, minus ten minus nine, which is minus nineteen. A negative product means one positive and one negative eigenvalue, so the form is indefinite. Indeed, it is two at e one, and minus five at e two. Part c is x one squared, plus two x one x two, plus x two squared, plus four x three squared, on R three. A has first row (one, one, zero), second row (one, one, zero), and third row (zero, zero, four). Its eigenvalues are two, zero and four. None is negative, but one is zero, so the form is positive semidefinite, and not positive definite.

Indeed, the form is, x one plus x two, squared, plus four x three squared, which is never negative. And at the vector (one, minus one, zero), an eigenvector for the eigenvalue zero, it is zero.

Problem 5: a repeated eigenvalue

Problem five works with a repeated eigenvalue. A has first row (four, minus one, minus two), second row (minus one, four, minus two), and third row (minus two, minus two, one). Part a asks us to show that the characteristic polynomial is minus, t minus five, squared, times, t plus one, and to find a basis of each eigenspace. We expand the determinant of A minus t I along the first row, which gives three terms. For the first, we keep the entry four minus t, and cross out its row and its column. The two by two block that is left has determinant, four minus t, times one minus t, minus four. So the first term is four minus t, times, four minus t, times one minus t, minus four, which is four minus t, times t, times, t minus five.

The other two terms work the same way. The second is t minus five, and the third is four times, t minus five. Every term has the factor t minus five. Taking it out leaves minus t squared plus four t plus five, which is minus, t minus five, times, t plus one. So the characteristic polynomial is minus, t minus five, squared, times, t plus one: the eigenvalue five is repeated, and minus one is simple. For minus one, row reducing A plus I gives the first row (one, zero, minus one half), the second row (zero, one, minus one half), and a zero row. So x one and x two are each half of x three, and the eigenspace is the line through the vector (one, one, two).

For five, every row of A minus five I is a multiple of the vector (one, one, two). So the eigenspace is the plane x one plus x two plus two x three equal to zero, with basis b one equal to the vector (minus one, one, zero), and b two equal to the vector (minus two, zero, one). This plane is orthogonal to the vector (one, one, two), just as the spectral theorem promises: the eigenspace for five is the orthogonal complement of the eigenspace for minus one. Part b asks for an orthonormal basis of each eigenspace, and an orthogonal Q with A equal to Q D Q transpose.

For minus one, q three is one over root six, times the vector (one, one, two). But b one and b two are not orthogonal: their dot product is two. So we run Gram Schmidt inside the plane. w one is b one. Then w two is b two, minus two over two, times w one: the vector (minus two, zero, one), minus the vector (minus one, one, zero), which is the vector (minus one, minus one, one). Normalising, q one is one over root two, times the vector (minus one, one, zero), and q two is one over root three, times the vector (minus one, minus one, one). These are the columns of Q with q three, and D has five, five and minus one on its diagonal. As a check, the trace of A is nine, which is five plus five minus one.

Part c asks us to show that A is five I minus six q three q three transpose, and to explain this formula. q three q three transpose is one sixth of the matrix with first row (one, one, two), second row (one, one, two), and third row (two, two, four). Six times it is that matrix itself. And five I minus it has four, four and one on its diagonal, and minus the same entries off it: exactly A. Why? The spectral decomposition is five times, q one q one transpose plus q two q two transpose, minus q three q three transpose. The three projections add up to Q Q transpose, which is the identity. So the bracket is the identity minus q three q three transpose, and A is five I minus six q three q three transpose. The repeated eigenvalue needs only the projection onto its whole eigenspace, not a particular basis of it.

Problem 7: an ellipse and its principal axes

Problem seven identifies a curve in the plane: thirteen x one squared, plus ten x one x two, plus thirteen x two squared, equals seventy two. Part a asks us to write the left side as a quadratic form, and to find an orthogonal Q with Q transpose A Q diagonal. A has thirteen and thirteen on its diagonal, and ten splits into five and five. Its characteristic polynomial is, thirteen minus t, squared, minus twenty five, which is, t minus eighteen, times, t minus eight.

For eighteen, A minus eighteen I has first row (minus five, five), so an eigenvector is the vector (one, one). For eight, A minus eight I has first row (five, five), and an eigenvector is the vector (one, minus one). Dividing by root two gives q one and q two, and Q transpose A Q is the diagonal matrix with eighteen and eight. Part b asks us to substitute x equal to Q y, and to identify the curve. With x equal to Q y, the form becomes y transpose, Q transpose A Q, y, which is eighteen y one squared plus eight y two squared. So the curve is eighteen y one squared plus eight y two squared equals seventy two. Dividing by seventy two, it is y one squared over four, plus y two squared over nine, equals one.

That is an ellipse, with semi axis two along q one, and semi axis three along q two. The coordinates y one and y two are measured along these principal axes. Part c asks for the points of the curve farthest from and nearest to the origin. Since Q is orthogonal, x and y have the same length. On the ellipse, y one squared is four minus four ninths of y two squared, so the squared length of y is four plus five ninths of y two squared. It runs from four, when y two is zero, to nine, when y two is plus or minus three.

So the farthest points are plus or minus three q two, at distance three, and the nearest are plus or minus two q one, at distance two. The long axis goes with the small eigenvalue. Part d asks for a sketch with the principal axes, and for the points where the curve crosses the coordinate axes. On the x one axis, x two is zero, so the two terms with x two drop out of the equation of the curve, and thirteen x one squared is seventy two. So x one is plus or minus the square root of seventy two over thirteen, about two point three five. The same holds on the x two axis. In the picture, the ellipse is short along q one, and long along q two.

Problem 9: a singular value decomposition

Problem nine finds a singular value decomposition. Recall from lecture fifty one: the singular values of a real matrix A are the square roots of the eigenvalues of A transpose A, in decreasing order. Here A has first row (one, minus four), and second row (four, five). Part a asks for A transpose A, its eigenvalues, and the singular values of A. A transpose has first row (one, four), and second row (minus four, five). In A transpose A, the first row is one plus sixteen, which is seventeen, and minus four plus twenty, which is sixteen. The second row is minus four plus twenty, which is sixteen, and sixteen plus twenty five, which is forty one.

Its characteristic polynomial is, seventeen minus t, times, forty one minus t, minus two hundred fifty six. That is t squared minus fifty eight t plus four hundred forty one, which is, t minus forty nine, times, t minus nine. So sigma one is seven, and sigma two is three. Part b asks for orthonormal eigenvectors v one and v two of A transpose A, the vectors u j equal to A v j over sigma j, and a singular value decomposition. It also asks us to check that u one and u two are eigenvectors of A A transpose. For forty nine, A transpose A minus forty nine I has first row (minus thirty two, sixteen), which gives v one equal to one over root five, times the vector (one, two). For nine, the first row is (eight, sixteen), which gives v two equal to one over root five, times the vector (two, minus one).

The matrix A times v one is one over root five, times the vector (minus seven, fourteen). Dividing by seven, u one is one over root five, times the vector (minus one, two). And the matrix A times v two is one over root five, times the vector (six, three). Dividing by three, u two is one over root five, times the vector (two, one). And u one and u two are orthogonal, as the construction guarantees. So U has the columns u one and u two, sigma has seven and three on its diagonal, and V has the columns v one and v two.

A A transpose has first row (seventeen, minus sixteen), and second row (minus sixteen, forty one). It sends the vector (minus one, two), to the vector (minus forty nine, ninety eight), which is forty nine times it, and the vector (two, one), to the vector (eighteen, nine), which is nine times it. Part c asks for a sketch of the unit circle with v one and v two, and of its image under A, with A v one and A v two. A point of the unit circle is cos s, times v one, plus sin s, times v two. A sends it to cos s, times sigma one u one, plus sin s, times sigma two u two. So the image is an ellipse, with semi axis seven along u one, and semi axis three along u two.

Part d asks for the largest and smallest values of the length of A x over unit vectors x, and for a check that the absolute value of the determinant of A is sigma one times sigma two. For a unit vector x equal to c one v one plus c two v two, the squared length of A x is forty nine c one squared, plus nine c two squared, which lies between nine and forty nine. So the largest length is seven, at plus or minus v one, and the smallest is three, at plus or minus v two. And the determinant of A is five plus sixteen, which is twenty one: seven times three.

Problem 10: the SVD of a tall matrix

Problem ten finds the singular value decomposition of a tall matrix, and puts it to use. A has first row (two, zero), second row (one, one), and third row (zero, two). And b is the vector (four, zero, two). Part a asks for a singular value decomposition, with U a three by three orthogonal matrix, and sigma a three by two matrix. The entries of A transpose A are the dot products of the columns of A: four plus one, which is five, then one, and one plus four, which is five. Its characteristic polynomial is, five minus t, squared, minus one, which is, four minus t, times, six minus t.

So sigma one is root six and sigma two is two, with v one equal to one over root two, times the vector (one, one), and v two equal to one over root two, times the vector (one, minus one). u one is A v one over root six: one over root twelve, times the vector with all three entries two, which is one over root three, times the vector with all three entries one. And u two is A v two over two: one over two root two, times the vector (two, zero, minus two), which is one over root two, times the vector (one, zero, minus one). To complete U, we need a unit vector u three orthogonal to both. The equations x one plus x two plus x three equal to zero, and x one minus x three equal to zero, give u three equal to one over root six, times the vector (one, minus two, one).

So U has the columns u one, u two and u three. Sigma has root six and two on its diagonal, above a row of zeros. And V has the columns v one and v two. Part b asks for orthonormal bases of the column space of A, the null space of A transpose, the row space and the null space of A, and for A as a sum of rank one matrices. A has rank two, since it has two nonzero singular values. So u one and u two are a basis of the column space, and u three is a basis of the null space of A transpose. v one and v two are a basis of the row space, which is all of R two, and the null space of A holds only the zero vector.

As a sum, A is root six, u one v one transpose, plus two, u two v two transpose. The first term has every entry one. The second has first row (one, minus one), then a zero row, and third row (minus one, one). Together they give A back. Part c asks for the least squares solution x hat of A x equal to b, found with the singular value decomposition, a check with the normal equations, and the residual. First, A x equal to b has no solution: the first and third equations give x one equal to two and x two equal to one, and then the second equation says three equals zero.

Write x hat as c one v one plus c two v two. Since v one and v two are orthonormal, the sum from part b gives A v one equal to sigma one u one, and A v two equal to sigma two u two. So A x hat is c one sigma one u one, plus c two sigma two u two. And A x hat must be the projection of b onto the column space: b dot u one, times u one, plus b dot u two, times u two. So each c j is b dot u j, over sigma j. b dot u one is six over root three, which is two root three, so c one is two root three over root six, which is root two. b dot u two is two over root two, which is root two, so c two is root two over two.

So x hat is root two v one, plus root two over two v two: the vector (one, one), plus one half times the vector (one, minus one), which is the vector (three halves, one half). For the check, A transpose A x hat is five times three halves, plus one half, which is eight, and three halves plus five halves, which is four. And A transpose b is eight plus zero plus zero, and zero plus zero plus four: also eight and four. Then A x hat is the vector (three, two, one), and the residual, b minus A x hat, is the vector (one, minus two, one). That is root six times u three: the residual lies in the null space of A transpose, at a right angle to the column space.

Problem 11: compressing a tiny image

Problem eleven compresses a tiny image. Recall from lecture fifty two, by Eckart and Young: keeping the first k terms of the singular value decomposition gives a closest matrix of rank at most k, with error sigma k plus one in the operator norm. In the Frobenius norm, the squared error is the sum of the squares of the singular values left out. Here X is a four by four grey image, with grey levels from zero, which is black, to six, which is white. Its first row is (six, four, two, zero), the second is (four, six, zero, two), the third is (two, zero, six, four), and the fourth is (zero, two, four, six). The vectors h one to h four have the entries plus or minus one half. h one has four plus signs, h two has two plus signs and then two minus signs, h three alternates, and h four has plus, minus, minus, plus.

Part a asks us to show that X h j is sigma j h j, for numbers sigma one to sigma four in decreasing order, to explain why these are the singular values of X, and to find its rank. X h one is half of the row sums, twelve each, so it is twelve h one. X h two is half of the vector (eight, eight, minus eight, minus eight), which is eight h two. X h three is half of the vector (four, minus four, four, minus four), which is four h three. And X h four is the zero vector. The h j are orthonormal: each has length one, and any two agree in exactly two entries. So X is H, times the diagonal matrix with twelve, eight, four and zero, times H transpose. X is symmetric with no negative eigenvalues, so this is already a singular value decomposition, with u j and v j both equal to h j.

So the singular values are twelve, eight, four and zero, and the rank of X is three, the number of nonzero singular values. Part b asks for the rank one and rank two approximations, X one and X two. X one is twelve h one h one transpose. Every entry of h one h one transpose is one quarter, so every pixel of X one is three: the average grey.

The next term, eight h two h two transpose, is two where the signs of h two agree, and minus two where they differ. Added to X one, it gives X two: two blocks of fives on the diagonal, and ones elsewhere. Part c asks for the errors of X one and X two, in the operator norm and in the Frobenius norm, and for a check of one of them from the entries. By Eckart and Young, the errors in the operator norm are the next singular values: eight for X one, and four for X two. In the Frobenius norm, the error of X one is the square root of eight squared plus four squared, which is root eighty, or four root five. The error of X two is four.

From the entries, X minus X one has the entries three, one, minus one and minus three in every row, in some order. So its squared Frobenius norm is four times, nine plus one plus one plus nine, which is eighty. Part d asks us to draw X, X one and X two as grey images, and to count the numbers it takes to store X one and X two as rank one terms. X is a light band along the diagonal. X one keeps only the average grey, and X two already shows the two light blocks on the diagonal. It misses only a small checkerboard of plus and minus ones.

To store one rank one term, sigma j u j v j transpose, we keep only the number sigma j, the four entries of u j, and the four entries of v j. That is one plus four plus four, which is nine numbers, and from these nine we can rebuild all sixteen entries of the term. So X one, with one term, takes nine numbers. X two, with two terms, takes eighteen: more than the sixteen entries of X itself, so a four by four image saves nothing. For an m by n image, each term takes one plus m plus n numbers, so rank k takes k times, m plus n plus one, numbers, against m times n entries. That saves space only when k is small compared with m and n.

Problem 13: triangular matrices and orthogonal eigenvectors

Problem thirteen asks when a triangular matrix has orthogonal eigenvectors. A real square matrix A is orthogonally diagonalisable when it is Q D Q transpose, with Q orthogonal and D diagonal. Recall from lecture forty nine: that happens exactly when A is symmetric. Part a asks for which real numbers a, b and d the matrix T, with first row (a, b), and second row (zero, d), is orthogonally diagonalisable, with a direct check by eigenvectors when a is not d. T is orthogonally diagonalisable exactly when it is symmetric, that is, when b is zero. Then T is already diagonal, and Q is the identity.

For the direct check, the eigenvalues of the triangular matrix T are a and d. For a, the eigenspace is the line through e one. For d, T minus d I has first row (a minus d, b), so the eigenspace is the line through the vector (b, d minus a). Any basis of eigenvectors is s times e one, and t times the vector (b, d minus a), with s and t not zero. Their dot product is s t b. So an orthogonal basis of eigenvectors exists exactly when b is zero. Part b takes B, with first row (one, two), and second row (zero, four). It asks us to show that B is diagonalisable, but that no basis of eigenvectors of B is orthogonal.

B is triangular, so its eigenvalues are one and four. Two different eigenvalues of a two by two matrix give a basis of eigenvectors, so B is diagonalisable. For one, B minus I gives the line through the vector (one, zero). For four, B minus four I has first row (minus three, two), which gives the line through the vector (two, three). A basis takes one vector from each line, s times the first and t times the second, and their dot product is two s t, which is never zero. Part c asks for the angle between the two eigenvector lines, and for a sketch.

The cosine of the angle is the dot product, two, over one times root thirteen, which is about zero point five five five. So the lines meet at about fifty six point three degrees, not at ninety.

Problem 14: positive definite matrices

Problem fourteen proves facts about positive definite matrices. Here A and B are real symmetric n by n matrices. Part a asks us to prove that if A and B are positive definite, then so is A plus B, and so is c A for every c greater than zero. A plus B is symmetric, and for x not zero, x transpose, A plus B, x splits into x transpose A x, plus x transpose B x. That is a sum of two positive numbers, so it is positive. In the same way, x transpose c A x is c times a positive number, which is positive.

Part b asks us to prove that A plus c I is positive definite exactly when c is greater than minus lambda min, where lambda min is the smallest eigenvalue of A, and to apply this to the matrix of problem two. By the spectral theorem, A is Q D Q transpose. Since Q Q transpose is the identity, A plus c I is Q, times, D plus c I, times Q transpose. So A plus c I has the eigenvalues lambda j plus c. It is positive definite exactly when all of these are positive, that is, when the smallest of them, lambda min plus c, is positive: when c is greater than minus lambda min. For problem two, the eigenvalues are seventeen and minus eight, so A plus c I is positive definite exactly when c is greater than eight.

Part c asks us to prove that if A is positive definite, then the absolute value of a j k is less than the square root of a j j times a k k, for j different from k, so that an entry of largest absolute value lies on the diagonal. Take x equal to s e j plus t e k, with s and t not both zero. Then x transpose A x is a j j s squared, plus two a j k s t, plus a k k t squared, which must be positive. That is the quadratic form of the two by two matrix A prime, with first row (a j j, a j k), and second row (a j k, a k k). So A prime is positive definite, and its eigenvalues are positive. Its determinant is their product, so it is positive too: a j j a k k minus a j k squared is greater than zero. Also, a j j is the form at e j, which is positive, and so is a k k.

So the absolute value of a j k is less than the square root of a j j a k k, which is at most the larger of a j j and a k k. No entry off the diagonal is as large as the largest diagonal entry. Part d takes the matrix with first row (four, three), and second row (three, one). It asks us to show that its largest entry is on the diagonal, but that it is not positive definite. Its largest entry, four, is on the diagonal. But three is more than the square root of four times one, which is two, so by part c it is not positive definite. Directly, at x equal to the vector (one, minus two), the form is four, minus twelve, plus four, which is minus four.

What we practised

Let's collect what we used today, in the last recitation of the course. Problems one and three worked with orthogonal, unitary and Hermitian matrices. Problems two and five diagonalised symmetric matrices with orthonormal eigenvectors, and wrote them as sums of projections. Problems four, seven and fourteen used quadratic forms: the signs of the eigenvalues classify them, and the principal axes turn a tilted curve into a standard ellipse.

Problems nine to eleven built singular value decompositions, read off the four subspaces and a least squares solution, and compressed an image with Eckart and Young. And problem thirteen showed that orthogonal eigenvectors need a symmetric matrix. For practice, try problems six, eight, twelve, fifteen and sixteen. Problem sixteen writes a matrix as a rotation times a symmetric stretch: the polar decomposition. That completes the thirteen weeks of linear algebra. Next comes the final practice exam, with full solutions, on the course page at Open Semester dot com. Thank you for working through the course with us.

In this recitation

  1. Problem 1: an orthogonal matrix
  2. Problem 2: orthogonal diagonalisation
  3. Problem 3: a Hermitian matrix
  4. Problem 4: classifying quadratic forms
  5. Problem 5: a repeated eigenvalue
  6. Problem 7: an ellipse and its principal axes
  7. Problem 9: a singular value decomposition
  8. Problem 10: the SVD of a tall matrix
  9. Problem 11: compressing a tiny image
  10. Problem 13: triangular matrices and orthogonal eigenvectors
  11. Problem 14: positive definite matrices
  12. What we practised

Materials

Found a mistake, or something not working on this page? Report it and we'll fix it. See what we've corrected.