Docsity

Homework 1 Solution - Numerical Analysis I | CMSC 666, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Numerical Analysis I Homework 1 Solutions
CMSC 666 / AMSC 666 Fall 2008
1. Let
V(n)(x0, x1,...,xn−1, t)≡det
1x0x2
0··· xn
0
1x1x2
1··· xn
1
.
.
..
.
..
.
..
.
.
1xn−1x2
n−1···xn
n−1
1t t2··· tn
,
the determinant of the matrix obtained by replacing xnwith a variable parameter tin the
Van der Monde matrix. Observe that V(n)(x0, x1,...,xn−1, t) is a polynomial of degree
nin t. By expanding this determinant by minors in the last row, we can see that the
leading coefficient of the polyomial is V(n−1)(x0, x1,...,xn−1). Moreover, if tis set to any
of x0, x1,...,xn−1, then the matrix has two identical rows, so that its determinant is zero.
This means that the roots of the polynomial are {xj}n−1
j=0 , i.e.,
V(n)(x0, x1,...,xn−1, t) = [V(n−1)(x0, x1,...,xn−1)] (t−x0)(t−x1)···(t−xn−1)
and
V(n)(x0, x1,...,xn−1, xn) = [V(n−1)(x0, x1,...,xn−1)] Y
j<n
(xn−xj).
The assertion then follows by induction.
2. Let g−1(y) = pn(y). We know that t∗=pn(0) satisfies g(t∗) = 0. However, we don’t
know what nis. A strategy for finding t∗, is, for successive values of k, to evaluate yj=g(tj)
at k+ 1 points {tj}in the neighborhood where we know that ghas a well-defined inverse,
and then to construct the interpolating polynomial pk(y) satisfying pk(tj) = yjfor all j. For
each k, compute the candidate t∗
k=pk(0) and g(t∗
k). For k=n, we will find that g(t∗
k) = 0.
Comments:
i. It may happen that we get lucky and find t∗this way before k=n.
ii. In general, one doesn’t have functions gwhose inverses are polynomials. This idea is
used to generate an initial value to use with Newton’s method for finding the root of g.
That is, choose a degree k, generate a polynomial pkthat interpolates g−1at k+ 1 points,
and use pk(0) as a starting value for Newton’s method. The choice k= 2 (inverse quadratic
interpolation) is typically advocated.
3. Make the change of variables t=x−¡x0+3h
2¢, which gives
ψ3(x) = ˆ
ψ3(t) = µt+3h
2µt+h
2µt−h
2µt−3h
2=µt2−9h2
4µt2−h2
4.
This expression is symmetric with respect to twhich means that 0 is one critical point,
with ˆ
ψ3(0) = 9h4
16 . Since ˆ
ψ3¡±h
2¢= 0, the maximal value on [x1, x 2] is 9h4
16 . The two other
critical points can be obtained from the critical point of
µξ−9h2
4µξ−h2
4.
This is ξ=5h2
4and t=±√ξ, giving the extremal value h4on the whole interval.
4a. Conditions on the functions αiand βiare
αi(xj) = ½1 for j=i
0 otherwise βi(xj) = 0 for all j
pf3

Partial preview of the text

Download Homework 1 Solution - Numerical Analysis I | CMSC 666 and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Numerical Analysis I Homework 1 Solutions CMSC 666 / AMSC 666 Fall 2008

  1. Let

V (n)(x 0 , x 1 ,... , xn− 1 , t) ≡ det

1 x 0 x^20 · · · xn 0 1 x 1 x^21 · · · xn 1 .. .

1 xn− 1 x^2 n− 1 · · · xnn− 1 1 t t^2 · · · tn

the determinant of the matrix obtained by replacing xn with a variable parameter t in the Van der Monde matrix. Observe that V (n)(x 0 , x 1 ,... , xn− 1 , t) is a polynomial of degree n in t. By expanding this determinant by minors in the last row, we can see that the leading coefficient of the polyomial is V (n−1)(x 0 , x 1 ,... , xn− 1 ). Moreover, if t is set to any of x 0 , x 1 ,... , xn− 1 , then the matrix has two identical rows, so that its determinant is zero. This means that the roots of the polynomial are {xj }n j=0−^1 , i.e.,

V (n)(x 0 , x 1 ,... , xn− 1 , t) = [V (n−1)(x 0 , x 1 ,... , xn− 1 )] (t − x 0 )(t − x 1 ) · · · (t − xn− 1 )

