Professional Documents
Culture Documents
hw9 Sol
hw9 Sol
hw9 Sol
c+d
d
` `
` ' `
c
b a a+b
0 a b a+b
Thus the four vertices of P lie at , , , and .
0 c d c+d
Use basic geometry to find the area of P.
Hint: One way to proceed is to first find the length of the horizontal line segments de-
noted ` in the figure. (They both have the same length.) Then notice that we can cut the
shaded triangle off the top of the parallelogram and re-attach it to the bottom, to get a more
standard parallelogram of the same area, as on the right side of the figure. The area of this
more standard parallelogram is (base)×(height) = ` × d. Thus area(P) = ` d.
v2
`
p ` v1
The vector p is proportional to v2 and its second entry must be c (since it’s at the same
“height” as v1 ):
∗ b
p= =α for some α.
c d
1
bc/d
From the second entry we find that α = c/d, and so p = . Now we find the length `
c
as
bc
!
a− ` bc
v1 − p = d = 0 ⇒ `=a− .
0 d
area(P) = ` d = ad − bc .
a b
The crucial point is that ad − bc is the determinant of the matrix .
c d
A b
1 x
1 1
x1
2. Consider the equation −2 −1 = 0.
x2
3 2 0
a) Show that Ax = b has no solutions.
We could keep reducing, but it’s already clear that there’s an unsolvable equation 0 = −1
coming from the bottom row.
b) The least-squares solution is the next best thing. What equation do we solve to find it?
2
3. A physicist is measuring the electric resistance r (in Ohms) of a wire as a function of
temperature t (in degrees Celsius). She finds that
t r
◦
−10 5
0◦ 5.2
20◦ 5.5
c) What is the error between the best-fit function and the actual data, at each measured
value of t?
Sol. We can compute individual values r(−10) = 5.014, r(0) = 5.179, r(20) = 5.507, or all
at once
5.014
bb = A 5.179 = 5.179 .
0.016
5.507
5 5.014 −0.014
The vector of errors is 5.2 − 5.179 = 0.021 .
5.5 5.507 −0.006
3
4. You throw a ball into the air in order to measure the gravitational acceleration g. Re-
member that motion of a ball thrown upward takes the form
1
h(t) = d + vt − gt2 ,
2
where h(t) denotes the height as a function of time, d is the height the ball was thrown from,
v is the initial velocity, and g is the gravitational acceleration.
You’re not totally sure about the initial height d or the initial velocity v (when flinging
the ball into the air, it is hard to judge exactly how hard you throw it, or where it left your
hand). By looking at photos, you find that
t (seconds) h (meters)
.2 2.5
.4 3.1
.6 3.3
1 2.6
1.2 1.65
Find the best guesses for d, v, and (your real goal) g by using the following steps
a) Set up a matrix equation that captures this problem, in the form
2.5
d 3.1
A v =
3.3 .
g 2.6
1.65
1 t1 − 21 t21
1 .2 −.02
1 t2 − 1 t22 1 .4 −.08
2
1 2
Sol. We want A = 1 t 3 − t
2 3
=
1 .6 −.18.
1 2
1 t4 − t4 1 1 −.5
2
1 t5 − 12 t25 1 1.2 −.72
b) Find the least-squares solution for d, v, g.
2.5
d 3.1
1.5
T −1 T
Sol. v = (A A) A 3.3 ≈ 5.6 . So the ball was released at a height of about
g 2.6 9.6
1.65
1.5 meters, with a velocity of 5.6m/sec, and the acceleration of gravity is about 9.6m/sec2 .
4
5. Suppose v1 , v2 , ..., vn are orthogonal and none of these vectors are zero. In order to
prove that they’re independent, we need to show that c1 v1 + c2 v2 + ... + cn vn = 0 implies
c1 = c2 = ... = cn = 0.
a) Compute (simplify as much as possible) (c1 v1 + c2 v2 + ... + cn vn ) · v1 .
c) Try to use the result of (b) to argue that if c1 v1 + c2 v2 + ... + cn vn = 0 than every
coefficient ci must equal zero.
b) Compute u · w and use the result to find d. (So far, everything is a variable.)
5
8. We can do the same thing in matrix form. Remember that if a matrix Q has orthogonal
columns then QT Q is diagonal. Part (c) of the previous problem amounts to solving
Q
1 2 c 5
= .
2 −1 d 6
Multiply both sides by QT to get a matrix equation involving a diagonal matrix QT Q. Then
solve to find c, d.
T c T 5
Sol. The equation Q Q =Q looks like
d 6
5 0 c 17
= .
0 5 d 4
Q
1 1 b1
1 −1 x1 = b2 .
x2
−1 0 b3
This is the sort of matrix equation that may not have solutions, and requires a least-
squares approximation.
6
a) What condition must the entries of b satisfy in order for a solution to exist?
7
12. a) What is the maximum number of orthonormal vectors we can find in Rn ?
Since orthonormal vectors must be independent, there can be at most n of them.
b) True or false: if dim(V) = n, and v1 , ..., vn is a collection of orthogonal vectors in V
(and none of the vectors are zero), then V = hv1 , v2 , ..., vn i.
TRUE: the vectors must be independent; and any collection of n independent vectors in
V will span V.
c) True of false: If Q is a p × n matrix with orthonormal columns, then p ≥ n.
TRUE: p is the dimension of the vector space that the columns live in (in other words: the
columns are vectors in Rp ). Since the columns are orthonormal, they must be independent.
So p ≥ n.
d) True or false: if Q is a square matrix and it has orthonormal columns, then it has
orthonormal rows.
TRUE: In this case Q is an invertible matrix. Orthonormal columns means QT Q = I, so
Q−1 = QT , so QQT = I as well. That last equation means Q has orthonormal rows.
e) True or false: if Q is a rectangular matrix (meaning not a square matrix) with or-
thonormal columns, then it has orthonormal rows.
FALSE: if Q is rectangular, it is not invertible. So while QT Q = I, it is not true that
−1
Q = QT , and QQT need not equal I. (In fact, QQT cannot equal I because it can’t have
maximal rank.)
f) True or false: if Q is an orthogonal matrix, then Q−1 is an orthogonal matrix.
TRUE: If Q’s orthogonal then Q−1 = QT . We then check (Q−1 )T Q−1 = QQT = I and
Q−1 (Q−1 )T = QT Q = I.
g) True or false: if Q is an orthogonal matrix, then for any vector v, ||Qv|| = ||v||.
TRUE: ||Qv||2 = (Qv)T (Qv) = vT QT Qv = vT Iv = vT v = ||v||2 .
The Gram-Schmidt algorithm provides a systematic way to take a basis for some vector space
W and modify it to get an orthonormal basis for the same vector space. (In applications, W
will often be a subspace of some bigger space V.) Please see the book for a precise description
of the algorithm. The next problem illustrates the idea.
1
given by the three vectors
1 0 0
−1 1 0
a1 =
0 , a2 = −1 , a3 = 1 .
0 0 −1
8
cT1 a2
b) Define (and compute) c2 = a2 − c1 . Check that c2 · c1 = 0.
cT1 c1
This is less scary than it seems! We are taking a2 and removing from it just the right
amount of c1 (i.e. removing some multiple of c1 ) to make it orthogonal to c1 .
0 1 1/2
1 −1 1/2
Sol. c2 = −1 − (−1/2) 0 = −1 . Now c1 · c2 = 0.
0 0 0
T
c a3 cT a3
c) Define (and compute) c3 = a3 − 1T c1 − 2T c2 . Check that c3 ·c1 = 0 and c3 ·c2 = 0.
c c1 c2 c2
1
0 1/2 1/3
0 −1 1/2 1/3
Sol. c3 = 1 − (0)c1 − 3/2 −1 = 1/3 . Now c3 · c1 = 0 and c3 · c2 = 0.
−1 0 −1
d) We now have W = hc1 , c2 , c3 i, where the c’s are orthogonal vectors. As a final step,
c1 c2 c3
compute q1 = , q2 = , q3 = to get three orthonormal vectors that span W.
||c1 || ||c2 || ||c3 ||
√ √
1 √ 1/2 1/√6 √ 1/3 1/(2√3)
1 −1 , q2 = √2 1/2 = 1/ 3
1/3 = 1/(2√3)
p 6 , q3 =
Sol. q1 = √
2 0 3 −1 − 2/3 2 1/3 1/(2 √ 3)
0 0 0 −1 − 3/2
1 0 2
2 1 −1
14. Let A = 0 1 −1. This matrix has independent columns.
1 3 1
a) Use Gram-Schmidt to find an orthonormal basis for C(A).
1 −5/6
T
. Then c2 = a2 − c1 a2 c1 = a2 − ( 5 )c1 = −2/3.
2
Sol. First, c1 = 0 cT1 c1 6 1
1 13/6
76
cT a3 cT a3 1 1 1 −54 .
And c3 = a3 − 1T c1 − 2T c2 = a3 − ( )c1 − ( )c2 =
c1 c1 c2 c2 6 41 41 −42
32
1 r −5/6 76
−2/3, q3 = √ 1
1 2 6 −54
Finally, q1 = √ , q 2 = .
6 0
41 1 2 41 · 70 −42
1 13/6 32
9
1
1
b) Find the point b
b in C(A) that is closest to b = .
1
1
Sol. We have C(A) = hq1 , q2 , q3 i.
Let’s place the q’s as columns of a matrix Q = q1 q2 q3 .
The projection of b to C(A) is
27 2 −14 4 1 19
b = Q(QT Q)−1 QT b = QQT b = 1 2 69/2 7/2 −1 1 = 1 39 .
b
35 −14 7/2 21/2 7 1 35 7
4 −1 7 33 1 43
10