This set practises three lessons: the inverse part of matrix multiplication and inverse matrices (Lecture 3), the factorization A = LU (Lecture 4) and transposes, permutations and vector spaces (Lecture 5). The ways of multiplying matrices in Lecture 3 belong to Problem Set 1.
MIT's 18.06 problem sets assign exercises from a textbook that is not openly licensed, so this set is made of our own problems on the same lectures, in MIT's lecture order. No MIT or textbook problem is used: every matrix and every number below is ours, and so are the hints and the solutions. The formulas come from the lessons and from the lecture transcripts they cite.
How to answer#
Work each problem on paper first. Then type or choose your result in the answer box and press Check.
A number box wants a decimal number, not a fraction: write , not . Every number box accepts any value within of the exact one, so give at least two decimal places when the answer is not a whole number (Problem 4 says its own tolerance). Unless a box asks for more digits, give 3 significant figures and keep 4 in intermediate steps; an answer with only 2 significant figures may or may not be accepted. A matrix cannot be typed: a box asks for one of its entries, or you choose from a list. Entries are numbered by row, then column, starting from 1: the entry is in the second row, third column.
A formula box takes plain typing, for example (2*t - 1)/(t + 3), and accepts every correct way of writing the answer. Type the multiplier as l21, and likewise l31 and l32.
Some parts ask you to show something. They have no answer box: write your argument, then open the solution and mark yourself. MIT gives no points for these problems: the points here (100 in all) and their split between the parts are ours. If you are stuck, open the hints one at a time. Each part ends with its full solution. Try before you open it: an answer given after its solution was opened earns no points. Your score is kept in this browser only.
What you need from the lessons#
Inverses (Lecture 3). A square matrix is invertible when some matrix gives
In words
capital A to the power minus 1 capital A equals capital I equals capital A capital A to the power minus 1
If for some nonzero , there is no inverse (pp. 14–16). Gauss–Jordan finds by eliminating on the augmented matrix : downwards as usual, then upwards, then dividing each row by its pivot, until the left half is (pp. 19–22). All the steps together are one matrix , and says :
In words
E ( capital A capital I ) equals ( E capital A E ) equals ( capital I capital A to the power minus 1 )
Products, transposes and A = LU (Lecture 4). Inverses and transposes of a product come in reverse order, and inverting and transposing can be done in either order:
In words
( capital A capital B ) to the power minus 1 equals capital B to the power minus 1 capital A to the power minus 1, ( capital A to the power minus 1 )^ capital T equals ( capital A ^ capital T ) to the power minus 1
Elimination without row exchanges is , where subtracts the multiplier times row 1 from row 2, subtracts times row 1 from row 3, and subtracts times row 2 from row 3. Taking the inverses across, in reverse order, gives
In words
capital A equals E two one to the power minus 1 E three one to the power minus 1 E three two to the power minus 1 U equals L U
is lower triangular with ones on its diagonal and the multipliers below it, untouched; the forward product mixes them (pp. 9–12). has the pivots on its diagonal; dividing each row of by its pivot gives , with the pivots in the diagonal matrix (pp. 6–7). Elimination on a full matrix costs about
In words
n squared plus the quantity n minus 1, all squared plus and so on plus 2 squared plus 1 squared is approximately one third n cubed
operations (a multiply and a subtract each), and each right-hand side afterwards about (p. 19).
Permutations and transposes (Lecture 5). A permutation matrix is the identity with its rows reordered; there are of size (pp. 3–4; first met at the end of Lecture 4, pp. 20–23). With row exchanges, elimination is , and every permutation has :
In words
capital P capital A equals L U, capital P to the power minus 1 equals capital P ^ capital T
The transpose flips a matrix across its diagonal, ; is symmetric when , and is symmetric for every rectangular (pp. 5–9).
Vector spaces (Lecture 5). A vector space is closed under addition and under multiplication by every real number, so every linear combination stays inside; every vector space and every subspace contains the zero vector (pp. 10–16). The subspaces of are , the planes and the lines through the origin, and the zero vector alone (p. 17). The column space is the set of all combinations of the columns of (pp. 18–20).
Problem 1#
Inverses by Gauss–Jordan
Take
In words
capital A equals 1 1 0; 2 3 1; 1 2 2
(a)8 points
Find by Gauss–Jordan elimination on . Give its , and entries.
Hint
Clear the first column below the first pivot, then the second column below the second pivot. Apply every row operation to all six columns of .
Hint
When the left half is upper triangular, go upwards: use row 3 to clear the entry above the third pivot, then row 2 to clear the entry above the second pivot. Here every pivot is , so no division is needed at the end.
Solution
The idea. Elimination that turns into turns into , because all the steps together are .
Downwards
Subtract times row 1 from row 2 and times row 1 from row 3; then subtract row 2 from row 3:
In words
( c c c c c c 1 1 0 1 0 0; 2 3 1 0 1 0; 1 2 2 0 0 1 ) goes to ( c c c c c c 1 1 0 1 0 0; 0 1 1 minus 2 1 0; 0 1 2 minus 1 0 1 ) goes to ( c c c c c c 1 1 0 1 0 0; 0 1 1 minus 2 1 0; 0 0 1 1 minus 1 1 )
The pivots are , and .
Upwards
Subtract row 3 from row 2, then row 2 from row 1:
In words
goes to ( c c c c c c 1 1 0 1 0 0; 0 1 0 minus 3 2 minus 1; 0 0 1 1 minus 1 1 ) goes to ( c c c c c c 1 0 0 4 minus 2 1; 0 1 0 minus 3 2 minus 1; 0 0 1 1 minus 1 1 )
So
In words
capital A to the power minus 1 equals 4 minus 2 1; minus 3 2 minus 1; 1 minus 1 1
The entry is , the entry and the entry .
Check
Multiply back. Row 1 of times the columns of : , , . Row 2: , , . Row 3: , , . So .
(b)4 points
Use to solve for . Give , the second component of .
Hint
Multiply both sides of by on the left. Only row 2 of is needed for .
Solution
The idea. : each component of is a row of times .
Multiply
In words
x equals capital A to the power minus 1 b equals 4 minus 2 1; minus 3 2 minus 1; 1 minus 1 1 1; 0; 2 equals 4 plus 2; minus 3 minus 2; 1 plus 2 equals 6; minus 5; 3
Check
. For a single right-hand side, elimination on is cheaper than finding first; the inverse pays off only when it is already known.
(c)6 points
For a number , take
In words
capital B equals 1 t; 2 5
Run Gauss–Jordan on . For which does it break down, so that has no inverse? For the other values of , give the entry of as a formula in .
Hint
After the first step the second pivot is a formula in . Gauss–Jordan breaks down when it is zero.
Hint
Divide row 2 by the second pivot, then subtract times row 2 from row 1. Put the two terms of the entry over one denominator.
Solution
The idea. The second pivot decides everything: if it is zero there is no inverse, and otherwise Gauss–Jordan runs to the end.
The second pivot
Subtract times row 1 from row 2:
In words
( c c c c 1 t 1 0; 2 5 0 1 ) goes to the quantity c c c c 1 t 1 0; 0 5 minus 2 t minus 2 1
The second pivot is zero for . Then the columns and lie on one line, and : a nonzero solution of , so has no inverse (Lecture 3 transcript, pp. 14–16).
Upwards
For , divide row 2 by , then subtract times it from row 1:
In words
capital B to the power minus 1 equals 1 plus 2 t over the quantity 5 minus 2 t, minus t over the quantity 5 minus 2 t; minus 2 over the quantity 5 minus 2 t, 1 over the quantity 5 minus 2 t, equals 1 over the quantity 5 minus 2 t, 5 minus t; minus 2 1
The entry is .
Check
For the matrix is lower triangular and the formula gives the entry , as it must. For : , and row 1 of times its columns gives and .
Problem 2#
The inverse of a product
Take
In words
capital A equals 2 1; 1 1, capital B equals 1 0; 3 1
(a)6 points
Find and , and from them . Give its and entries.
Hint
is an elimination matrix: its inverse undoes its one row operation. comes from Gauss–Jordan on a matrix.
Hint
The order of the factors matters: undo the factor that acted last first.
Solution
The idea. , in reverse order.
The two inverses
adds times row 1 to row 2, so subtracts it: . For , Gauss–Jordan subtracts of row 1 from row 2, which leaves the second pivot , and ends with
In words
capital A to the power minus 1 equals 1 minus 1; minus 1 2
Check: .
Reverse order
In words
( capital A capital B ) to the power minus 1 equals capital B to the power minus 1 capital A to the power minus 1 equals 1 0; minus 3 1 1 minus 1; minus 1 2 equals 1 minus 1; minus 4 5
The entry is and the entry .
Check
, and times our answer is .
(b)4 points
Now find . Give its and entries.
Hint
Apply the same rule to : whose inverse comes first?
Solution
The idea. : the matrix that a wrong order would give for .
Multiply
In words
( capital B capital A ) to the power minus 1 equals capital A to the power minus 1 capital B to the power minus 1 equals 1 minus 1; minus 1 2 1 0; minus 3 1 equals 4 minus 1; minus 7 2
Check
, and times our answer is . and are different matrices, so their inverses are different too.
(c)4 points
Show that if , and are invertible matrices, then . Show also that the inverse of an invertible symmetric matrix is symmetric.
This part has no answer box. Write your argument, then open the solution and mark yourself.
Hint
For the first claim, multiply by the proposed inverse and move the parentheses.
Hint
For the second, use together with .
Solution
The idea. The inverse is checked by multiplying; the transpose rule reverses order just as the inverse rule does.
Three factors
In words
( capital A capital B capital C )( capital C to the power minus 1 capital B to the power minus 1 capital A to the power minus 1 ) equals capital A capital B ( capital C capital C to the power minus 1 ) capital B to the power minus 1 capital A to the power minus 1 equals capital A ( capital B capital B to the power minus 1 ) capital A to the power minus 1 equals capital A capital A to the power minus 1 equals capital I
The innermost pair cancels first, then the next. The product in the other order gives in the same way, so is the inverse.
Symmetric inverse
Let . Then (Lecture 4 transcript, p. 3): equals its own transpose.
Check
The of this problem is symmetric, and its inverse from part (a) is symmetric too. is not symmetric, and neither is .
Problem 3#
A = LU for a 3 × 3 matrix
Take
In words
capital A equals 2 1 1; 4 5 3; minus 2 5 5
No row exchanges are needed.
(a)7 points
Eliminate to find and the multipliers , and , as in "What you need". Give , and the third pivot.
Hint
A multiplier is the entry to be cleared divided by the pivot above it. A negative multiplier means a row is added, not subtracted.
Hint
Compute from the new row 2 and the new row 3, after the first column has been cleared, not from the original rows.
Solution
The idea. Clear column 1 with the first pivot, then column 2 with the second; the multipliers go straight into .
Column 1
: row 2 minus times row 1 is . : row 3 minus times row 1, that is row 3 plus row 1, is .
Column 2
: . So
In words
L equals 1 0 0; 2 1 0; minus 1 2 1, U equals 2 1 1; 0 3 1; 0 0 4
The pivots are , and .
Check
Multiply back, a row at a time: row 2 of is , and row 3 is . Both are rows of .
(b)5 points
The forward product takes to . Find its entry for this . Then find the entry of for any multipliers , , , as a formula.
Hint
Follow what happens to row 3: first times row 1 is taken off it, then times the new row 2, which itself is row 2 minus times row 1.
Hint
The entry of is the coefficient of the original row 1 in the final row 3.
Solution
The idea. is , and in the forward order the multipliers interfere: row 1 reaches row 3 twice, directly and through row 2.
Follow row 3
After the three steps, row 3 is
In words
r sub 3 minus ell 3 1 r one minus ell 3 2 the quantity r two minus ell 2 1 r one, equals the quantity ell 2 1 ell 3 2 minus ell 3 1, r one minus ell 3 2 r two plus r sub 3
where are the rows of . Its coefficients form row 3 of . The entry is , and for this it is .
Check
So , and : row 3 of times the columns of gives , and . With the formula gives : the that the lesson finds in for the multipliers and (Lecture 4 transcript, pp. 9–10).
(c)3 points
Write , where is diagonal and is upper triangular with ones on its diagonal. Give the entry of .
Hint
holds the pivots. Divide each row of by its pivot.
Solution
The idea. Pulling the pivots out of leaves ones on its diagonal.
Divide by the pivots
In words
U equals 2 0 0; 0 3 0; 0 0 4 1 0.5 0.5; 0 1 one third; 0 0 1 equals D U prime
The entry of is .
Check
Row 2 of is , row 2 of . is not symmetric, so is not : has where has .
(d)5 points
Solve for in two triangular steps: first , then . Give , the third component of , and .
Hint
is solved from the top down: first, then , then . is solved from the bottom up.
Solution
The idea. does to in reverse what elimination did to ; after that only back substitution is left. The two steps together cost about operations (about each), which is why one factorization serves many right-hand sides.
Forward
; ; .
Back
gives ; gives ; gives :
In words
c equals 3; minus 1; 8, x equals 1; minus 1; 2
Check
. And is what elimination does to : , whose third component is , with row 3 of from part (b).
Problem 4#
The cost of elimination
Count one operation as one multiplication together with one subtraction, as in the lecture.
(a)3 points
For , add up the exact count . By how many operations does it exceed the estimate ? Give the difference to the nearest whole number (this box accepts any value within ).
Hint
The sum of the first squares is .
Solution
The idea. The estimate is the integral; the sum is a little larger, by a term of order .
The sum
In words
the sum from k equals 1 to 100 of k squared equals 100 times 101 times 201 over 6 equals 338 350, one third times 100 cubed is approximately 333 333.3
The difference is , about operations.
Check
, and : the extra is only per cent of the count, which is why the lecture keeps .
(b)5 points
A computer does operations per second. Using the estimates for the factorization and for each right-hand side, how many seconds does it take to factor a full matrix with , and how many right-hand sides can it solve in the time of one factorization? (The second box accepts any value within .)
Hint
. For the second box, divide the two estimates before putting in numbers.
Solution
The idea. The factorization costs , a right-hand side : the ratio is .
Factor
operations, so seconds.
Right-hand sides
In words
the quantity one third n cubed, all over n squared equals n over 3 equals 3000 over 3 equals 1000
Each right-hand side takes operations, seconds.
Check
seconds, the time of the factorization.
(c)2 points
If doubles, by what factor does the time for the factorization grow?
Hint
Only the leading power of matters.
Solution
The idea. The cost goes like , and .
Check
For , operations, seconds: times the seconds of part (b). Each right-hand side grows only by .
Problem 5#
Row exchanges and permutation matrices
(a)7 points
Take
In words
capital A equals 1 2 1; 2 4 3; 3 7 5
Start elimination. Which row exchange is needed, and when? Then factor , with the permutation that does that exchange before elimination starts. Give the entry of and the entry of .
Hint
Clear the first column and look at the new position.
Hint
Apply to first and eliminate from the start. The multipliers belong to the rows of , not of .
Solution
The idea. A zero in a pivot position is cured by exchanging with a lower row that has a nonzero entry there; does that exchange in advance.
Where it stops
Row 2 minus times row 1 is ; row 3 minus times row 1 is . The position holds , and row 3 has a below it: exchange rows 2 and 3.
With exchanging rows 2 and 3, has the rows , , . Its multipliers are and , after which row 2 is and row 3 is , so :
In words
capital P capital A equals 1 0 0; 0 0 1; 0 1 0 1 2 1; 2 4 3; 3 7 5 equals 1 0 0; 3 1 0; 2 0 1 1 2 1; 0 1 2; 0 0 1 equals L U
The entry of is , and the entry of is . The multipliers and of the first attempt have changed places along with their rows.
Check
Row 2 of is , row 3 is : the rows of . The pivots are all nonzero, so is invertible.
(b)6 points
Let be the permutation matrix that moves row 1 to row 3, row 3 to row 2 and row 2 to row 1:
In words
Q equals 0 1 0; 0 0 1; 1 0 0
What is the smallest power with ? And how many of the permutation matrices are their own inverse?
Hint
Follow one row: where is row 1 after one, two, three applications of ?
Hint
means that doing twice changes nothing. Such a permutation can only swap rows in pairs, or leave them alone. Count those of size 4 by how many pairs they swap.
Solution
The idea. A cycle of three rows returns after three steps; a permutation that is its own inverse is made of swaps that do not overlap.
The cycle
takes row 1 to position 3, to position 2, back to position 1, and the same for every row. So and no smaller power works: moves row 1 to row 2. So , which equals , as requires (Lecture 5 transcript, pp. 3–4).
Counting
Of the permutations of four rows, those equal to their own inverse are the identity, the single swaps and the double swaps:
In words
1 plus 6 plus 3 equals 10
One swap: choose of the rows, ways. Two swaps: row 1 is paired with one of the other rows, and the last two rows pair with each other, ways.
Check
The other are the cycles of three rows (choose the row left alone, ways, and one of directions) and the cycles of four rows; . For the same count gives of the , leaving the two cycles, and ; the lecture lists all six (Lecture 4 transcript, pp. 20–22).
(c)3 points
Show that a permutation matrix is its own inverse exactly when it is symmetric.
This part has no answer box. Write your argument, then open the solution and mark yourself.
Hint
You know a second formula for .
Solution
The idea. For a permutation , so and say the same thing.
Both directions
In words
capital P to the power minus 1 equals capital P is equivalent to capital P ^ capital T equals capital P, since capital P to the power minus 1 equals capital P ^ capital T
Check
The exchange of rows 2 and 3 in part (a) is symmetric and is its own inverse. The cycle of part (b) is not symmetric, and .
Problem 6#
Transposes and symmetric matrices
Take the matrix
In words
capital R equals 1 0 2; 2 1 1
(a)5 points
Compute and . Give the entry of , the entry of and the sum of the diagonal entries of .
Hint
The entry of is row of times row of . The entry of is column of times column of .
Solution
The idea. Both products are made of inner products: of rows for , of columns for .
The two products
In words
capital R capital R ^ capital T equals 1 plus 0 plus 4 2 plus 0 plus 2; 2 plus 0 plus 2 4 plus 1 plus 1 equals 5 4; 4 6, capital R ^ capital T capital R equals 5 2 4; 2 1 1; 4 1 5
In , the entry is column 2 times column 3, , and the diagonal adds up to .
Check
Both products are symmetric, as the lecture proves. The diagonal sums agree, : each is the sum of the squares of all six entries of , .
(b)2 points
For every square matrix , which of these matrices is always symmetric?
Hint
Transpose each candidate, using and the reverse-order rule, and see whether it comes back unchanged.
Solution
The idea. Transposing a sum transposes each term; transposing a product reverses it.
Transpose each
, the same matrix. , which changes sign. and , which are new matrices when is not symmetric.
Check
For : is symmetric, is not, and is symmetric here only by accident: for , is not.
(c)3 points
Show that if is a symmetric matrix and is any matrix, then is symmetric.
This part has no answer box. Write your argument, then open the solution and mark yourself.
Hint
Transpose the product of three factors: reverse the order and transpose each.
Solution
The idea. The same argument as for , with in the middle.
Transpose
In words
( capital A ^ capital T capital S capital A )^ capital T equals capital A ^ capital T capital S ^ capital T ( capital A ^ capital T )^ capital T equals capital A ^ capital T capital S capital A
using and . The product is .
Check
With this is the lecture's . With and : has the entry and the entry .
Problem 7#
Vector spaces and subspaces
(a)4 points
Which of these sets of vectors in are subspaces?
- : all with .
- : all with .
- : all with .
- : all with and .
Hint
First test whether the zero vector is in the set. If it is, try adding two vectors of the set, and multiplying one by or by .
Hint
means that or : two planes together.
Solution
The idea. A subspace must contain zero and keep every sum and every multiple inside.
Each set
: if and satisfy the equation, so do and every multiple of , because the left side is linear: a plane through the origin. does not contain , since : a plane that misses the origin. contains zero and all multiples, but has : not closed under addition. : two linear equations, both kept by sums and multiples; it is the line through .
Check
The two subspaces are a plane and a line through the origin, two of the four kinds of subspace of (Lecture 5 transcript, p. 17). is like two lines through the origin in taken together (the lesson's quiz): multiples stay inside, sums do not.
(b)5 points
Let have the columns and . For which number is in the column space ? And what is the column space of the matrix with columns and ?
Hint
is in when for some numbers . The first two components fix and .
Hint
For the second matrix, compare the two columns.
Solution
The idea. is in exactly when can be solved.
Solve for the combination
The first components give , the second . Then the third component must be
In words
2 times 2 plus 3 times (-1) equals 1
so is in only for . is a plane through the origin, and for any other the point is off it.
The second matrix
: the columns lie on one line, so all their combinations are the multiples of , a line through the origin (Lecture 5 transcript, p. 20).
Check
.
(c)3 points
Let and be subspaces of . Show that their intersection (the vectors in both) is a subspace. Then give an example where their union (the vectors in at least one of them) is not.
This part has no answer box. Write your argument, then open the solution and mark yourself.
Hint
Take and in both and . Where are and the multiples of ?
Hint
For the union, try two different lines through the origin.
Solution
The idea. Closure is tested separately in each subspace; a union breaks when a sum leaves both.
The intersection
If and are in and in , then and every multiple of are in (a subspace) and in (a subspace), so in both. The zero vector is in both too. So the intersection is a subspace.
The union
Let be the line of multiples of and the line of multiples of . Both vectors are in the union, but their sum is on neither line. This is the set of part (a) cut down to two lines.
Check
Two planes through the origin meet in a line through the origin or are the same plane: a subspace either way. In part (a), is the intersection of the plane with the plane .