0% found this document useful (0 votes)
6 views

exercises

The document contains a series of assignment problems focused on elementary numerical methods, covering topics such as matrix inversion, LU-decomposition, Newton's method, recurrence relations, and interpolation techniques. Each problem presents specific mathematical tasks and hints for solving them, aimed at enhancing understanding of numerical analysis concepts. The problems range from basic computations to more complex applications in numerical methods.

Uploaded by

lankwitzjacques
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

exercises

The document contains a series of assignment problems focused on elementary numerical methods, covering topics such as matrix inversion, LU-decomposition, Newton's method, recurrence relations, and interpolation techniques. Each problem presents specific mathematical tasks and hints for solving them, aimed at enhancing understanding of numerical analysis concepts. The problems range from basic computations to more complex applications in numerical methods.

Uploaded by

lankwitzjacques
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

ASSIGNMENT PROBLEMS

for

ELEMENTARY NUMERICAL METHODS


PROBLEM 1 :

Let x ∈ R3 be given by x = (3, 4, −5)T .

What is the value of k x k2 ?

1
PROBLEM 2 :

Use the Banach Lemma (with the matrix infinity norm) to prove that the
n by n matrix Tn given below is invertible for all positive integers n :

5 1 1
 
1 5 1 1 
 
1 1 5 1 1 
 
Tn = diag[1, 1, 5, 1, 1] ≡ 
 1 1 5 1 1  .


 . . . . .
 1 1 5 1
1 1 5

Hint: First rewrite Tn as Tn = c T̃n , where c is a constant, chosen so that


the Banach Lemma can be applied to T̃n .

Also use the Banach Lemma to derive an upper bound on the infinity
n , and on the condition number of Tn .
norm of the inverse matrix T−1

2
PROBLEM 3 :

Use the Banach Lemma (with the matrix infinity norm) to prove that the
n by n matrix Sn given below is invertible for all positive integers n :
Sn = diag[hi , 2(hi + hi+1 ), hi+1 ] ≡
2(h0 + h1 ) h1
 
 h1 2(h1 + h2 ) h2 
h2 2(h2 + h3 ) h3
 
 
h3 2(h3 + h4 ) h4 ,
 

· · ·
 
 
hn−2 2(hn−2 + hn−1 ) hn−1
 
hn−1 2(hn−1 + hn )

where hi > 0, for all i. (This matrix arises in cubic spline interpolation.)

Hint: First rewrite Sn as Sn = Dn S̃n , where Dn is a diagonal matrix,


chosen so that the Banach Lemma can be applied to S̃n .

3
PROBLEM 4 :

Use Gauss elimination to compute (pencil and paper) the LU-decomposition


of the matrix  
1 2 3
A = 1 0 1 .
0 1 2

After having computed L and U, use them to solve for x in

Ax = f ,

where f = (2, 2, 1)T .

Check your answer !

4
PROBLEM 5 :

Give an example of a singular 2 × 2 matrix A :

that has an LU-decomposition.

Show L and U.

5
PROBLEM 6 :

Give an example of a nonsingular 2 × 2 matrix A :

that does not have an LU-decomposition.

Explain why not.

6
PROBLEM 7 :

A square matrix A is said to be ill-conditioned if the condition number

cond(A) ≡ k A k k A−1 k ,

is large.

Give an example of a nonsingular 2 × 2 matrix A that is ill-conditioned,


with
cond(A) ≥ 106 ,

but where the multiplier that arises in the LU-decomposition is not big
in absolute value.

7
PROBLEM 8 :

Give an example of a 2 × 2 matrix A that is not ill-conditioned, with

cond(A) ≤ 10 ,

but where the multiplier that arises in the LU -decomposition is of very


large magnitude, i.e., is big in absolute value.

8
PROBLEM 9 :

Compute (pencil and paper) the LU-decomposition of the n × n Hilbert


matrix Hn whose entries in the ith row and jth column are

hi,j = 1/(i + j − 1), i, j = 1, · · · , n ,

for the case n = 2.

What can you say about the size of the multiplier?

Use the LU-decomposition to compute the inverse of H2 .

Verify your answer.

What is the condition number of H2 ?