and V (n)(x 0 , x 1 ,... , xn− 1 , xn) = [V (n−1)(x 0 , x 1 ,... , xn− 1 )]

j<n

(xn − xj ).

The assertion then follows by induction.

  1. Let g−^1 (y) = pn(y). We know that t∗^ = pn(0) satisfies g(t∗) = 0. However, we don’t know what n is. A strategy for finding t∗, is, for successive values of k, to evaluate yj = g(tj ) at k + 1 points {tj } in the neighborhood where we know that g has a well-defined inverse, and then to construct the interpolating polynomial pk(y) satisfying pk(tj ) = yj for all j. For each k, compute the candidate t∗ k = pk(0) and g(t∗ k). For k = n, we will find that g(t∗ k) = 0. Comments: i. It may happen that we get lucky and find t∗^ this way before k = n. ii. In general, one doesn’t have functions g whose inverses are polynomials. This idea is used to generate an initial value to use with Newton’s method for finding the root of g. That is, choose a degree k, generate a polynomial pk that interpolates g−^1 at k + 1 points, and use pk(0) as a starting value for Newton’s method. The choice k = 2 (inverse quadratic interpolation) is typically advocated.
  2. Make the change of variables t = x −

x 0 + 32 h

, which gives

ψ 3 (x) = ψˆ 3 (t) =

t +

3 h 2

t +

h 2

t −

h 2

t −

3 h 2

t^2 −

9 h^2 4

t^2 −

h^2 4

This expression is symmetric with respect to t which means that 0 is one critical point, with ψˆ 3 (0) = 9 h 4

  1. Since ψˆ 3

± h 2

= 0, the maximal value on [x 1 , x 2 ] is 9 h 4

  1. The two other critical points can be obtained from the critical point of

( ξ −

9 h^2 4

ξ −

h^2 4

This is ξ = 5 h

2 4 and^ t^ =^ ±

ξ, giving the extremal value h^4 on the whole interval.

4a. Conditions on the functions αi and βi are

αi(xj ) =

1 for j = i 0 otherwise βi(xj ) = 0 for all j

together with

β′ i(xj ) =

1 for j = i 0 otherwise α′ i(xj ) = 0 for all j

4b. There are 2(n + 1) interpolation conditions, which suggests that we should look for polynomials of degree 2n + 1. The fact that derivatives must be zero at many of the interpolation points suggest that we explore `i(x)^2. This has degree 2n which suggests scaling this by an extra linear term. The choice

βi(x) = (x − xi)`i(x)^2

meets the requirements for βi. If we seek αi of the form

αi(x) = [1 + c(x − xi)]`i(x)^2 ,

then the conditions on the values of αi are satisfied. The conditions on the derivative α′ i can be enforced by choosing c = − 2 `′ i(xi). This gives

αi(x) = [1 − 2 ′ i(xi)(x − xi)]i(x)^2.

5a. The requirement a + bxi 1 + cxi = yi, i = 1, 2 , 3

leads to the linear system of equations  

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

a b c

y 1 y 2 y 3

Suppose x 1 = 0, x 2 = 1, x 3 = 2. Then the resulting coefficient matrix is  

1 1 −y 2 1 2 − 2 y 3

The determinant of this matrix is 2y 2 − 2 y 3 , which is zero if y 2 = y 3. Thus in this case the matrix is singular, which suggests there may not be a solution for these values of x. To confirm this, take y 1 = 0 and y = y 2 = y 3 6 = 0. The interpolation problem reduces to

b − cy = y 2(b − cy) = y

which is impossible. So the interpolation problem is not guaranteed to have a solution.

b. Suppose there are two solutions

a 1 + b 1 x 1 + c 1 x

and a 2 + b 2 x 1 + c 2 x

that satisfy the interpolation requirements. It follows that the quadratic function

(a 1 +b 1 x)(1+c 2 x)−(a 2 +b 2 x)(1+c 1 x) = (a 1 −a 2 )+(b 1 +a 1 c 2 −b 2 −a 2 c 1 )x+(b 1 c 2 −b 2 c 1 )x^2

has three roots x 1 , x 2 and x 3. But this means that this function must be identically zero, i.e., the coefficients of x^0 , x and x^2 are zero. A bit of algebra then leads to the conclusion that a 1 = a 2 , b 1 = b 2 and c 1 = c 2 , so that the rational solution is unique.

6a. A program fragment showing how to compute this representation can be found in Chapter 2 of the text by Stoer and Bulirsch.