Anda di halaman 1dari 5

Math 415 Spring 2011 Homework 7 Solutions

Sec 5.1, No 1: Find the angle between the vectors v and w in each of the following:
(a) v = (2, 1, 3)
T
, w = (6, 3, 9)
T
Solution: We use the result
cos =
v
T
w
v w
=
2(6) + 1(3) + 3(9)

2
2
+ 1
2
+ 3
2

6
2
+ 3
2
+ 9
2
=
42

14(3

14)
= 1
and so the angle is zero. Indeed, we now observe that w =3v, so the two vectors are parallel to
each other.
(c) v = (4, 1)
T
, w = (3, 2)
T
Solution: We use the result
cos =
v
T
w
v w
=
4(3) + 1(2)

4
2
+ 1
2

3
2
+ 2
2
=
14

17

13
= .94174
and so the angle is arccos(.94174) = .34303 radians, or .34303
180

= 19.654 degrees.
(d) v = (2, 3, 1)
T
, w = (1, 2, 4)
T
Solution: We use the result
cos =
v
T
w
v w
=
2(1) + 3(2) + 1(4)

(2)
2
+ 3
2
+ 1
2

1
2
+ 2
2
+ 4
2
=
8

14

21
= .46657
and so the angle is arccos(.46657) = 1.0854 radians, or 1.0854
180

= 62.189 degrees.
Sec 5.1, No 3: For each of the following pairs of vectors x and y , nd the projection p of x
onto y and verify that p and x p are orthogonal:
(a) x = (3, 4)
T
, y = (1, 0)
T
Solution: In this question the projection is
p =
x
T
y
y
T
y
y =
3(1) + 4(0)
1
2
+ 0
2
(1, 0)
T
= (3, 0)
T
Then
p
T
(x p) = (3, 0)

3 3
4 0

= (3, 0)

0
4

= 0
and so p and x p are orthogonal.
(d) x = (2, 5, 4)
T
, y = (1, 2, 1)
T
Solution: In this question the projection is
p =
x
T
y
y
T
y
y =
2(1) 5(2) + 4(1)
1
2
+ 2
2
+ (1)
2
(1, 2, 1)
T
=
12
6
(1, 2, 1)
T
= (2, 4, 2)
T
Then
p
T
(x p) = (2, 4, 2)

2 (2)
5 (4)
4 2

= (2, 4, 2)

4
1
2

= 0
and so p and x p are orthogonal.
Sec 5.2, No 1: For each of the following matrices A, determine a basis for each of the subspaces
R(A
T
), N(A), R(A), and N(A
T
):
(b)
A =

1 3 1
2 4 0

Solution: First we will nd the null space of A: using Gaussian Elimination


A =

1 3 1
2 4 0

GE

1 0 2
0 1 1

so vectors z in the null space of A satisfy z


1
2t = 0, z
2
+ t = 0, z
3
= t, that is z = t(2, 1, 1)
T
and therefore a basis of N(A) is

(2, 1, 1)
T

. The echelon form above also shows that all rows


of A can be written as linear combos of (1, 0, 2) and (0, 1, 1), and therefore a basis of R(A
T
)
is {(1, 0, 2)
T
, (0, 1, 1)
T
}. As we should expect, (2, 1, 1)
T
is orthogonal to both (1, 0, 2)
T
and
(0, 1, 1)
T
.
Now consider in the same way the null space of A
T
:
A
T
=

1 2
3 4
1 0

GE

1 0
0 1
0 0

and so z = 0 is the only vector in the null space of A


T
. Therefore the null space has no basis in this
case. R(A) is the orthogonal complement of this null space and so is all of R
2
. A basis would be
{e
1
, e
2
} = {(1, 0)
T
, (0, 1)
T
}
(c)

4 2
1 3
2 1
3 4

Solution: First we will nd the null space of A:


A =

4 2
1 3
2 1
3 4

GE

1 0
0 1
0 0
0 0

and so z = 0 is the only vector in the null space of A. Therefore the null space has no basis in this
case. R(A
T
) is the orthogonal complement of this null space and so is all of R
2
. A basis would be
{e
1
, e
2
} = {(1, 0)
T
, (0, 1)
T
}.
Now consider in the same way the null space of A
T
:
A
T
=

4 1 2 3
2 3 1 4

GE

1 0
5
14
5
14
0 1
4
7
11
7

so vectors z in the null space of A


T
satisfy z
1
+
5
14
t +
5
14
s = 0, z
2
+
4
7
t +
11
7
s = 0, z
3
= t, z
4
= s, that
is,
z =

