Recitation 5 · Week 5· 32:27
Problem Sheet 5, worked through
The marked problems of Sheet 5, 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 17 to 20.
Saved in this browser only. No account needed.
TranscriptThe full text of the recitation. Click any sentence to play the video from there.
Recitation 5
Welcome to recitation five. This week, lecture seventeen proved the invertible matrix theorem, lecture eighteen wrote elimination as a factorisation, A equals L U, lecture nineteen introduced subspaces, the column space and the null space, and lecture twenty measured subspaces with bases and dimension. Problem Sheet five covers lectures seventeen to twenty. We will solve the seven problems marked with the play symbol: problems five, six, seven, nine, ten, eleven and twelve. The other seven 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. For a square matrix A, the invertible matrix theorem lists twelve statements, and they are all true, or all false. So checking any one of them settles all the others. If elimination needs no row swaps, it factors A as L times U. U is the echelon form, and L is unit lower triangular and holds the multipliers. To solve A x equals b, we solve L y equals b, and then U x equals y. A subspace contains zero, and it is closed under addition and under scalar multiplication. The column space of A is the span of its columns, and the null space is the set of solutions of A x equals zero.
A basis of a subspace is a list of vectors that is linearly independent and spans it. Every basis has the same number of vectors, and that number is the dimension. One habit carries us through today: translate the question. Is b in the column space? That means: can we solve A x equals b? Is x in the null space? That means: is A x zero? Once the question is a system, we know what to do.
Problem 5: the invertible matrix theorem
Problem five. We use the invertible matrix theorem to decide which of these matrices are invertible, without computing any inverse. For each one, we name the statement of the theorem that we use. Part a asks about the matrix A, with first row (two, one, four), second row (one, three, minus one), and third row (zero, five, minus six). Before row reducing, look for a pattern in the rows. Take two times row two, minus row one. In the first entry, two minus two is zero. In the second, six minus one is five. In the third, minus two minus four is minus six. That is exactly row three.
So two replacements, row three minus two times row two, and then plus row one, turn row three into a row of zeros. An echelon form of A has at most two pivots. Statement four, three pivot positions, fails, and A is not invertible. Part b asks about the matrix B, which is lower triangular. It is not in echelon form, but its transpose is: the transpose is upper triangular, with diagonal entries (three, minus two, one). Those are three nonzero pivots, so the transpose has three pivot positions, and it is invertible. That is statement eleven for B, so B is invertible.
Part c asks about the matrix C, with first row (two, minus one, minus one), second row (zero, three, minus three), and third row (one, one, minus two). Notice that each row adds up to zero. Adding up the entries of a row is the same as multiplying the row by the column (one, one, one). So we compute C times that column. In the first entry, two minus one minus one is zero. In the second, zero plus three minus three is zero. In the third, one plus one minus two is zero. So C sends the nonzero vector (one, one, one), to zero. C x equals zero has a nontrivial solution, statement three fails, and C is not invertible.
Part d asks about an n by n matrix D, and all we know is that D squared equals D plus I. Subtract D from both sides: D squared minus D equals I. By the distributive law, the left side is D times, D minus I. So D, times the matrix D minus I, is the identity. That is statement ten, with D minus I as the matrix there. So D is invertible, and its inverse is D minus I. Part e asks for which numbers h the matrix M h is invertible. It has first row (one, one, two), second row (one, two, h), and third row (two, three, five). We row reduce, and count pivots.
Replace row two by row two minus row one: that gives (zero, one, h minus two). Replace row three by row three minus two times row one: that gives (zero, one, one). Then replace row three by row three minus row two. In the second entry, one minus one is zero. In the third, one minus, h minus two, is three minus h. If three minus h is not zero, there are three pivots, and M h is invertible. If h equals three, the last row is zero, and M three is not invertible. So M h is invertible for every h except three.
Problem 6: LU factorisation
Problem six is about the L U factorisation. Part a asks us to factor the matrix A, with first row (two, one, three), second row (four, five, seven), and third row (minus two, five, one). We reduce A to an echelon form using row replacements only, and we record each multiplier as we go. The first pivot is two. To clear the four below it, we replace row two by row two minus two times row one. The multiplier is two, so L two one is two.
In the first column, four minus four is zero. In the second, five minus two is three. In the third, seven minus six is one. To clear the minus two, we replace row three by row three minus, minus one, times row one. That is, we add row one. The multiplier is minus one, so L three one is minus one. In the first column, minus two plus two is zero. In the second, five plus one is six. In the third, one plus three is four.
The second pivot is three, and below it sits a six. We replace row three by row three minus two times row two, so L three two is two. In the second column, six minus six is zero, and in the third, four minus two is two. This is U: upper triangular, with pivots two, three and two. And L has ones on the diagonal, and the multipliers below it: two and minus one in the first column, and two in the second.
Let's check that L times U is A, by the row column rule. Row one of L is (one, zero, zero), so row one of L U is row one of U, which is (two, one, three). Row two of L is (two, one, zero). Times the first column of U, four plus zero is four. Times the second, two plus three is five. Times the third, six plus one is seven. Row three of L is (minus one, two, one). Times the first column, minus two plus zero plus zero is minus two. Times the second, minus one plus six plus zero is five. Times the third, minus three plus two plus two is one. So L U is A.
Part b asks us to solve A x equals b, first for b equal to (four, six, minus six), and then for b equal to (two, eight, eight). Since A is L U, the system reads L times U x equals b. Call U x, y. First we solve L y equals b, and then U x equals y. L y equals b, by forward substitution, from the top. y one is four. Next, two y one plus y two is six, so y two is six minus eight, which is minus two. Then minus y one plus two y two plus y three is minus six, so y three is minus six plus four plus four, which is two. Now U x equals y, by back substitution, from the bottom. Two x three is two, so x three is one. Three x two plus x three is minus two, so x two is minus one. And two x one plus x two plus three x three is four, so two x one is four plus one minus three, which is two, and x one is one.
So x is (one, minus one, one). Check: A times that vector. In the first entry, two minus one plus three is four. In the second, four minus five plus seven is six. In the third, minus two minus five plus one is minus six. The second right hand side is (two, eight, eight). The factorisation is already done, so we only need the two triangular solves. Forward: y one is two, y two is eight minus four, which is four, and y three is eight plus two minus eight, which is two. Back: x three is one. Three x two is four minus one, so x two is one. And two x one is two minus one minus three, so x one is minus one.
So x is (minus one, one, one). This is the point of L U: we factor once, and every new right hand side costs only two quick triangular solves. Part c asks about the matrix B, with first row (zero, two, one), second row (one, one, zero), and third row (two, four, three). Why does it have no L U factorisation, and how do we factor it after a row swap? Elimination cannot start: the pivot position at the top left holds a zero, and row replacements never change row one. So without a swap, there is never a pivot there.
In matrix terms: if B were L U, then row one of B would be row one of U, so u one one would be zero. Entry two one of L U is L two one times u one one, plus u two one, and both terms are zero. But entry two one of B is one. So we swap rows one and two first. The swap is recorded in a permutation matrix P: the identity, with rows one and two swapped. Then P B has first row (one, one, zero), second row (zero, two, one), and third row (two, four, three). Now we eliminate. Row three minus two times row one gives (zero, two, three), with multiplier two. Then row three minus row two gives (zero, zero, two), with multiplier one.
So P B equals L U. U is the echelon form we just reached, with pivots one, two and two, and L has the multipliers two and one in its last row.
Problem 7: null space and column space
Problem seven. A is the three by four matrix with first row (one, two, zero, three), second row (two, four, one, four), and third row (minus one, minus two, one, minus five). We want bases of its null space and its column space. Part a asks for the reduced row echelon form of A. We replace row two by row two minus two times row one, and row three by row three plus row one. Row two becomes (zero, zero, one, minus two): two minus two, four minus four, one minus zero, and four minus six. Row three becomes the same row, (zero, zero, one, minus two): minus one plus one, minus two plus two, one plus zero, and minus five plus three.
Then row three minus row two is a row of zeros. The pivots are in columns one and three, and the matrix is already reduced. Call it R. Part b asks for a basis of the null space, and its dimension. A x equals zero has the same solutions as R x equals zero. The pivot variables are x one and x three. The free variables, x two and x four, we call s and t. Row one of R says x one plus two x two plus three x four is zero, so x one is minus two s minus three t. Row two says x three minus two x four is zero, so x three is two t.
Now split x by the parameters. The first entry is minus two s minus three t. The second is s. The third is two t. The fourth is t. So x is s times (minus two, one, zero, zero), plus t times (minus three, zero, two, one). These two vectors span the null space. Are they independent? Look at entries two and four, the free variables. The first vector has one and zero there, and the second has zero and one. So a combination is zero only when s and t are both zero. So these two vectors form a basis of the null space, and its dimension is two: one basis vector for each free variable.
A quick check of the second one: A times (minus three, zero, two, one). In the first entry, minus three plus zero plus zero plus three is zero. In the second, minus six plus zero plus two plus four is zero. In the third, three plus zero plus two minus five is zero. Part c asks for a basis of the column space, and whether it equals the column space of R. The pivot columns of A, columns one and three, form a basis: the vector (one, two, minus one), and the vector (zero, one, one). So the column space has dimension two. Careful: we take the columns of A, not of R. R tells us where the pivots are, and how the other columns depend on them. Column two of R is two times column one, so column two of A is two times column one of A.
And column four of R is three times column one, minus two times column three. So column four of A is three times the vector (one, two, minus one), minus two times the vector (zero, one, one). In the first entry, three minus zero is three. In the second, six minus two is four. In the third, minus three minus two is minus five. But the column spaces of A and R are different. Every column of R ends in zero, so Col R is the plane where the third entry is zero. Column one of A ends in minus one, so it is not in Col R. Row operations keep the relations between the columns, but they change the columns themselves. That is why the basis is taken from A, in the pivot positions that R shows us.
Part d asks whether b, equal to (one, three, zero), and e one are in the column space. For b, we try x times column one, plus y times column three. The first entry gives x equals one. The second gives two plus y equals three, so y is one. Then the third entry must be minus one plus one, which is zero. It is. So b is column one plus column three, and b is in the column space. What about e one, equal to (one, zero, zero)? Again x is one. The second entry gives two plus y equals zero, so y is minus two. Then the third entry would be minus one minus two, which is minus three, not zero. So e one is not in the column space, even though it is the first column of R.
Problem 9: a basis of a plane
Problem nine. H is the set of vectors in R three whose entries x, y and z satisfy x plus two y minus z equals zero. It is a plane through the origin. Part a asks us to write H as a null space, find a basis of H, and give its dimension. This is one homogeneous equation, so H is the null space of the one by three matrix (one, two, minus one). It is already reduced. x is the pivot variable, and y and z are free: call them s and t. Then x is minus two s plus t.
Splitting by the parameters: the first entry is minus two s plus t, the second is s, and the third is t. So the vector is s times (minus two, one, zero), plus t times (one, zero, one). Call these b one and b two. They span H, and they are independent, because of their entries in the free positions. So they form a basis of H, and H has dimension two, as a plane should. Part b asks us to check that v, equal to (one, one, three), lies in H, and to write it in our basis. One plus two times one, minus three, is zero. So v is in H.
To write v in the basis, read off its free entries: y is one, and z is three. So v is one times b one, plus three times b two. Check: in the first entry, minus two plus three is one. In the second, one plus zero is one. In the third, zero plus three is three. Part c asks us to exchange one basis vector for v, so that the new list is still a basis of H. This is the exchange idea from lecture twenty: v can replace any basis vector whose weight in v is not zero.
Here both weights, one and three, are nonzero, so either one can go. Let's replace b one. The new list is v and b two. Why is it still a basis? It spans H: from v equals b one plus three b two, we get b one equals v minus three b two. So b one is in the span of v and b two, and then so is everything that b one and b two span. And it is independent: v and b two are not multiples of each other. Their second entries are one and zero, and b two is not zero. So the new list is a basis of H.
Part d asks us to extend the basis of part a to a basis of R three. We add a vector that is not in H. The simplest try is e one. One plus zero minus zero is one, not zero, so e one is not in H. Adding a vector that is outside the span keeps the list independent. So b one, b two and e one are three independent vectors in R three, which has dimension three, and they form a basis of R three. Part e asks whether the three vectors b one, b two and v form a basis of R three. No. All three lie in the plane H, and v is b one plus three b two. Three vectors in a plane of dimension two can never be independent.
Problem 10: two pictures
Problem ten. A is the two by two matrix with rows (two, minus one), and (minus four, two). Part a asks for a basis and the dimension of the null space, and of the column space. We replace row two by row two plus two times row one. Minus four plus four is zero, and two minus two is zero. So row two becomes a row of zeros. There is one pivot, in column one, and y is free. Call it t. Row one says two x minus y is zero, so x is t over two.
To avoid the fraction, take t equal to two s. Then the vector is s times (one, two). So the null space is the line spanned by (one, two), and its dimension is one. For the column space, take the pivot column of A itself: (two, minus four). It is a basis, so the column space has dimension one too. The second column, (minus one, two), is minus one half times the first, so it adds nothing new. Part b asks whether A is invertible, and for two statements of the theorem that fail. It is not invertible. Statement three fails, because A x equals zero has the nontrivial solution (one, two). And statement eight fails, because the columns span only a line, not the whole plane.
Part c asks for all solutions of A x equals the vector (three, minus six), and why there are none for the vector (one, one). The second equation is minus two times the first, so the system is the single equation two x minus y equals three. Taking x equal to zero gives y equal to minus three, so p, equal to (zero, minus three), is one solution. Check: A times p. In the first entry, zero plus three is three. In the second, zero minus six is minus six. Adding any vector of the null space gives another solution, because A sends it to zero. So the solutions are p plus s times (one, two): a line through p, parallel to the null space.
Now the vector (one, one). Every vector in the column space is a multiple of (one, minus two), so its second entry is minus two times its first. For (one, one), the second entry is one, not minus two. So the vector (one, one), is not in the column space, and there is no solution. Part d asks for two pictures of all this. On the left is the input plane, where x lives. The null space is the violet line through the origin, along (one, two). The solutions of A x equals the vector (three, minus six), form the dashed line through the point (zero, minus three), parallel to it. On the right is the output plane, where A x lives. The column space is the blue line along (one, minus two). The vector (three, minus six), lies on it, and the vector (one, one), does not.
Now read the two pictures together. A sends the whole input plane onto the blue line. It sends the violet line to zero, and the whole dashed line to the single point (three, minus six). Nothing is sent to the point (one, one), because it is off the blue line. This is part b again, in pictures. In part b, we found that A is not invertible, because two statements of the theorem fail. Statement three fails: A x equals zero has the nontrivial solution (one, two). So A squashes the whole violet line to zero, and that cannot be undone. Statement eight fails: the columns of A span only the blue line, and not the whole plane. So the outputs fill only a line, and A cannot reach every vector, for example the point (one, one). For a square matrix, these two failures always come together.
Problem 11: true or false?
Problem eleven gives four statements. 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 A is three by three, and the systems A x equals e one, and A x equals e two, both have solutions, then A is invertible. False. Take A with first row (one, zero, zero), second row (zero, one, zero), and third row (zero, zero, zero). A sends e one to e one, and e two to e two, so both systems have solutions.
But its third column is zero, so A times e three is zero. A x equals zero has a nontrivial solution, statement three fails, and A is not invertible. With a third solution, for e three, the statement becomes true. Put the three solutions side by side, as the columns of a matrix X. Column j of A X is A times x j, which is e j. So A X is the identity, and by statement ten, A is invertible. Statement b. If H is a subspace, and v is a vector that is not in H, then the shifted set, v plus H, is not a subspace.
True. Suppose it were a subspace. Then it would contain zero, so zero equals v plus h, for some h in H. Then v equals minus h, which is minus one times h. H is closed under scalar multiplication, so v is in H. But v is not in H. So the assumption is false, and v plus H is not a subspace. For example, the solution set of A x equals b, with b not zero, is a particular solution plus the null space: a shifted copy of the null space. So it is never a subspace.
Statement c. Every square matrix with an L U factorisation is invertible. False. The matrix with rows (one, two), and (two, four), factors as L U: L has rows (one, zero), and (two, one), and U has rows (one, two), and (zero, zero). Check the second row of L U: two times the row (one, two), plus one times the row (zero, zero), is the row (two, four). But the matrix is not invertible: its second column is twice the first.
An L U factorisation only says that elimination needed no swaps. Invertibility depends on whether U has a pivot in every column, and this U has a zero row. Statement d. If u, v, w is a basis of R three, then so is the list u, u plus v, u plus v plus w. True. In R three, which has dimension three, three independent vectors always form a basis. So we only need to check independence.
Suppose a times u, plus b times u plus v, plus c times u plus v plus w, is zero. Collect the terms: a plus b plus c, times u, plus b plus c, times v, plus c times w, is zero. Since u, v, w are independent, all three weights are zero. So c is zero. Then b plus c is zero gives b equals zero. And then a is zero too. So the new list is independent, and it is a basis.
Problem 12: column spaces and null spaces of a product
Problem twelve. A is m by n, and B is n by p, so the product A B is defined. Part a asks us to prove that the column space of A B is contained in the column space of A. To prove that one set lies inside another, take any element of the first set, and show that it is in the second. So let y be in the column space of A B. Then y is A B times some vector x. By associativity, that is A times B x.
And B x is a vector in R n. So y is A times a vector, and that means y is in the column space of A. In words: everything that A B can reach, A can reach too, because A B first moves x to B x, and then A finishes the job. Part b asks us to prove that the null space of B is contained in the null space of A B. Let x be in the null space of B, so B x is zero. Then A B x is A times zero, which is zero. So x is in the null space of A B.
Part c asks for examples where the two spaces differ. Take A equal to the identity, and B with rows (one, zero), and (zero, zero). Then A B is B. Its column space is the line spanned by e one, while the column space of A is all of R two. For the null spaces, swap the roles: A with rows (one, zero), and (zero, zero), and B equal to the identity. The null space of B is just zero. But A B is A, and its null space is the line spanned by e two. Part d. Now A and B are n by n, and A B is invertible. We prove that A and B are invertible too. This argument combines several results, so take it one step at a time, and pause if you need to.
Since A B is invertible, the invertible matrix theorem tells us two things. By statement eight, its columns span R n: the column space of A B is R n. And by statement three, its null space is just zero. Now part a. R n is the column space of A B, which lies inside the column space of A, which lies inside R n. So the column space of A is all of R n. The columns of A span R n, and by statement eight, A is invertible. And part b. The null space of B lies inside the null space of A B, which is just zero. So B x equals zero has only the trivial solution, and by statement three, B is invertible.
This is proposition three point six point fourteen in the book, which lecture seventeen proved with one sided inverses. Here we proved it a second way, through subspaces.
Wrap-up
Let's collect what today's problems taught us. For a square matrix, one statement of the invertible matrix theorem settles all twelve. Pick the one that is easiest to check: a pattern in the rows or columns, a vector sent to zero, or a one sided inverse. An L U factorisation stores elimination. Factor once, and then each right hand side costs one forward and one back substitution.
A basis of the null space comes from the free variables, one vector for each. A basis of the column space comes from the pivot columns of the original matrix. And a basis can be changed one vector at a time: a new vector can replace any basis vector that has a nonzero weight in it. 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, taking the basis of the column space from the reduced matrix. Row operations change the column space, so use the pivot columns of A itself. Second, using the invertible matrix theorem for a matrix that is not square. For a two by three matrix, spanning and independence are different questions. Third, calling a set a subspace without checking that it contains zero. A line or a plane that misses the origin is never a subspace, and neither is the solution set of A x equals b, with b not zero.
Fourth, mixing up where the two spaces live. The null space of an m by n matrix lives in R n, among the inputs. The column space lives in R m, among the outputs. Fifth, forgetting that L U needs no swaps. If a zero sits in a pivot position, swap first, and factor P A as L U. Keep these five in mind, and most of the sheet will go smoothly.
The rest of sheet five is yours to try. Problems one to four are warm ups. Problem eight writes a matrix as a product of elementary matrices, problem thirteen proves that the L U factorisation of an invertible matrix is unique, and problem fourteen finds the traffic loops in a road network. Next week, in lectures twenty one to twenty four, we meet vector spaces in general: polynomials, matrices and functions become vectors too. See you there.
In this recitation
- Problem 5: the invertible matrix theorem
- Problem 6: LU factorisation
- Problem 7: null space and column space
- Problem 9: a basis of a plane
- Problem 10: two pictures
- Problem 11: true or false?
- Problem 12: column spaces and null spaces of a product
- Wrap-up