Docsity

AMSC/CMSC 460 HW2: Bounds for Quadratic Interpolation & Recurrences for Newton Form - Prof, Assignments of Computer Science

Toggle sidebar
bg1
AMSC/CMSC 460 Homework 2 Due 2/28
1. Suppose a function f(x) satisfies |f000(x)| ≤ Mfor x∈[−1,1]. Let p(x) be
the quadratic polynomial interpolating f(x) at the points −1,0,1. Give a bound on
|p(x)−f(x)|for x∈[−1,1]. The better your bound, the better your grade.
Answer: The absolute value error is of the error is
|f(x)−p(x)| ≤ f000(η)
6|x(x−1)(x+ 1)|,
where η∈[0,1]. Hence
|f(x)−p(x)| ≤ M
6max
t∈[0,1] |x(x−1)(x+ 1)|.
Now by differentiating x(x−1)(x+ 1) = x3−xand setting the result to zero, we see that
|x(x−1)(x+ 1)|is maximized at x=±1
√3and that the maximum is 2
3√3. Hence our bound is
|f(x)−p(x)| ≤ M
9√3.
2. We can evaluate the polynomial p(x) = cnxn−1+cn−1xn−2+· ·· +c2x+c1by
the recurrence pn=cn
pi=xpi+1 +ci, i =n−1, . . . , 1.
The value of p(x) is p1.
a. By differentiating the recursion, derive a recursion to evaluate p0(x).
b. Assume that
p(x) = cn(x−xn−1)·· ·(x−x1) + cn−1(x−xn−2)· ·· (x−x1)+·· ·c2(x−x1) + c1
is in Newton form. Write down recurrences for evaluating p(x) and p0(x).
Answer:
a. From the recurrence we obtain
p0
n= 0
p0
i=xp0
i+1 +pi+1, i =n−1, . . . , 1.
This can be simplified to
p0
n−1=pn
p0
i=xp0
i+1 +pi+1, i =n−2, . . . , 1.
1
pf2

Partial preview of the text

Download AMSC/CMSC 460 HW2: Bounds for Quadratic Interpolation & Recurrences for Newton Form - Prof and more Assignments Computer Science in PDF only on Docsity!

AMSC/CMSC 460 Homework 2 Due 2/

1. Suppose a function f (x) satisfies |f

′′′

(x)| ≤ M for x ∈ [− 1 , 1]. Let p(x) be

the quadratic polynomial interpolating f (x) at the points − 1 , 0 , 1. Give a bound on

|p(x) − f (x)| for x ∈ [− 1 , 1]. The better your bound, the better your grade.

Answer: The absolute value error is of the error is

|f (x) − p(x)| ≤

f ′′′ (η)

6

|x(x − 1)(x + 1)|,

where η ∈ [0, 1]. Hence

|f (x) − p(x)| ≤

M

max t∈[0,1]

|x(x − 1)(x + 1)|.

Now by differentiating x(x − 1)(x + 1) = x^3 − x and setting the result to zero, we see that

|x(x − 1)(x + 1)| is maximized at x = ± √^1 3

and that the maximum is 2 3

√ 3

. Hence our bound is

|f (x) − p(x)| ≤

M

2. We can evaluate the polynomial p(x) = cnx

n− 1

+ cn− 1 x

n− 2

+ · · · + c 2 x + c 1 by

the recurrence

pn = cn

pi = xpi+1 + ci, i = n − 1 ,... , 1.

The value of p(x) is p 1.

a. By differentiating the recursion, derive a recursion to evaluate p′(x).

b. Assume that

p(x) = cn(x−xn− 1 ) · · · (x−x 1 )+cn− 1 (x−xn− 2 ) · · · (x−x 1 )+· · · c 2 (x−x 1 )+c 1

is in Newton form. Write down recurrences for evaluating p(x) and p

′

(x).

Answer:

a. From the recurrence we obtain

p ′ n = 0 p ′ i =^ xp

′ i+1 +^ pi+1,^ i^ =^ n^ −^1 ,... ,^1.

This can be simplified to

p ′ n− 1 =^ pn p ′ i =^ xp

′ i+1 +^ pi+1,^ i^ =^ n^ −^2 ,... ,^1.

AMSC/CMSC 460 Homework 2 Due 2/

b. The recurrence to evaluate p(x) is

pn = cn pi = (x − xi)pi+1 + c(i), i = n − 1 ,... , 1.

The recurrence to evaluate p’(x) is

p ′ n = 0 p′ i = (x − xi)p′ i+1 + pi+1, i = n − 1 ,... , 1.

As above this recurrence can be simplified.

3. The weights for the barycentric interpolation formula at the points

(x 1 , f 1 ), (x 2 , f 2 ),... , (xn, fn)

are

wi =

j 6 =i

(xi − xj )

Suppose we are given an additional point (xn+1, fn+1). Show how to compute the

weights ˆwi (i = 1,... , n + 1) of the new interpolant from the weights wi in O(n) opera-

tions.

Answer: wˆi = wi/(xi − xi+1), i = 1,... , n, w ˆi+1 = 1/

∏n i=1(xn+1^ −^ xi).