Recitation 4 · Week 4· 33:08

Problem Sheet 4, worked through

The marked problems of Sheet 4, 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 13 to 16.

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

Recitation 4

Welcome to recitation four. This week, matrices became machines that move vectors. Lecture thirteen introduced linear transformations, lecture fourteen multiplied matrices, lecture fifteen brought the transpose, special matrices, blocks and the trace, and lecture sixteen inverted matrices. Problem Sheet four covers lectures thirteen to sixteen. We will solve the six problems marked with the play symbol: problems five, six, seven, nine, eleven and twelve. The other eight 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 map T is linear when it respects sums and scalar multiples. Every linear map from R n to R m is multiplication by a matrix, its standard matrix, whose columns are T of e one, up to T of e n. The product A B is the matrix of doing B first, and then A. Entry i j is row i of A, times column j of B. The product is associative and distributive, but not commutative. The transpose turns rows into columns, and it reverses products: the transpose of A B is B transpose times A transpose.

A square matrix A is invertible when there is a matrix A inverse with A times A inverse, and A inverse times A, both equal to the identity. To find it, we row reduce A next to the identity. One habit carries us through today: keep track of the order. The matrix on the right acts first, and when a factor moves to the other side of an equation, check which side it lands on.

Problem 5: projection and reflection

Problem five is about two maps of the plane. Let L be the line through the origin in the direction u, equal to (two, one). The projection P sends each vector x to the point of L closest to it: x dot u, over u dot u, times u. And the reflection S across L sends x to two times P of x, minus x. Part a asks for the standard matrix of P. Recall from lecture thirteen: the columns of the standard matrix are the images of the standard basis vectors. So we compute P of e one, and P of e two.

First, u dot u is two times two, plus one times one, which is five. Next, e one dot u is two, so P of e one is two fifths of u, which is (four fifths, two fifths). And e two dot u is one, so P of e two is one fifth of u, which is (two fifths, one fifth). These two vectors are the columns of the standard matrix. Taking out the common factor, P is one fifth times the matrix with rows (four, two) and (two, one).

Part b asks for the standard matrix of S. S of x is two P of x, minus x, so we also need a matrix for x itself: a matrix that leaves every vector as it is. That is the identity matrix I, with ones on the diagonal and zeros everywhere else. Multiplying by it changes nothing: I times x is x, for every vector x. So S of x is two P of x, minus I x, which is two P minus I, times x. The standard matrix of S is two P, minus I.

Now we compute two P minus I. Doubling P doubles each of its entries, and I has ones on the diagonal and zeros elsewhere. Entry by entry. In the top left, eight fifths minus one is three fifths. In the top right, four fifths minus zero is four fifths. In the bottom left, also four fifths. And in the bottom right, two fifths minus one is minus three fifths. So S is one fifth times the matrix with rows (three, four) and (four, minus three).

Part c asks for P of x and S of x when x is (three, minus one), and for their lengths. First, x dot u is six minus one, which is five, and five over five is one. So P of x is u itself, (two, one). Let's confirm with the matrix. In the first entry, four times three, plus two times minus one, is ten, and ten fifths is two. In the second, two times three, plus one times minus one, is five, and five fifths is one. Then S of x is two times (two, one), minus (three, minus one), which is (one, three).

A reflection should not change lengths. The length of x is the square root of nine plus one, root ten. And the length of S of x is the square root of one plus nine, also root ten. Part d asks us to draw L, x, P of x and S of x. Here is the line L, and the vector x. Its projection, P of x, lies on L. And its reflection, S of x, lies on the other side of L. The segment from x to S of x crosses L at a right angle, and P of x is its midpoint. That is exactly what the formula says: P of x is the average of x and S of x.

Part e asks why P squared is P and S squared is I, and then to check S squared with the matrix. Projecting twice changes nothing. P of x already lies on L, and the point of L closest to it is itself. So P squared equals P. And reflecting twice brings every point back where it started. So S squared should be the identity. Let's check by multiplying. With the factor one twenty fifth in front. The top left entry is three times three, plus four times four, which is twenty five. The top right is three times four, plus four times minus three, which is zero.

The bottom left is four times three, plus minus three times four, which is zero. And the bottom right is four times four, plus minus three times minus three, which is twenty five. So S squared is one twenty fifth, times twenty five times the identity, which is the identity. The algebra agrees with the picture. The same check works for P. Projecting twice changes nothing, so P squared should equal P. Again, with the factor one twenty fifth in front.