9
PROBLEM 10 :

Compute (pencil and paper) the LU-decomposition of the n × n Hilbert


matrix Hn whose entries in the ith row and jth column are

hi,j = 1/(i + j − 1), i, j = 1, · · · , n ,

for the case n = 3.

Use the LU-decomposition to solve

H3 x = f ,

for x , when f = (0, 0, 1)T , i.e., first solve

Lg = f ,

followed by solving U x = g.

10
PROBLEM 11 :

Suppose that solving a general linear system of equations of dimension n


requires 0.1 second on a given computer when n = 102 .

Based on the number of operations (multiplications and divisions only)


estimate how much time it will take to multiply two general square matrices
of dimension 103 on this computer.

11
PROBLEM 12 :

Let Tn be the specific n by n tridiagonal matrix Tn = diag[2, 5, 2].

What is the upper bound on cond(Tn ) is obtained,

when making use of the Banach Lemma?

12
PROBLEM 13 :

Let Tn be any general n by n tridiagonal matrix.

What is the total of the number of multiplications and divisions needed

to determine the LU-decomposition of Tn ?

( Note that there is no right-hand side vector f .)

13
PROBLEM 14 :

If Newton’s method is used to compute the cube root of 3,

with initial guess x(0) = 1,

then what will be the value of x(1) ?

14
PROBLEM 15 :

Use the methods below to compute 2, i.e., solve the equation

x2 − 2 = 0 ,

for its positive root.

In particular, determine the number of iterations k needed so that


the residual | (x(k) )2 − 2 | is less than 10−5 .

• Newton’s method with x(0) = 1 .

• The Chord method with x(0) = 1 .

15
PROBLEM 16 :

Given x(0) , say, x(0) = 2.0, compute the sequence


x(1) , x(2) , x(3) , · · · , x(N ) ,
up to a large value of N , e.g., N = 10, using the recurrence relation
x(k+1) = f (x(k) ), k = 0, 1, 2, 3, · · · ,
where
x2 + 5
f (x) = .
2x
Describe in a few words the observed behavior of the sequence.
In particular, does the sequence approach a limiting value?
If yes, then do you recognize what this limiting value is?
Does the limiting value depend on x(0) ?

16
PROBLEM 17 :

Consider the recurrence relation

x(k+1) = cx(k) (1 − x(k) ), k = 0, 1, 2, 3, · · · .

Prove that if c ∈ [0, 4] and x(0) ∈ [0, 1] then x(k) ∈ [0, 1] for all k.

17
PROBLEM 18 :

Consider the recurrence relation

x(k+1) = cx(k) (1 − x(k) ), k = 0, 1, 2, 3, · · · .

For each of these values of c :

c = 0.5 , 1.5 , 3.5 ,

• analytically determine all fixed points.

• analytically determine whether or not they are attracting.

18
PROBLEM 19 :

For given x(0) , say, x(0) = 3.10, compute

x(1) , x(2) , x(3) , · · · , x(N ) ,

up to a suitably large value of N , using the recurrence relation

x(k+1) = tan(x(k) ) , k = 0, 1, 2, · · · .

Does this sequence have a limit?

Can you explain the observed behavior?

Do the same for x(0) = 6.2828.

19
PROBLEM 20 :

Determine all fixed points of this iteration:

x(k+1) = f (x(k) ) ,

where
f (x) = ex .

20
PROBLEM 21 :

Determine all fixed points of this iteration:

x(k+1) = f (x(k) ) ,

where
f (x) = e−x .

21
PROBLEM 22 :

Determine all fixed points of this iteration:

x(k+1) = f (x(k ) ,

where
1 + x2
f (x) = .
1+x

For each fixed point determine whether it is attracting.

22
PROBLEM 23 :

Consider the Chord method for solving the equation x2 − 2 = 0 :

(k+1) (k) (x(k) )2 − 2


x = x − ,
2xc
Here xc is a constant, xc 6= 0 .

( Normally one chooses xc close to the square root of 2 , and x(0) = xc . )

What are the fixed points of this iteration ?

For each fixed point determine all values of xc for which the fixed point is
attracting.

23
PROBLEM 24 :

Consider the function g(x) = x2 − 3.

• Write down Newton’s method for finding a zero of g(x) .

• Draw the “x(k+1) versus x(k) diagram” for Newton’s method.

• Will Newton’s method converge for all initial points ?

• To which zero does it converge (as dependent on the initial guess) ?

24
PROBLEM 25 :

Now consider the function g(x) = x3 − 3 :

• Write down Newton’s method for finding a zero of g(x) .

• Draw the “x(k+1) versus x(k) diagram” for Newton’s method.

• Will Newton’s method converge for all initial points ?

(Hint: This is a little more difficult to answer here !)

25
PROBLEM 26 :

Consider Newton’s method for solving the system of equations

x1 − e−x2 = 0 ,

2 e−x1 − x2 = 0 .

(0) (0)
Use x1 = 0 and x2 = 0 as initial guesses.

(1) (1)
Determine x1 and x2 .

26
PROBLEM 27 : Lagrange Interpolation

If f ∈ C n+1 [a, b] and x ∈ [a, b], then


f (x) = pn (x) + Rn (x) ,
where Pn
pn (x) = k=0 f (xk ) lk (x) .
The polynomials lk (x) are the Lagrange interpolating coefficients , and
(n+1) n
f (ξ(x)) Y
Rn (x) = (x − xk ), for some ξ(x) ∈ [a, b] ,
(n + 1)! k=0

is the Lagrange remainder (error term).


The interpolation points xi are distinct, but otherwise arbitrary.
If f (x) = ex , then how big must n be, so that
| pn (x) − ex | ≤ 10−6 for all x ∈ [−1, 1] ?

27
PROBLEM 28 :

Consider the unique interpolating polynomial p4 of degree 4 or less


that interpolates the function f (x) = sin(x) at five distinct points
{x0 , x1 , x2 , x3 , x4 } in the interval [−1, 1].

Use the Lagrange Interpolation Theorem to derive an upper bound on


k f − p4 k ∞ ,
for the case where:

The points {xk }4k=0 are distinct in [−1, 1], but they are otherwise arbitrary.

Q4
( Use a tight bound on k k=0 (x − xk ) k∞ in your derivation.)

28
PROBLEM 29 :

Again consider the unique interpolating polynomial p4 of degree 4 or less


that interpolates the function f (x) = sin(x) at five distinct points
{x0 , x1 , x2 , x3 , x4 } in the interval [−1, 1].

Use the Lagrange Interpolation Theorem to derive an upper bound on


k f − p4 k ∞ ,
for the case where:

x0 = −1 , x1 = −0.5 , x2 = 0 , x3 = 0.5 , x4 = 1 .

Q4
( Use a tight bound on k k=0 (x − xk ) k∞ in your derivation.)

29
PROBLEM 30 :

Once more consider the interpolating polynomial p4 of degree 4 or less


that interpolates the function f (x) = sin(x) at five distinct points
{x0 , x1 , x2 , x3 , x4 } in the interval [−1, 1].

Use the Lagrange Interpolation Theorem to derive an upper bound on


k f − p4 k ∞ ,
for the case where:

The points {xk }4k=0 are the roots of T5 (x) (Chebyshev points).

Q4
( Use a tight bound on k k=0 (x − xk ) k∞ in your derivation.)

30
PROBLEM 31 :

Taylor’s Theorem :
If f ∈ C n+1 [a, b] and x ∈ [a, b], then f (x) = pn (x) + Rn (x), where
n
X f (k) (x0 )
pn (x) = (x − x0 )k
k=0
k!

is the Taylor polynomial, and

f (n+1) (ξ(x))
Rn (x) = (x − x0 )n+1 , for some ξ(x) ∈ [a, b]
(n + 1)!

is the Taylor Remainder (= error term).

What are pn (x) and Rn (x), when f (x) = ex , and x0 = 0 ?

31
PROBLEM 32 :

For the Taylor polynomial pn (x) of degree n for f (x) = ex about x0 = 0,

what is the smallest value of n , so that

| ex − pn (x) | < 10−3 ,

everywhere in the interval [−1, 1] ?

32
PROBLEM 33 :

Derive the Taylor polynomial pn of degree n for f (x) = sin(x)

about the point x0 = 0, for the case n = 5.

Draw a reasonably accurate graph of p5 (x), together with f (x).

Use the Taylor Theorem to derive an upper bound on

k f − p5 k ∞ ,

for the interval [−1, 1].

33
PROBLEM 34 :

Let x0 = 0, x1 = h, and x2 = 2h be uniformly spaced points.

Derive a numerical differentiation formula for

f ′ (x0 ) , in terms of f (x0 ), f (x1 ), and f (x2 ).

Taylor expand to determine a formula for the error in this approximation.

34
PROBLEM 35 :

Derive a five-point approximation formula for the third derivative


of a sufficiently smooth function f (x).

Use the reference interval [−2h, 2h] , with


x0 = −2h , x1 = −h , x2 = 0 , x3 = h , x4 = 2h .

The formula should approximate f ′′′ (x2 ) in terms of the values of f (x)
at the points x0 , x1 , x2 , x3 , and x4 .

Use Taylor expansions to determine the leading error term of the formula.

If f (x) = ex then how small should h be so the error is less than 10−6 ?

35
PROBLEM 36 :

Determine the order of accuracy of the following 3-point, asymmetric,


numerical differentiation formula:

′′ ∼ f (2h) − 2f (h) + f (0)


f (0) = 2
.
h

36
PROBLEM 37 :

For the Lagrange polynomial pn (x) of degree n or less, that interpolates

f (x) = ex at n + 1 Chebyshev points in the interval [−1, 1] ,

what is the smallest value of n so that

| ex − pn (x) |< 10−3 ,


everywhere in [−1, 1] ?

37
PROBLEM 38 :

Suppose we approximate f (x) = sin(x) in the interval [0, 2π]

by local polynomial interpolation at 3 Chebyshev points ,

using local polynomials of degree 2 or less.

What is the smallest number of intervals of equal size needed

so that the maximum interpolation error is less than 10−3 ?

38
PROBLEM 39 :

How many function evaluations are needed by

the composite Simpson integration formula ,

to integrate a function f (x) over an interval [a, b] ,

based on local integration in N subintervals of size h = (b − a)/N .

39
PROBLEM 40 :

Determine the order of accuracy of the composite Simpson formula

to integrate a sufficiently differentiable function f (x) over an interval [a, b],

based on local integration in N subintervals of size h = (b − a)/N ?

40
PROBLEM 41 :

The local Trapezoidal Rule for the reference interval [−h/2, h/2] is
h/2
h
Z h i
f (x) dx ∼
= f (−h/2) + f (h/2) .
−h/2 2

Use Taylor expansions to derive the local error formula .

Let h = (b − a)/N and xk = a + k h , for k = 0, 1, 2, 3, · · · , N .


Then the composite Trapezoidal Rule is given by
Z b
h h i
f (x)dx ∼
= f (x0 ) + 2f (x1 ) + 2f (x2 ) + · · · + 2f (xN −1 ) + f (xN ) .
a 2
Based on the local error, derive an upper bound on the global error .

41
PROBLEM 42 :

Use the Gram-Schmidt procedure to construct an orthogonal basis

of the 3-dimensional linear space

E3 ≡ Span{ 1 , x2 , x4 }

for the case of the interval [−1, 1].

Determine the best approximation p∗ (x) ∈ E3 to the function f (x) = x6 .

What is the value of k f (x) − p∗ (x) k2 ?

NOTE: ”best approximation” means ”best approximation in the k · k2 ”.

42
PROBLEM 43 :

Show that the functions

e0 (x) ≡ 1, e1 (x) = sin(x), e2 (x) = cos(x), e3 (x) = sin(2x), e4 (x) = cos(2x)

are mutually orthogonal with respect to the inner product


Z 2π
<f , g> = f (x) g(x) dx .
0

Also show how one can determine the coefficients ck , k = 0, 1, 2, 3, 4,

of the trigonometric polynomial


p(x) = c0 + c1 sin(x) + c2 cos(x) + c3 sin(2x) + c4 cos(2x) ,
that, for a given function f (x), minimizes the integral
Z 2π
( p(x) − f (x) )2 dx .
0

43

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy