程序代写案例-W54
时间:2022-07-25
Math W54
Name:
Practice Midterm 2 July 26, 2022
Total: 50 points.
Duration: 2 hours.
• This is Midterm 2. The exam is out of 50 points and has 5 questions, where each
question is worth 10 points. You are required to solve all questions. Some of these
questions have multiple parts; next to each part, you will find the amount of points
the question is worth.
• You are required to show your work on each problem on this exam. Mysterious or
unsupported answers will not receive full credit. A correct answer,
unsupported by explanation or algebraic work will receive no credit; an incorrect
answer supported by substantially correct calculations and explanations will receive
partial credit.
• You must take this exam completely alone. Showing it to or discussing it with
anyone else is forbidden. Reproducing or sharing this material on any other websites
or platforms is also forbidden. You are permitted to consult your notes, the textbook,
any materials handed out in class, and any materials on the bCourses site. You may
not consult any other resources (for instance, public websites, Wolfram Alpha, and
calculators).
Math W54
Name:
Practice Midterm 2 July 26, 2022
1. (10 points) Do you think Mind your eigenbusiness would make a cool t-shirt?
Solution. Yes. There is no other right answer.
Page 2
Math W54
Name:
Practice Midterm 2 July 26, 2022
2. In this question, we develop some bounds for the rank of a product! Let A and B be
n× n matrices for simplicity.
(a) (2 points) Prove that rank(BA) ≤ min{rank(A), rank(B)}.
Solution. Let TA and TB be the unique linear transformations corresponding to A
and B, respectively.
This question has been solved in lecture; hence, we provide a different approach to
the solution.
Any vector that y that can be written as a linear combination of the columns of
BA as y = BAx can automatically be written as a linear combination of the
columns of B by y = B(Ax) = Bx′, for x′ = Ax. Thus col(BA) ⊆ col(B), so
rank(BA) ≤ rank(B).
Next, let X = AT and Y = BT . Then because rank(XY ) ≤ rank(X) as shown
already, taking transposes, we get rank(Y TXT ) ≤ rank(XT ). But because XT = A
and Y T = B, we have rank(BA) ≤ rank(A) as desired. It then follows that
rank(BA) ≤ min{rank(A), rank(B)}
(b) (4 points) What we realized by the previous part is that the rank of BA has some
kind of defect from the ranks of A and B. Along those lines, prove the following:
rank(BA) = rank(A)− dim(ker(B) ∩ im(A))
Solution 1 (Nice Rank-Nullity). First, rank(BA) = dim(im(TBTA)). By the
previous part rank(BA) ≤ rank(A), simply because im(TBTA) ⊆ im(TA). We need
to realize the defect now. We rearrange the theorem to say
rank(BA) + dim(ker(TB) ∩ im(TA)) = rank(A),
and make a clever use of the rank-nullity theorem. Specifically, consider a linear
transformation S : im(TA)→ im(TBTA), given by S(x) = Bx for x ∈ im(TA).
Then im(S) = im(TBTA) because y = S(x) for some x ∈ im(TA) if and only if
y = Bx. However, because x ∈ im(TA), x = Au for some u ∈ Rn. Thus y = BAu,
so y ∈ im(TBTA). We conclude then that y ∈ im(S) iff y ∈ im(TBTA), which
proves that im(S) = im(TBTA).
Next, ker(S) = ker(TB) ∩ im(TA), because ker(S) contains precisely the vectors in
im(TA) which get mapped to 0 under B. Now by rank-nullity,
dim im(S) + dimker(S) = dim(im(TA))
Then we know that
rank(BA) + dim(ker(TB) ∩ im(TA)) = rank(A).
Page 3
Math W54
Name:
Practice Midterm 2 July 26, 2022
Solution 2 (Extending Basis). This solution is from a more intuitive standpoint,
but as we will see, some rigor will be required. We wish to prove that
dim im(TBTA) + dim(ker(TB) ∩ im(TA)) = dim im(TA).
Notice that any vector in im(A) either goes to zero or goes to something non-zero
under TB. In the first case, it becomes a member ker(TB) ∩ im(TA). In the second
case, it becomes a member of im(TBTA), excluding zero.
Now to say something about dimension, we need to talk about bases. Any basis
for im(TA) would come from a basis β = {v1, . . .vp} for ker(TB) ∩ im(TA), and
another basis γ corresponding to a basis γ′ for im(TBTA).1
Thus, consider extending the basis β to make a basis for im(TA) as
B = {v1, . . .vp,u1, . . .uℓ}. Then dim im(TA) = p+ ℓ, while
dim(ker(TB) ∩ im(TA)) = p. If we prove that C = {T (u1), . . . T (uℓ)} is a basis for
im(TBTA), then we are done because
dim im(TBTA) + dim(ker(TB) ∩ im(TA)) = dim im(TA) = p+ ℓ.
This becomes our goal.
Linear independence. Suppose a1TB(u1) + · · · aℓTB(uℓ) = 0. By linearity,
TB(a1u1 + · · · aℓuℓ) = 0, so a1u1 + · · · aℓuℓ ∈ ker(TB) ∩ im(TA). But because β is a
basis for ker(TB) ∩ im(TA), what we have is
a1u1 + · · · aℓuℓ = b1v1 + · · ·+ bpvp.
Rearranging,
a1u1 + · · · aℓuℓ − b1v1 − · · · − bpvp.
Since B is a basis for im(TA) however, the set {v1, . . .vp,u1, . . .uℓ} is linearly
independent, so a1 = · · · = aℓ = b1 = · · · bp = 0. Thus C is a linearly independent
set.
Spanning. Take u ∈ im(TA) so that TB(u) ∈ im(TBTA). Then because B is a
basis for im(TA), we can write u as
u = b1v1 + · · ·+ bpvp + a1u1 + · · · aℓuℓ.
Applying TB, we obtain by linearity that
TB(u) = b1T (v1) + · · · bpT (vp) + a1T (u1) + · · · aℓT (uℓ)
= a1T (u1) + · · · aℓT (uℓ)
since v1, . . .vp ∈ ker(TB), hence T (v1), . . . , T (vp) = 0. Thus C indeed spans
im(TBTA).
(c) (4 points) Finally, something in the other direction: show that
rank(BA) + n ≥ rank(A) + rank(B).
1Notice that a very important detail is that we cannot just use the basis for im(TBTA), since this does
not live in the same space as im(TA) or ker(TB) ∩ im(TA). This is where the need for rigor comes in.
Page 4
Math W54
Name:
Practice Midterm 2 July 26, 2022
Solution. We use the rank-nullity theorem. First, subtracting 2n from both sides,
we get
rank(BA)− n ≥ (rank(A)− n) + (rank(B)− n).
Next, multiplying by (−1),
n− rank(BA) ≤ (n− rank(A)) + (n− rank(B)).
By the rank-nullity theorem, it suffices to prove that2
null(BA) ≤ null(A) + null(B).
This is doable. Any vector x ∈ nul(BA) has two possible trajectories:
(i) It either goes to 0 under TA, and then TBTA(x) = TB(0) = 0. In this case
x ∈ nul(A).
(ii) It goes to something non-zero first, but then TA(x) ∈ nul(B), so TBTA(x) = 0.
In this case, TA(x) = nul(B), or more specifically TA(x) ∈ nul(B) ∩ im(TA).
The idea here is that because nul(BA) is made up of vectors in nul(A) and
nul(B) ∩ im(TA), it is missing out on the vectors in nul(B) that are not in im(TA).
This is what causes the defect in null(BA), yielding the inequality.
We will once again talk about bases to conclude something about dimension. Let
β = {v1, . . .vp} be a basis for nul(A). Since nul(A) ⊆ nul(BA), we can extend β
to form a basis B = {v1, . . .vp,u1, . . .uℓ} of nul(BA). Thus null(BA) = p+ ℓ,
while null(A) = p.
We claim that {TA(u1), . . . TA(uℓ)}, vectors in nul(B) ∩ im(TA), form a linearly
independent set. If a1TA(u1) + · · · aℓTA(uℓ) = 0, then a1u1 + · · · aℓuℓ ∈ nul(A) by
linearity. But since {u1, . . .uℓ} are part of the independent set B, it follows that
a1 = · · · = aℓ = 0.
Now because u1, . . .uℓ ∈ nul(BA), we know that TBTA(u1), . . . TBTA(uℓ) = 0.
Thus TA(u1), . . . TA(uℓ) ∈ nul(B). Thus nul(B) contains a linearly independent set
of size ℓ, so any basis it has must be of size at-least ℓ. Thus null(B) ≥ ℓ, giving
nul(A) + nul(B) ≥ p+ ℓ = nul(BA)
as desired.
Looking back, parts (b) and (c) are hard enough to form their own separate questions
on an actual midterm.
2Notation thing: we are using nul(A) for the null-space of A, while null(A) = dimnul(A) (called the
nullity).
Page 5
Math W54
Name:
Practice Midterm 2 July 26, 2022
3. (10 points) Given similar matrices A =
1 2 34 5 6
7 8 9
 and B =
