Quiz1 Solutions
Quiz1 Solutions
Total:
Important Instructions: We will be using Gradescope which requires your solutions appear
in the boxes provided. Please place your solutions in the boxes if possible.
If you need extra pages, please write continued in the box, and on the extra pages clearly
label with problem number and letter.
1 (30 pts.)
1 3 b1
1
A = 3 8 2 and b = b2 .
5 12 2 b3
We can work with the augmented matrix [A b] and row reduce as follows:
1 3 1 b1 1 3 1 b1
→ 0 −1 −1 b2 − 3b1
3 8 2 b2
5 12 2 b3 0 −3 −3 b3 − 5b1
1 3 1 b1
→ 0 −1 −1 b2 − 3b1 .
0 0 0 b3 − 5b1 − 3(b2 − 3b1 )
In the first step, we subtracted 3 times the first row from the second row, and
5 times the first row from the third row. In the second step, we subtracted
3 times the second row from the third row.
Our last equation is then 0 = b3 − 5b1 − 3(b2 − 3b1 ), and simplifying gives us
our condition 4b1 − 3b2 + b3 = 0 . We notice that the first two equations
are always solvable.
(c) (10 pts.) Find a vector in the nullspace of AT (this space is known as
the left nullspace.)
2
One might have noticed from the solution in (a) that [4 − 3 1] ∗ A = 0
considering the column view of matrix multiply, so clearly [4 −3 1]T is in
the left nullspace.
The more time consuming way is to take the transpose of the original matrix:
1 3 5
T
A = 3 8 12 .
1 2 2
The third column is the only free column, so we can get an element in the
T
nullspace by finding a vector v = a b 1 for which the last matrix
times v is equal to zero. Solving for a and b then give us that
4
v = −3
1
is in the nullspace of AT .
3
2 (30 pts.) (6 points each part) Consider the 5x5 matrices
1 . . . . 1 . . . .
a 1 . . . . 1 . . .
E1 = b . 1 . . , E2 = . . 1 . . , and E = E1 E2 .
c . . 1 . . . . 1 .
d . . . 1 . . . x 1
1
1
(a) Solve E1 x = 1 for x.
1
1
The fastest way might be to recognize that E1 performs four trivial row
operations of addiing a, b, c, d times the first row to the other rows, and
E1−1 undoes the same operations, i.e. subtracts a, b, c, d times the first row
from the other rows, giving immediately 1, 1 − a, 1 − b, 1 − c, 1 − d.
Otherwise, one can notice that E1 is lower triangular, so we can solve this
using forward substitution. Here we see x1 = 1 and the other equations
become
x2 + a = 1
x3 + b = 1
x4 + c = 1
x5 + d = 1
4
1
1 − a
And thus the solution is x = 1 − b
1 − c
1−d
5
1
1
(b) Solve E1T x = 1 for x.
1
1
The fastest way is to recognize (E1T )−1 = (E1−1 )T from above which would
put the 1 − a − b − c − d in the first entry, and leave the other entries
untouched.
x1 + a + b + c + d = 1
1−a−b−c−d
1
And thus the solution is x =
1
1
1
(c) Compute E.
6
Otherwise one can use ones favorite matmul view on
1 . . . . 1 . . . . 1 . . . .
a 1 . . . . 1 . . . a 1 . . .
. . . . 1 . . = b .
b . 1 1 . .
c . . 1 . . . . 1 . c . . 1 .
d . . . 1 . . . x 1 d . . x 1
7
(e) Compute (E1 )10 = E1 × E1 × E1 × E1 × E1 × E1 × E1 × E1 × E1 × E1 .
One can also notice the pattern and perform the induction: We do 2 mul-
tiplication steps to notice and pattern and then write the solution
1 . . . . 1 . . . . 1 . . . .
a 1 . . . a 1 . . . 2a 1 . . .
E12 = b =
. 1 . . b . 1 . . 2b . 1 . .
c . . 1 . c . . 1 . 2c . . 1 .
d . . . 1 d . . . 1 2d . . . 1
1 . . . . 1 . . . . 1 . . . .
2a 1 . . . a 1 . . . 3a 1 . . .
E13 = 2b =
. 1 . . b . 1 . . 3b . 1 . .
2c . . 1 . c . . 1 . 3c . . 1 .
2d . . . 1 d . . . 1 3d . . . 1
8
3 (40 pts.) Answer the following with TRUE/FALSE and explain briefly and convinc-
ingly. (1 point for the correct answer, and 3 points for a correct justification.
No points for the wrong answer no matter how creative the explanation.)
(a) Is it TRUE/FALSE that the matrix M = vv T is always symmetric, when v is a vector of length
n?
TRUE: (Note that v defaults to a column vector as is the convention in this class.) We can test if
M = M T : (vv T )T = (vv T ) by the rules of transpose. Any matrix that is equal to its transpose is
symmetric.
Alternatively one can check that Mij = vi vj = vj vi .
Points were lost for doing only one example or only n = 2 or n = 3. Points were lost if notations
were written such as viT which indicated lack of understanding.
Note: in this class, “vector” means “column vector”, so if you only treated the case where v was a
row vector, you did not get full credit.
(b) Is it TRUE/FALSE that the matrix M = vv T might possibly have rank 0, or rank 1, but could
never have rank 2?
v
1
.
TRUE: if we write v = .. then the columns of vv T are v1 v, v2 v, . . . , vn v. That is, they are all in
vn
the span of v. If v is the zero vector, then M has rank zero. Otherwise, there is at least some nonzero
vi , and hence at least one nonzero column of M . Then rank(M ) = rank(span(v1 v, . . . , vn v)) = 1.
Note: in this class, “vector” means “column vector”, so if you only treated the case where v was a
row vector, you did not get full credit.
9
(c) Is it TRUE/FALSE that it is possible to compute y = ABx with approximately a constant
multiple of n2 operations, where A and B are general n × n matrices, and x is a general n vector?
TRUE: multiplying an n × n matrix by a column vector is O(n2 ). If you compute ABx as A(Bx)
(computing Bx first, then multiplying that on the left by A), this amounts to doing matrix-times-
vector multiplication twice. Two consecutive O(n2 ) operations is still O(n2 ).
Note: multiplying two n × n matrices (using the algorithm we’ve been taught) is, in general, O(n3 ).
So order matters, in terms of complexity.
(d) Is it TRUE/FALSE that in the above computation of y, if x is known to be the first column of
the identity matrix, then it is generally possible to reduce the number of operations to a constant
multiple of n?
FALSE: If x is the n × 1 vector with a 1 in the first entry and zeros everywhere else, then Bx is
just the first column of B. But then, computing A(Bx) is multiplying an n × n matrix by an n × 1
matrix, where we have no extra helpful information about the entries (e.g. that some of the entries
are zero), and so this operation would take O(n2 ) time. If we were to compute in the opposite order
(AB)x, just the AB computation would be O(n3 ) time. Therefore, there is no way to generally
reduce the number of operations to a constant multiple of n (O(n) time).
10
The ikj formulation of square matrix multiply has the following key lines:
C = zeros(n,n)
for i=1:n, k=1:n, j=1:n
C[i,j] += A[i,k] * B[k,j]
end
where first i = 1 and k = 1 and then j goes from 1 to n.
Next i = 1 and k = 2 and then j goes from 1 to n, etc.
(e) Is it TRUE/FALSE that the calculation of the (1,1) entry of C is completed before the calculation
of the (1,2) entry is started?
FALSE: First (i,k,j)=(1,1,1) so C11 gets the value of the first product A11 B11 , then (i,k,j)=(1,1,2)
so C12 gets its first product A11 B12 . Other pieces of C11 of the form. Let b be a given nonzero
vector of length 4. Consider the set of matrices A for which b is in the column space of A.
(f) Is it TRUE/FALSE that the ikj formulation is a ROW based view of matrix multiply?
TRUE: we are computing C one row at a time: in the first iteration of the outer loop (i = 1), we
compute the first row of C in its entirety; once this is done, we increment i to 2 and compute the
second row of C, and so on.
11
(g) Is it TRUE/FALSE that a 3x3 rank 2 matrix can have an RREF whose first column is all zeros?
TRUE: In order for the first column of the RREF to be 0, it has to be from the start 0 and as
there are 2 non-zero columns left we can still achieve rank 2. An example of such a matrix is the
following
0 1 0
0 0 1
0 0 0
(h) Is it TRUE/FALSE that a 3x3 rank 2 matrix can have an RREF whose second column is all
zeros?
TRUE: As above in order for the second column of the RREF to be 0, it has to be from the start 0
and as there are 2 non-zero columns left we can still achieve rank 2. An example of such a matrix
is the following
1 0 0
0 0 1
0 0 0
12
(i) Let x be a given nonzero vector of length 4. Consider the set of matrices A for which x is in the
nullspace of A. Is it TRUE/FALSE that this set of matrices form a vector space?
TRUE: We accepted true as the correct answer, with the unstated assumption that the matrices
all had the same dimension such as 4 × 4. With this assumption, 0 is in the space, and if A and B
are in the space, all linear combinations, including sums and scalar multiples are in the space. Full
credit required clarity about sums and scalar multiples.
False was accepted, but only if there was a fully correct explanation, that matrices with different
dimensions can not be added, and thus can not form a vector space.
(j) Let b be a given nonzero vector of length 4. Consider the set of matrices A for which b is in the
column space of A. Is it TRUE/FALSE that this set of matrices form a vector space?
FALSE: The easiest explanation is to point out that the zero matrix is not in this space.
13