Docsity

Numerical Analysis Review Problems: Polynomial Interpolation and Quadratic Interpolation, Study notes of Computer Science

Toggle sidebar
bg1
COT 4501 Numerical Analysis
Review Problems I
December 13, 2005
The following is a list of eleven problems and their (sketchy) solutions. Studying the prob-
lems below is not the only way to prepare for the final; nevertheless, at a minimum, you
should know how to solve the following problems. In addition, as usual, you should expect
some (hopefully pleasant) surprises on the final.
Problem 1 – VanderMonde Matrix For a collection of n t-values, {t1,· · · , tn},
let’s assume that ti6=tjif i6=j. The Vandermonde matrix is the following matrix:
V=
1t1· · · tn−1
1
.
.
..
.
..
.
..
.
.
1tn· · · tn−1
n
.
Show that the matrix above is non-singular.
Solution: The proof is a clever argument. Let’s assume the Vandermonde matrix is singular.
This means that there exists a nonzero vector
P=
a1
a2
.
.
.
an
such that V P = 0. However, this implies that
a1+a2ti+a3t2
i+· · · +antn−1
i= 0
for all ti. Since ti6=tjfor i6=j, this means that there are ndistinct solutions to the
polynomial
a1+a2t+a3t2+· · · +antn−1,
which only has degree n−1. This contradiction implies that there exists no nonzero vector
Psuch that V P = 0. That is, Vis non-singular.
Problem 2 – Polynomial Interpolation - Using monomial basis
Let (−2,−27),(0,−1),(1,0) be three points. Find a polynomial p(t) that interpolates the
given collection of data points.
Solution: We have three data points, and they provide three constraints. Hence, we can
determine a unique degree-two polynomial p2(t) = a3t2+a2t+a1that interpolates the given
three points.
This requires that
−27 = p2(−2) = 4a3−2a2+a1
−1 = p2(0) = a1
0 = p2(1) = a3+a2+a1
1
pf3
pf4
pf5

Partial preview of the text

Download Numerical Analysis Review Problems: Polynomial Interpolation and Quadratic Interpolation and more Study notes Computer Science in PDF only on Docsity!

COT 4501 Numerical Analysis

Review Problems I

December 13, 2005

The following is a list of eleven problems and their (sketchy) solutions. Studying the prob- lems below is not the only way to prepare for the final; nevertheless, at a minimum, you should know how to solve the following problems. In addition, as usual, you should expect some (hopefully pleasant) surprises on the final.

Problem 1 – VanderMonde Matrix For a collection of n t-values, {t 1 , · · · , tn},

let’s assume that ti 6 = tj if i 6 = j. The Vandermonde matrix is the following matrix:

V =

1 t 1 · · · tn 1 −^1 .. .

1 tn · · · tn n−^1

Show that the matrix above is non-singular. Solution: The proof is a clever argument. Let’s assume the Vandermonde matrix is singular. This means that there exists a nonzero vector

P =

a 1 a 2 .. . an

such that V P = 0. However, this implies that

a 1 + a 2 ti + a 3 t^2 i + · · · + antn i −^1 = 0

for all ti. Since ti 6 = tj for i 6 = j, this means that there are n distinct solutions to the polynomial a 1 + a 2 t + a 3 t^2 + · · · + antn−^1 ,

which only has degree n − 1. This contradiction implies that there exists no nonzero vector P such that V P = 0. That is, V is non-singular.

Problem 2 – Polynomial Interpolation - Using monomial basis

Let (− 2 , −27), (0, −1), (1, 0) be three points. Find a polynomial p(t) that interpolates the given collection of data points. Solution: We have three data points, and they provide three constraints. Hence, we can determine a unique degree-two polynomial p 2 (t) = a 3 t^2 + a 2 t + a 1 that interpolates the given three points. This requires that

− 27 = p 2 (−2) = 4a 3 − 2 a 2 + a 1 − 1 = p 2 (0) = a 1 0 = p 2 (1) = a 3 + a 2 + a 1

The resulting linear system (using Vandermonde matrix) is  

a 1 a 2 a 3

Solving the system above, we have a 3 = − 4 , a 2 = 5 and a 1 = −1. The polynomial is p 2 (t) = −1 + 5t − 4 t^2.

Problem 3 – Polynomial Interpolation - Using Lagrange or Newton

basis

In the previous interpolation, we have used the monomial bases, 1, t, t^2 , · · · , tn. Lagrange and Newton interpolations use different basis, which make the computation (of determining the coefficients) considerably easier. The trade-off is that the basis polynomials now depend on the input data. Given a set of data points (ti, yi), i = 1, · · · , n, the Lagrange basis functions are given by

li(t) =

∏n ∏k=1,k^6 =j^ (t^ −^ tk) n k=1,k 6 =j (tj^ −^ tk)

for j = 1, · · · , n. For example, using the three data points above, the three Lagrange basis functions are

l 1 (t) =

(t − t 2 )(t − t 3 ) (t 1 − t 2 )(t 1 − t 3 )

t(t − 1)

l 2 (t) =

(t − t 1 )(t − t 3 ) (t 2 − t 1 )(t 2 − t 3 )

(t + 2)(t − 1)

l 3 (t) =

(t − t 1 )(t − t 2 ) (t 3 − t 1 )(t 3 − t 2 )

t(t + 2)

The formula for Lagrange interpolation is extremely simple, namely:

p(t) = y 1 l 1 (t) + y 2 l 2 (t) + · · · + ynln(t).