5 4 62 1 3
8 7 9
 . Find a basis
in R3 where the matrix for A is B.
Solution 1. Observe that we get B by swapping the first two rows and the first two
columns of A. In other words, B with its first two rows swapped = A with its first two
columns swapped. To swap the first two rows of B, we can multiply the elementary
invertible matrix:
P =
0 1 01 0 0
0 0 1

on the left of B. Now if we multiply this P on the right of A, it will swap the first two
columns of A. So we have:
PB =
2 1 35 4 6
8 7 9
 = AP
So B = P−1AP , and the columns of P is the basis we want.
Solution 2. We know B = P−1AP for some invertible matrix P and we want to find
the columns of P . Let
P =
a b cd e f
g h i

We have PB = AP , or:a b cd e f
g h i
5 4 62 1 3
8 7 9
 =
1 2 34 5 6
7 8 9
a b cd e f
g h i

This gives us a system of 9 equations in 9 variables, so we can solve for
a, b, c, d, e, f, g, h, i. The basis will be the three column vectors of P .
Page 6
Math W54
Name:
Practice Midterm 2 July 26, 2022
4. Let P3 denote the vector space of polynomials of degree at most 3, and consider the
linear map T : P3 → P3 defined by
T (p(t)) = p′(t) + p(0)t3.
Calculate the eigenvalues of T .
Proof. Observe that T (1) = 0 + t3, T (t) = 1 + 0, T (t2) = 2t+ 0, and T (t3) = 3t2 + 0.
Therefore, using the standard coordinates for P3, we see that T is represented by the
matrix
[T ] =