The top left entry is four times four, plus two times two, which is twenty. The top right is four times two, plus two times one, which is ten. The bottom left is also ten. And the bottom right is two times two, plus one times one, which is five. Twenty, ten, ten and five are five times four, two, two and one. So P squared is five twenty fifths, that is one fifth, times the matrix of P. P squared equals P.

Problem 6: a linear map from two values

Problem six. A linear map T, from R two to R three, sends the vector (one, one) to the vector (one, two, zero), and the vector (one, minus one) to the vector (three, zero, two). We want its standard matrix. The difficulty is that we know T on two vectors, but not on e one and e two. So part a asks us to write e one and e two in terms of the vectors we know, and then to find T of e one and T of e two. Adding (one, one), and (one, minus one), gives the vector (two, zero), which is two times e one. So e one is one half of the first vector, plus one half of the second.

Subtracting them gives the vector (zero, two), which is two times e two. So e two is one half of the first vector, minus one half of the second. Now linearity does the work. T of e one is one half of T of the first vector, plus one half of T of the second. In the first coordinate, one half of one, plus one half of three, is two. In the second, one half of two, plus one half of zero, is one. In the third, one half of zero, plus one half of two, is one.

In the same way, T of e two is one half of T of the first vector, minus one half of T of the second. In the first coordinate, one half minus three halves is minus one. In the second, one minus zero is one. In the third, zero minus one is minus one. Part b asks for the standard matrix, and for T of (five, one). The two images we found are the columns of the standard matrix. So A has columns (two, one, one), and (minus one, one, minus one). It is three by two, as it must be for a map from R two to R three. Then T of the vector (five, one) is A times the vector (five, one): five times the first column, plus one times the second. In the first coordinate, ten minus one is nine. In the second, five plus one is six. In the third, five minus one is four.

Part c checks T of the vector (five, one) another way, without the matrix. We write (five, one) as a times (one, one), plus b times (one, minus one). That means a plus b is five, and a minus b is one. So a is three, and b is two. Then T of, (five, one), is three times, (one, two, zero), plus two times (three, zero, two). In the first coordinate, three plus six is nine. In the second, six plus zero is six. In the third, zero plus four is four. The same answer. Part d asks: could a linear map send (one, one), to (one, two, zero), and (two, two), to (two, five, zero)? No. The vector (two, two) is two times (one, one), so linearity forces T of (two, two), to be two times (one, two, zero), which is (two, four, zero).

So a linear map is fixed by its values on any vectors from which e one and e two can be built. But it cannot take arbitrary values: its values on a vector and on a multiple of it must agree with linearity.

Problem 7: rotate and reflect

Problem seven compares two orders of the same two moves. R is the rotation of the plane by a quarter turn, counterclockwise, and F is the reflection across the x axis. Part a asks for the standard matrices of R and F. R turns e one into e two, which is (zero, one), and e two into minus e one, which is (minus one, zero). Those are the columns of R. F keeps e one where it is, and flips e two to minus e two. So F has columns (one, zero) and (zero, minus one).

Part b asks for R F and F R, and whether R and F commute. R F, times x, is R, times F x. The matrix on the right acts first. So R F means: first reflect, then rotate. And F R means: first rotate, then reflect. Now R F, by the row column rule. Entry one one: row one of R is (zero, minus one), column one of F is (one, zero), and together they give zero. Entry one two: the same row, times (zero, minus one), gives one. Entry two one: row two of R is (one, zero), the column is still (one, zero), and together they give one. Entry two two: (one, zero), times (zero, minus one), gives zero. So R F has rows (zero, one), and (one, zero).

Now F R. Entry one one: row one of F is (one, zero), column one of R is (zero, one), and together they give zero. Entry one two: the same row, times (minus one, zero), gives minus one. Entry two one: row two of F is (zero, minus one), the column is still (zero, one), and together they give minus one. Entry two two: (zero, minus one), times (minus one, zero), gives zero. So F R has rows (zero, minus one) and (minus one, zero). The two products are different, so R and F do not commute. The order of the moves matters.

Part c asks us to describe these maps, and to draw v equal to (three, one), with R F v and F R v. R F sends a vector with entries x and y to the vector with entries y and x: it swaps the coordinates. That is the reflection across the line y equals x. And F R sends it to the vector with entries minus y and minus x. That is the reflection across the other diagonal, the line y equals minus x. Let's follow the vector v, equal to (three, one), through both. First reflect, then rotate: F v is (three, minus one), and rotating that gives (one, three). That is R F v, the mirror image of v in the line y equals x.