5
14
t
5
14
s

4
7
t
11
7
s
t
s

= t

5
14

4
7
1
0

+ s

5
14

11
7
0
1

Therefore a basis of N(A


T
) is

(
5
14
,
4
7
, 1, 0)
T
, (
5
14
,
11
7
, 0, 1)
T

. Similarly the non-zero rows


of the echelon form are a basis of the row space of A
T
, that is, R(A) has as a basis the set
{(1, 0,
5
14
,
5
14
)
T
, (0, 1,
4
7
,
11
7
)
T
}. Note that each vector in our basis of N(A
T
) is orthogonal to each
vector in our basis of R(A).
Sec 5.2, No 3 (a): Let S be the subspace of R
3
spanned by the vectors x = (x
1
, x
2
, x
3
)
T
and
y = (y
1
, y
2
, y
3
)
T
. Let
A =

x
1
x
2
x
3
y
1
y
2
y
3

Show that S

= N(A).
Solution: A vector z is in S

, i.e. is orthogonal to every linear combo of x and y, if x


T
z = 0
and y
T
z = 0. Now let us express the null space N(A) in terms of x and y. z is in this null space if
Az =

x
T

y
T

z =

x
T
z
y
T
z

0
0

that is, if x
T
z = 0 and y
T
z = 0. Therefore S

= N(A).
Sec 5.2, No 3 (b): Find the orthogonal complement of the subspace of R
3
spanned by (1, 2, 1)
T
and (1, 1, 2)
T
.
Solution: Here we apply the result in part (a): by Gaussian Elimination
A =

1 2 1
1 1 2

GE

1 0
5
3
0 1
1
3

and so z is in S

when z
1
+
5
3
t = 0, z
2

1
3
t = 0, z
3
= t. Thus z has the form z = t(
5
3
,
1
3
, 1)
T
, and
therefore
S

= N(A) = Span

(
5
3
,
1
3
, 1)
T

Sec 5.3, No 1 (c): Find the least squares solution of the following system:
x
1
+ x
2
+ x
3
= 4
x
1
+ x
2
+ x
3
= 0
x
2
+ x
3
= 1
x
1
+ x
3
= 2
Solution: The vector x that we want in this case is x = (A
T
A)
1
A
T
b where A is the coecient
matrix and b is the vector of right-hand-sides. Thus
A
T
A =

1 1 1
1 1 1
0 1 1
1 0 1

1 1 1
1 1 1
0 1 1
1 0 1

3 0 1
0 3 1
1 1 4

(A
T
A)
1
=

3 0 1
0 3 1
1 1 4

1
=

11
30
1
30

1
10
1
30
11
30

1
10

1
10

1
10
3
10

x = (A
T
A)
1
A
T
b =

11
30
1
30

1
10
1
30
11
30

1
10

1
10

1
10
3
10

1 1 1
1 1 1
0 1 1
1 0 1

4
0
1
2

8
5
3
5
6
5

Sec 5.3, No 2: For your solution x in Exercise 1 (c):


(a) determine the projection p = A x
Solution: Here is the calculation:
p = A x =

1 1 1
1 1 1
0 1 1
1 0 1

8
5
3
5
6
5

17
5
1
5
3
5
14
5

(b) calculate the residual r( x)


Solution: The residual r( x) = b p is
r( x) = b p =

4
0
1
2

17
5
1
5
3
5
14
5

3
5

1
5
2
5

4
5

(c) verify that r( x) N(A


T
)
Solution: We simply need to show that A
T
r( x) = 0
A
T
r( x) =

1 1 1
1 1 1
0 1 1
1 0 1

3
5

1
5
2
5

4
5

1 1 0 1
1 1 1 0
1 1 1 1

3
5

1
5
2
5

4
5

0
0
0

Sec 5.3, No 5 (a): Find the best least squares t by a linear function to the data
x 1 0 1 2
y 0 1 3 9
Solution: For a linear t y = c
1
+ c
2
x we need to solve Ac = y where
A =

1 1
1 0
1 1
1 2

, c =

c
1
c
2

, y =

0
1
3
9

Of course, this system does not (generally) have a solution and so we use the least squares solution.
The normal equations are
A
T
Ac = A
T
y

1 1
1 0
1 1
1 2

1 1
1 0
1 1
1 2

c =

1 1
1 0
1 1
1 2

0
1
3
9

4 2
2 6

c =

13
21

c =

4 2
2 6

13
21

9
5
29
10

Therefore the best t line is y =


9
5
+
29
10
x .

Anda mungkin juga menyukai