0 1 0 0
0 0 2 0
0 0 0 3
1 0 0 0
 .
Since the eigenvalues of a linear map do not depend on the choice of basis, it suffices to
calculate the eigenvalues of [T ]. The characteristic polynomial is given by
char[T ](λ) =
∣∣∣∣∣∣∣∣
−λ 1 0 0
0 −λ 2 0
0 0 −λ 3
1 0 0 −λ
∣∣∣∣∣∣∣∣
= λ4 − 6.
So the eigenvalues of [T ] must satisfy
0 = λ4 − 6 = (λ2 − 61/2)(λ4 + 61/2).
It follows that the eigenvalues of T are ±61/4, ±61/4i.
Page 7
Math W54
Name:
Practice Midterm 2 July 26, 2022
5. Show that if A is an n× n matrix such that every vector is an eigenvector of A
(potentially with different eigenvalues), then A = νI for some number ν.
Solution 1. If every vector is an eigenvector of A, we can find a basis of eigenvectors
for A, written in that basis, A is diagonal with entries λ1, . . . , λn. If all the entries are
equal, then this matrix is λI, so A = PλIP−1 = λIPP−1 = λI.
If two of the entries λi and λj are different, say they have eigenvectors ei, ej, then
A(ei + ej) = λiei + λjej, so ei + ej is not an eigenvector of A, contradicting our original
assumption.
Solution 2. If e1, . . . , en is the standard basis of Rn, Aei = λiei for some numbers λi.
ei + ej is also an eigenvalue of A, with eigenvalue ν. But
A(ei + ej) = λiei + λjej = ν(ei + ej). This isn’t a multiple of ei + ej unless ν = λi = λj.
Page 8
Math W54
Name:
Practice Midterm 2 July 26, 2022
6. (a) (5 points) Describe all 2× 2 matrices such that:
(i) A2 = A
(ii) The image of A is always along x =
(
6
9
)
Solution 1. The image of A is always contained inside in span(
(
6
9
)
), this is a
1-dimensional space, so rank(A) ≤ 1. If rank(A) = 0, then the image is just 0, so
A is the 0 matrix. If A is not the zero matrix, then rank(A) = 1, and null(A) = 1.
Therefore, A
(
6
9
)
= λ
(
6
9
)
for some value λ.
So
(
6
9
)
is an eigenvector of A. Since A2 = A, then
A2
(
6
9
)
= λ2
(
6
9
)
= A
(
6
9
)
= λ
(
6
9
)
, so
λ2 = λ
, so λ = 1 or λ = 0.
If λ = 0, then A only has eigenvalues of 0, so A = 0. If λ = 1, then
dim(null(A)) = 1, so A has an eigenvalue of 0. So A is a 2x2 matrix with 2
different real eigenvalues, therefore A is diagonalizable.
So A is going to look like:
A = P
(
1 0
0 0
)
P−1
.
Where P has columns that are eigenvectors, with the first eigenvector having
eigenvalue 1.
So P =
(
6 x
9 y
)
, for
(
x
y
)
not in span(
(
6
9
)
. If we scaled
(
6
9
)
to get a different
eigenvector we could just scale P , which wouldn’t change A since the scaling is
compensated for by P−1.
P−1 = 1
6y−9x
(
y −x
−9 6
)
.
Substituting these into the formula for A gives:
1
6y−9x
(
6y −6x
9y −9x
)
.
Page 9
Math W54
Name:
Practice Midterm 2 July 26, 2022
Solution 2. Recall that matrices can be determined completely by their action on
the standard basis vectors e1 and e2. Now suppose Ae1 =
(
6r
9r
)
for some r ∈ R,
because the image must be along the vector x. Then since A2 = A, we have
A2e1 = Ae1, or A
(
6r
9r
)
=
(
6r
9r
)
. Now rearranging,
6rA(e1) + 9rA(e1) =
(
6r
9r
)
9rA(e2) =
(
6r − 36r2
9r − 54r2
)
,
so for r ̸= 0, we get the family of matrices
A =
(
6r 2
3
− 4r
9r 1− 6r
)
When r = 0, we have a matrix of the form A =
(
0 6s
0 9s
)
, choosing Ae2 arbitrarily
from span(x). Notice that s ̸= 0 because otherwise we just have the zero matrix.
Now enforcing the condition that A2 = A, we get
A2 =
(
0 54s2
0 81s2
)
=
(
0 6s
0 9s
)
,
so s = 1/9. However, this gives A =
(
0 2/3
0 1
)
, which can be included into the
general family of matrices above when r = 0.
Thus if a matrix satisifes conditions (i) and (ii), it must be of the form
A =
(
6r 2
3
− 4r
9r 1− 6r
)
for some r ∈ R.
We claim that all matrices of the above family satisfy (i) and (ii). A quick check
reveals that A2 = A indeed for any r ∈ R, while row-reducing A gives(
6r 2
3
− 4r
9r 1− 6r
)
R2→R2− 32R1−−−−−−−−→
(
6r 2
3
− 4r
0 0
)
,
If r = 0, then im(A) = col(A) = {(2/3, 1)} = (x), and if r ̸= 0, then im(A) = (x)
as well. Thus we see that
A =
(
6r 2
3
− 4r
9r 1− 6r
)
for r ∈ R are all the matrices satisfying (i) and (ii).
Page 10
Math W54
Name:
Practice Midterm 2 July 26, 2022
(b) (5 points) Which of these matrices are orthogonal projections?
Solution 1. We established in the last part A = 1
6y−9x
(
6y −6x
9y −9x
)
.
Since an orthogonal projection is uuT , the matrix must be symmetric. So
9y = −6x this means y = −2x/3. So the resulting matrix is;
1
−13x
(−4x/ −6x
−6y −9x
)
=
(
4/13 6/13
6/13 9/13
)
Since the orthogonal projection is unique and there’s only symmetric matrix that
satisfies the conditions, this must be the correct choice.
Solution 2. We established
A =
(
6r 2
3
− 4r
9r 1− 6r
)
We need A to be symmetric for A to correspond to an orthogonal projection. This
means
9r =
2
3
− 4r
So
r =
2
39
.
This gives us a matrix of:
A =
(
4/13 6/13
6/13 9/13
)
Since the orthogonal projection is unique and there’s only symmetric matrix that
satisfies the conditions, this must be the correct choice.
Solution 2. Pick an orthonormal basis for span((6, 9)). This is just a single vector
of length 1, so it can be either u = ±( 2
13
, 3
13
). Either way, calcualting uuT results in
A =
(
4/13 6/13
6/13 9/13
)
Which we can check satisfies the conditions given.
Page 11

essay、essay代写