Professional Documents
Culture Documents
Jeff Parker
Oct 15 2014
This is a 120 minute, open book exam. You may use MATLAB, the course text, and
your class notes. Please do not use other resources, including other books or the Web.
Solution:
x2 x4 x6 x2 x4 x6
f (x) 1 1 + + ... = + ...
2! 4! 6! 2! 4! 6!
c) Use a conjugate to rewrite f (x) to allow a more stable computation near 0.
Solution:
(1 cos x)(1 + cos x) sin2 x
f (x) = 1 cos x = =
(1 + cos x) (1 + cos x)
Solution: The root has multiplicity three, and will be poorly conditioned. We will have
catastrophic cancelation computing f(x).
1
CSCI E-24 Midterm Solutions Jeff Parker
d) How is this converging? (Hint: You may compute a few more terms to see.)
Solution: We could use Modified Newtons Method, with m = 3. The first two values
would then be -1.7124 and -1.5707
Since convergence is linear, we could also use Aitkens Acceleration.
We wish to fit a polynomial to the points S = {(1, 2), (2, 3), (4, 11)}
That is, we want a P (x) = a0 + a1 x + a2 x2 to run through the points in S.
a0 + a1 + a2 = 2
a0 + a1 2 + a2 4 = 3
a0 + a1 4 + a2 16 = 11
Solve this system any way you like. Describe your method and show your results.
Solution: Gaussian Elimination shows that (a0 , a1 , a2 ) = (3, 2, 1) and thus
P (x) = x2 2x + 3
Solution: 1 + 4 + 16 = 21
2 of ??
CSCI E-24 Midterm Solutions Jeff Parker
Solution:
16 12 2
1
M 1 = 12 15 3
6
2 3 1
Solution:
1 1
(16 + 12 + 2) = (30) = 5
6 6
d) What is the condition number for matrix M ?
Solution:
21 5 = 105
kb Axc k = k[2; 3; 11] [1.81; 3.41; 9.73]k = k[0.19, 0.41; 1.27]k = 1.27
3 of ??
CSCI E-24 Midterm Solutions Jeff Parker
x f (x)
1 2
2 3
4 11
Solution:
x f (x)
1 2
2 3 1
4 11 4 1
Solution:
P (x) = 2 + 1(x 1) + 1(x 1)(x 2) = x2 2x + 3
8) Chebyshev (6 points)
We define the Chebyshev polynomial Tn as: Tn (x) = cos(n arccos(x))
a) Compute T999 ( 12 )
b) Compute T1000 ( 12 )
Solution:
1 2
arccos( ) =
2 3
1 2
cos(999 arccos( )) = cos(999 ) = cos(666) = cos(0) = 1
2 3
1 2 2 1
cos(1000 arccos( )) = cos(1000 ) = cos(666 + )=
2 3 3 2
There is a pattern of order three at x = 21 : one third of the time, Tn ( 21 ) = 1, and two
thirds of the time Tn ( 12 ) = 21 .
4 of ??