First rotate, then reflect: R v is (minus one, three), and reflecting that gives (minus one, minus three). That is F R v, the mirror image of v in the line y equals minus x. Notice that the two images point in opposite directions: F R v is minus R F v. That holds for every vector, because the matrix F R is minus the matrix R F. Part d asks for R squared and R to the fourth. R squared is two quarter turns, that is, a half turn, which should send every vector x to minus x. Let's multiply.

Row one of R is (zero, minus one), and with the two columns of R it gives minus one and zero. Row two, (one, zero), gives zero and minus one. So R squared is minus the identity. And R to the fourth is R squared times R squared, minus I times minus I, which is the identity. Four quarter turns make a full turn, and a full turn moves nothing. One more check of part c. R F is a reflection, so applying it twice should change nothing. Let's square it.

Row one of R F is (zero, one), and with the two columns of R F it gives one and zero. Row two, (one, zero), gives zero and one. So R F squared is the identity, as a reflection should be.

Problem 9: inverting by Gauss-Jordan

Problem nine. Find the inverse of the three by three matrix A, with first row (one, two, one), second row (zero, one, zero), and third row (two, four, three). Part a asks for A inverse by Gauss Jordan elimination, and for a check that A times A inverse is the identity. As in lecture sixteen, we write A and the identity side by side, and row reduce the whole block. If the left block becomes the identity, the right block is A inverse. The first pivot is the one in the top left. Row two already has a zero below it, so only row three needs work. We replace row three by row three minus two times row one.

On the left: two minus two is zero, four minus four is zero, and three minus two is one. On the right: zero minus two is minus two, zero minus zero is zero, and one minus zero is one. The left block is now upper triangular, with ones on the diagonal, so all three pivots are in place. The backward phase clears the entries above the pivots, starting from the bottom. Above the third pivot, row two already has a zero, and row one has a one. So we replace row one by row one minus row three.

On the left: one minus zero is one, two minus zero is two, and one minus one is zero. On the right: one minus minus two is three, zero minus zero is zero, and zero minus one is minus one. Last, the two above the second pivot. We replace row one by row one minus two times row two. On the left: one minus zero is one, two minus two is zero, and zero minus zero is zero. On the right: three minus zero is three, zero minus two is minus two, and minus one minus zero is minus one.

The left block is now the identity. So the right block is A inverse, with first row (three, minus two, minus one), second row (zero, one, zero), and third row (minus two, zero, one). Why does this work? The columns of A inverse are the solutions of A x equals e one, e two and e three. The same row operations solve all three systems at once, so we write the whole identity beside A. Let's check that A times A inverse is the identity, one row of A at a time.

Row one of A is (one, two, one). Times the first column of the inverse: three plus zero minus two is one. Times the second: minus two plus two plus zero is zero. Times the third: minus one plus zero plus one is zero. Row two is (zero, one, zero), so it picks out the middle entry of each column. Times the three columns, it gives zero, then one, then zero. Row three is (two, four, three). Times the three columns: six plus zero minus six is zero, minus four plus four plus zero is zero, and minus two plus zero plus three is one. So the product is the identity.

Part b asks us to solve A x equals (two, one, five), with A inverse. We multiply both sides on the left by A inverse. Then x equals A inverse, times b. In the first entry, six minus two minus five is minus one. In the second, zero plus one plus zero is one. In the third, minus four plus zero plus five is one. So x is (minus one, one, one). Check: A times (minus one, one, one). In the first entry, minus one plus two plus one is two. In the second, zero plus one plus zero is one. In the third, minus two plus four plus three is five.

For a single system like this one, row reducing A next to b is less work. The inverse pays off when the same matrix meets many right hand sides. Part c runs the same method on B, with first row (one, two, one), second row (two, five, three), and third row (one, three, two). Row two minus two times row one gives (zero, one, one) on the left, and (minus two, one, zero) on the right.

Then row three minus row one gives (zero, one, one) on the left, and (minus one, zero, one) on the right. Then row three minus row two. On the left, (zero, one, one) minus (zero, one, one) is a row of zeros. On the right, minus one minus minus two is one, zero minus one is minus one, and one minus zero is one. A zero row on the left can never turn into a row of the identity. The third column has no pivot, so B x equals zero has a free variable, and a nonzero solution. Taking z equal to one, row two gives y equal to minus one, and row one gives x equal to one: the vector (one, minus one, one).