For Newton Interpolation, the basis functions also depend on the data points, and they are:

πj (t) =

∏^ j−^1

k=

(t − tk), j = 1, · · · , n.

We can use the method above to determine the interpolating polynomial p(t) in terms of these basis functions: p(t) = a 1 + a 2 π 2 (t) + · · · + anπn(t).

The resulting linear system is lower-diagonal and therefore, easy to solve. As an exercise, you should work out the Newton Interpolation using the three data points above.

Problem 4 – Inverse Quadratic Interpolation

Needless to say, there are numerous interesting applications of the interpolation techniques.

  1. Finally, we require that second derivatives vanish at the end points, (t 1 , y 1 ) and (t 3 , y 3 ). This provides us with the two remaining equations.

Write out all these eight equations (we did this in class) and put them in an appropriate matrix form. This allows you to solve the coefficients, α and β.

Problem 6

In general, is it possible to interpolate n data points by a piecewise quadratic polynomial, with control points at the given data points, such that the interpolant is

  1. Once continuously differentiable? (meaning the first derivative is continuous)
  2. Twice continuously differentiable? (meaning the second derivative is continuous).

In each case, if the answer is ”yes”, explain why, and if the answer is ”no”, give the maximum value for n for which it is possible. Solution (sketch): Notice that, the second condition implies the first. That is, the first derivatives has to be continuous if the second derivative is continuous. The n points define n − 1 subintervals between them. Each interval needs one quadratic polynomials, which has three coefficients. Therefore, in total, we have 3(n − 1) coefficients need to be deter- mined. Now just count how many equations you can have using each of the conditions above.

Problem 7 Newton’s method: Optimization and Finding Roots

In October, we discussed the Newton’s method for finding a root of a non-linear equation. In December, we talked about Newton’s method for unconstrained optimization. You may wonder if there is any connection between these two techniques beside their association with Newton. The answer is of course, there is!! They are not only related but are in fact the same thing. Let f be a non-linear function. For simplicity, let’s assume that we are working with functions of one variable. Newton’ method for finding a root of f starts with a guess x 0. The iterative method estimates a sequence of xk, xk+1 = xk + sk where sk is the solution of the linear equation f ′(xk)sk = −f (xk).

Newton’s optimization method also starts with a guess x 0. The iterative method estimates a sequence of xk, xk+1 = xk + sk where sk is the solution of the linear equation

f ′′ (xk)sk = −f ′(xk).

The root-finding method involves the first derivative and the function while the other in- volves the first and second derivatives of the function. Superficially, they look different. But they are in fact equivalent. That is, you can use Newton’s root-finding algorithm for an optimization problem and conversely, you can use Newton’s optimization method to find a root. Explain this. (You have to figure out this. It is very simple.)

Problem 8

Let f : IRn^ → R be given by

f (x) =

xtAx − xtb + c

where A is an n × n symmetric positive definite matrix, b is an n-vector, and c is a scalar. For example, if the constant c is f , x = [x y]t, b = [−d − e] and

A =

a b b c

f (x) = 12 (ax^2 + 2bxy + by^2 ) + dx + ex + f , a quadratic function in x, y.

  1. Show that Newton’s method for minimizing this function converges in one iteration from any starting point x 0.
  2. If the steepest descent method is used on this problem, what happens if the starting value x 0 is such that x 0 − x∗^ is an eigenvector of A, where x∗^ is the solution?

Solution(sketch) Recall (See the notes available online) the update method for Newton’s method is: starting with an initial x 0 , xk+1 = xk + sk for k = 0, 1 , · · · , where sk is the solution of the following linear system:

Hf (xk)sk = −∇f (xk)

In the above, Hf is the Hessian of f and ∇f is the gradient of f. But we have

∇f (xk) = Axk − b,

and the Hessian of f is simply Hf (xk) = A.

In quiz four, we worked out a similar expression of ∇f. From the equation of ∇f , we know that the minimum of f is the solution of ∇f = 0, i.e., the solution of the following linear system: Axk − b = 0.

Starting with an initial guess x 0 , what is s 0? If you compute s 0 correctly, you will see that x 1 = x 0 + s 0 is a solution to the linear system above. That is, x 1 is a solution. For the steepest descent method, we find the minimum of f on the line given by x 0 +t∇f (x 0 ). The claim is that x∗^ is on this line. Therefore, if you pick x^0 correctly, the steepest descent will take you to the solution in one single step. To show this, we first notice two things: 1) Ax∗^ = b (why ?) and 2) A(x 0 − x∗) = λ(x 0 − x∗) because x 0 − x∗^ is the eigenvector of A with associated eigenvalue λ. From these two facts, we have

x 0 − x∗^ =

λ

A(x 0 − x∗) =

λ

(Ax 0 − b) =

λ

∇f (x 0 ).

From here, you should be able to fill in the rest of the proof.

Problem 9 Stability of ODEs

Give a criterion for stability or asymptotic stability of the solutions of the kth order, scalar homogeneous, constant-coefficient ODE

u(k)^ + ck− 1 u(k−1)^ + · · · + c 1 u′^ + c 0 u = 0.

  1. If hessian is negative definite, the critical point is a local maximum.
  2. If Hessian is indefinite, the critical point is a saddle point.
  3. If Hessian is singular, then none of the above is the most appropriate answer.

Now, we apply the results above to the three critical points: p is a local min, q a saddle point and r none of the above.