Docsity

Sample Midterm Exam Questions - Numerical Analysis | CMSC 666, Exams of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
AMSC/CMSC 666 Dr. Wolfe SAMPLE MIDTERM EXAM Spring 2009
1. (20 points) Let Πnbe the vector space of all (real) polynomials of degree ≤n. Let
x0, x1,...,xnbe distinct real numbers. For p, q ∈Πndefine
hp, qi=
n
X
i=0
p(xi)q(xi).(1)
(a) Show that (1) defines an inner product on Πn.
(b) Πnwith the inner product (1) has a ‘natural’ orthonormal basis. Write down this
basis.
2. (15 points) Use divided differences to show that the following data can be interpolated
by a cubic polynomial.
x−2−1 0 1 2 3
y1 4 11 16 13 −4
3. (25 points) The idea of this problem is to give a direct proof of the uniqueness of
the natural cubic spline interpolating data points (x0, y0),(x1, y1),...,(xn, yn) with
x0< x1<···< xn.The only analytic tool you will need is Rolle’s theorem.
So suppose S1(x), S2(x) are natural cubic spline functions satisfying
S1(xi) = S2(xi) = yi, i = 0,1, . . . , n, S
′′
j(x0) = S
′′
j(xn) = 0, j = 1,2.
Let S(x) = S1(x)−S2(x).
(a) Show that S(x) is a natural cubic spline function.
(b) Show that S′′(x) has at least n−1 zeros on (x0, xn) and therefore at least n+ 1
zeros on [x0, xn].
(c) Show that there is an i, 0≤i≤n−1 such that S(x)≡0 on [xi, xi+1].
(d) Show S(x)≡0 on [x0, xn] and therefore S1(x)≡S2(x) on [x0, xn].
4. (10 points) How many panels are needed to approximate I=R1
0e−x2dx with error
no more than 10−6using the composite trapezoid rule ? (neglect roundoff error.)
5. (30 points)
(a) Find {p0, p1, p2}such that piis a polynomial of degree iand this set is orthogonal
on [0,∞) with respect to the weight function w(x) = e−x.
(Note: R∞
0xne−xdx =n!,0! = 1.)
(b) Derive the 2 point Gaussian formula
Z∞
0
f(x)e−xdx ≈w1f(x1) + w2f(x2).
i.e. find the weights and nodes.

Partial preview of the text

Download Sample Midterm Exam Questions - Numerical Analysis | CMSC 666 and more Exams Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

AMSC/CMSC 666 Dr. Wolfe SAMPLE MIDTERM EXAM Spring 2009

  1. (20 points) Let Πn be the vector space of all (real) polynomials of degree ≤ n. Let x 0 , x 1 ,... , xn be distinct real numbers. For p, q ∈ Πn define

〈p, q〉 =

∑^ n

i=

p(xi)q(xi). (1)

(a) Show that (1) defines an inner product on Πn. (b) Πn with the inner product (1) has a ‘natural’ orthonormal basis. Write down this basis.

  1. (15 points) Use divided differences to show that the following data can be interpolated by a cubic polynomial.

x − 2 − 1 0 1 2 3 y 1 4 11 16 13 − 4

  1. (25 points) The idea of this problem is to give a direct proof of the uniqueness of the natural cubic spline interpolating data points (x 0 , y 0 ), (x 1 , y 1 ),... , (xn, yn) with x 0 < x 1 < · · · < xn. The only analytic tool you will need is Rolle’s theorem. So suppose S 1 (x), S 2 (x) are natural cubic spline functions satisfying

S 1 (xi) = S 2 (xi) = yi, i = 0, 1 ,... , n, S

′′ j (x^0 ) =^ S

′′ j (xn) = 0,^ j^ = 1,^2.

Let S(x) = S 1 (x) − S 2 (x). (a) Show that S(x) is a natural cubic spline function. (b) Show that S′′(x) has at least n − 1 zeros on (x 0 , xn) and therefore at least n + 1 zeros on [x 0 , xn]. (c) Show that there is an i, 0 ≤ i ≤ n − 1 such that S(x) ≡ 0 on [xi, xi+1]. (d) Show S(x) ≡ 0 on [x 0 , xn] and therefore S 1 (x) ≡ S 2 (x) on [x 0 , xn].

  1. (10 points) How many panels are needed to approximate I =

0 e

−x^2 dx with error no more than 10−^6 using the composite trapezoid rule? (neglect roundoff error.)

  1. (30 points) (a) Find {p 0 , p 1 , p 2 } such that pi is a polynomial of degree i and this set is orthogonal on [0, ∞) with respect to the weight function w(x) = e−x. (Note:

0 x

ne−xdx = n!, 0! = 1.) (b) Derive the 2 point Gaussian formula ∫ (^) ∞

0

f (x)e−xdx ≈ w 1 f (x 1 ) + w 2 f (x 2 ).

i.e. find the weights and nodes.