Check: B times that vector. In the first entry, one minus two plus one is zero. In the second, two minus five plus three is zero. In the third, one minus three plus two is zero. And a matrix that sends a nonzero vector to zero has no inverse. If B had an inverse, applying it to both sides of B x equals zero would give x equals zero, but our x is not zero. So B is not invertible, and Gauss Jordan elimination tells us so by itself.

Problem 11: true or false?

Problem eleven gives four statements about real n by n matrices, with n at least two, and about linear maps. For each one, decide whether it is true or false. A true statement needs a proof, and a false one needs a counterexample. Statement a. If T is linear, and T of u equals T of v for two different vectors u and v, then T sends some nonzero vector to zero. True. Take w equal to u minus v. It is not zero, because u and v are different. By the two rules of linearity, T of u minus v is T of u, minus T of v, which is zero.

For example, the projection P from problem five sends (three, minus one), and (two, one), to the same point, (two, one). So it sends their difference, (one, minus two), to zero. The converse holds too. If T sends a nonzero vector w to zero, then T of u plus w is T of u plus zero, which is T of u. So the two different vectors u and u plus w have the same image. Statement b. If A B is the zero matrix, then A is zero, or B is zero.

False. Take A with rows (one, two) and (two, four), and B with rows (two, minus four) and (minus one, two). Neither is the zero matrix. Entry one one of A B is two minus two, zero. Entry one two is minus four plus four, zero. Entry two one is four minus four, zero. And entry two two is minus eight plus eight, zero. The reason: both columns of B are multiples of (two, minus one), and A sends (two, minus one) to zero. For matrices, a product can be zero even when neither factor is.

Statement c. If A squared is the identity, then A is the identity, or minus the identity. False, and problem seven already gave us a counterexample: the reflection F. Reflecting twice moves nothing, so F squared should be the identity. Let's confirm by multiplying. F has rows (one, zero) and (zero, minus one). Entry one one of F squared is one. Entry one two is zero. Entry two one is zero. And entry two two is minus one times minus one, which is one.

So F squared is the identity, but F is neither the identity nor minus the identity. For numbers, a squared equals one forces a to be one or minus one. For matrices, every reflection is a square root of the identity. Why does the argument for numbers break down? From a squared equals one, we get a minus one, times a plus one, equals zero, and for numbers one of the two factors must be zero. For matrices, A minus I, times A plus I, is still A squared minus I, the zero matrix. But by statement b, a product of matrices can be zero while neither factor is.

For F, F minus I has rows (zero, zero) and (zero, minus two), and F plus I has rows (two, zero) and (zero, zero). Neither is zero, but their product is the zero matrix: every row of the first, times every column of the second, gives zero. Statement d. If A B is invertible, then A is invertible. True. Call the inverse of A B, X. Then A B, times X, is the identity.

By associativity, A B, times X, is A times B X. So A, times the square matrix B X, is the identity. And from lecture sixteen: for square matrices, one product is enough. If A times some square matrix is the identity, then A is invertible, and that matrix is its inverse. So A is invertible, with inverse B X. The same idea, with X on the left, shows that B is invertible too.

Problem 12: idempotents

Problem twelve introduces a new word. A square matrix P is called idempotent if P squared equals P. The projection from problem five is an example: projecting twice is the same as projecting once. Part a. Suppose P is idempotent. Prove that I minus P is idempotent too, and that P times I minus P is the zero matrix. These proofs use only the rules of matrix algebra from lecture fourteen, one at a time, so take them slowly, and feel free to pause or rewatch them.

I minus P, squared, is I minus P, times I minus P. The distributive laws expand it into I times I, minus I times P, minus P times I, plus P squared. The identity changes nothing, so that is I minus P minus P plus P squared. And P squared is P, by assumption. So we get I minus two P plus P, which is I minus P. Next, P times I minus P is P times I, minus P squared, which is P minus P, the zero matrix. And in the same way, I minus P, times P, is P minus P squared, which is also zero.

Part b. Show that S equals two P minus I satisfies S squared equals I. Expand: two P minus I, times two P minus I, is four P squared, minus two P, minus two P, plus I. With P squared equal to P, that is four P minus four P plus I, which is I. This is problem five, part e, again, but now for every idempotent at once: for the projection onto a line, S is the reflection across it, and reflecting twice is the identity.

For the projection from problem five, two P minus I is two fifths times the matrix with rows (four, two) and (two, one), minus I. That gives one fifth times the matrix with rows (three, four) and (four, minus three): the reflection S we found there. Part c. Prove that the only invertible idempotent matrix is the identity. Suppose P is invertible, and P squared equals P. Multiply both sides on the left by P inverse. The right side becomes P inverse P, which is I. The left side is P inverse, times P P. By associativity, that is P inverse P, times P, which is I times P, that is P. So P equals I.

So every other idempotent, like a projection onto a line, has no inverse. Geometrically, it flattens the whole plane onto the line, and no map can undo that. Part d asks for Q equals I minus P, for the projection P from problem five, and for Q x when x is (three, minus one). First we compute Q equals I minus P. Entry by entry. In the top left, one minus four fifths is one fifth. In the top right, zero minus two fifths is minus two fifths. In the bottom left, also minus two fifths. And in the bottom right, one minus one fifth is four fifths.

Take x equal to (three, minus one) again. Its projection onto L is P x, which we found in problem five: (two, one). And Q x is x minus P x, that is the vector (three, minus one), minus the vector (two, one), which is (one, minus two). So x splits into two parts: P x, equal to (two, one), along the line L, and Q x, equal to (one, minus two), perpendicular to it. To check that they are perpendicular, take the dot product of Q x and P x: one times two, plus minus two times one, is zero. So Q is a projection too: onto the line through the origin perpendicular to L. That line has the direction w, equal to (one, minus two), just as L has the direction u. With w in place of u, the formula from problem five gives one fifth times the matrix with rows (one, minus two) and (minus two, four), which is exactly Q.

And part a says the rest in algebra. Q is idempotent, like every projection, and P times Q is zero: projecting onto L a vector that lies on the perpendicular line gives the zero vector. Let's confirm with numbers that Q is idempotent. Q squared is one twenty fifth, times the square of the matrix with rows (one, minus two) and (minus two, four). The top left entry is one plus four, five. The top right is minus two minus eight, minus ten. The bottom left is also minus ten. And the bottom right is four plus sixteen, twenty.

Five, minus ten, minus ten, and twenty are five times one, minus two, minus two, and four. So Q squared is five twenty fifths, that is one fifth, times that matrix, which is Q.

Wrap-up

Let's collect what today's problems taught us. To find the standard matrix of a linear map, find the images of e one up to e n, and use them as the columns. If you only know the map on other vectors, build the standard basis vectors from those, and use linearity. A product of matrices is the matrix of one move after another, with the right factor acting first. So R F and F R can be different maps, and usually they are.

To invert a matrix, row reduce it next to the identity. If the left block becomes the identity, the right block is the inverse. If a zero row appears on the left, there is no inverse. And in proofs, the rules of matrix algebra are all you need, as long as you keep every product in its order. Before we finish, here are five mistakes that come up again and again with this week's material. Watch for them in your own work.

First, multiplying in the wrong order. In A B, the matrix B acts first. So to do B and then A, write A B, not B A. Second, using the algebra of numbers. A plus B, squared, is A squared plus A B plus B A plus B squared, and that is not A squared plus two A B plus B squared unless A and B commute. And A B equal to zero does not make either factor zero. Third, the transpose of a product. The transpose of A B is B transpose times A transpose, in the reverse order. The same holds for inverses: the inverse of A B is B inverse times A inverse.

Fourth, cancelling without an inverse. From A B equals A C, you may conclude that B equals C only when A is invertible. Then you multiply both sides on the left by A inverse. Fifth, mismatched sizes. A B is defined only when A has as many columns as B has rows. So before you multiply, write down the sizes. Keep these five in mind, and most of the sheet will go smoothly.

The rest of sheet four is yours to try. Problem eight shows why A plus B, squared, needs care, problem ten inverts a block matrix, problem thirteen inverts I minus A when a power of A is zero, and problem fourteen rotates a picture about a point, the way computer graphics does it. Next week, in lectures seventeen to twenty, we prove the invertible matrix theorem, factor matrices with L U, and meet subspaces, bases and dimension. See you there.

In this recitation

  1. Problem 5: projection and reflection
  2. Problem 6: a linear map from two values
  3. Problem 7: rotate and reflect
  4. Problem 9: inverting by Gauss–Jordan
  5. Problem 11: true or false?
  6. Problem 12: idempotents
  7. Wrapping up

Materials

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