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

TT2_solutions

The document is an exam for a Numerical Methods course consisting of 8 problems, each worth 8 points. It includes instructions for using approved calculators, checking page completeness, and formatting answers. The problems cover various numerical methods topics, including matrix operations, fixed point iterations, Taylor polynomials, and numerical differentiation.

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)
8 views

TT2_solutions

The document is an exam for a Numerical Methods course consisting of 8 problems, each worth 8 points. It includes instructions for using approved calculators, checking page completeness, and formatting answers. The problems cover various numerical methods topics, including matrix operations, fixed point iterations, Taylor polynomials, and numerical differentiation.

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/ 9

COMP361 NUMERICAL METHODS TERM TEST 2

( with abbreviated solutions )

NAME: ID:

INSTRUCTIONS

You may only use a Concordia approved calculator.

Other electronic equipment, books and notes, are not allowed.

This exam consists of 8 Problems, worth 8 points each.

The total number of pages is 9. Check that your copy is complete !

Do not attach or detach any pages !

Rough work must be done on the back of the pages.

Use a dark black or dark blue pen to enter your final answer.

For multiple choice questions, circle the correct answer (only one answer is correct).

Where provided, put you final answer(s) in the box(es).

Table for Instructor’s use


Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Problem 6 Problem 7 Problem 8 TOTAL

1
Problem 1.
For all vectors x in Rn we have
(a) k x k1 ≤ k x k2 (b) k x k∞ ≤ k x k2

1. Both (a) and (b) are valid.


2. (a) is valid and (b) is invalid.
3. (a) is invalid and (b) is valid. THIS ONE !
4. Both (a) and (b) are invalid.

Suppose that multiplying two general square matrices of dimension n requires 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 solve a general linear system of equations of dimension n = 103
on this computer.

1. 33 seconds.
2. 333 seconds. THIS ONE !
3. 3333 seconds.
4. none of the above

Let Tn be the n by n tridiagonal matrix Tn = diag[1, 5, 1]. Which one of the following upper bounds
on k T−1
n k∞ is obtained using the Banach Lemma:

1
1. 3
THIS ONE !
2
2. 3

3. 1
4. none of the above

Again let Tn be the specific n by n tridiagonal matrix Tn = diag[1, 5, 1]. What is the total of the
number of multiplications and divisions needed to determine the LU-decomposition of Tn , when
taking into account its tridiagonal structure, as well as the specific entries that it contains. (Make
sure not to include unnecessary operations !) :

1. n−1 THIS ONE !


2. 2n − 1
3. 3n − 2
4. none of the above

2
Problem 2.
Only one of the following statements is valid. Circle the one that is valid.

1. All very large matrices are ill-conditioned.

2. All ill-conditioned matrices have very small determinants.

3. If pivoting is needed then the matrix is ill-conditioned.

4. The condition number of a matrix is never smaller than 1. THIS ONE !

Newton’s method for computing the square root of 2 converges to the positive square root of 2
for the following initial guesses x(0) :

1. all x(0)

2. all x(0) 6= 0

3. all x(0) > 0 THIS ONE ! (See Page 135 of the Lecture Notes)

4. none of the above

The fixed point iteration x(k+1) = f (x(k) ) , where f (x) = cos(x), has

1. no attracting fixed point

2. one attracting fixed point with linear convergence THIS ONE !

3. one attracting fixed point with quadratic convergence

4. none of the above

The fixed point iteration x(k+1) = f (x(k) ) , where f (x) = sin(x), has

1. no attracting fixed point

2. one attracting fixed point with linear convergence

3. one attracting fixed point with quadratic convergence

4. none of the above THIS ONE !

3
Problem 3
The fixed point iteration x(k+1) = f (x(k ) , where f (x) = x2 − 2x + 2, has

1. only one attracting fixed point, with linear convergence


2. only one attracting fixed point, with quadratic convergence THIS ONE !
3. more than one attracting fixed points
4. none of the above

Consider Newton’s method for systems for solving the system of equations
x21 + x22 − 1 = 0 ,

x31 − x2 = 0 .
(0) (0) (1) (1)
If one uses x1 = 1, and x2 = 0, as initial guesses, then what will be the values of x1 and x2 :
(1) (1) 1
1. x1 = 1, and x2 = 2
(1) (1)
2. x1 = 21 , and x2 = 1
(1) (1)
3. x1 = 1, and x2 = 1 THIS ONE !
4. none of the above

Which of the following polynomials represents the first two nonzero terms of the Taylor polynomial
for f (x) = sin(x) about the point x = 0.
x2
1. x− 2

x3
2. x− 6
THIS ONE !
x3
3. x+ 6

4. none of the above.

For the Taylor polynomial pn (x) of degree n (or less) for f (x) = ex about the point x = 0, what
is the smallest value of n so that | ex − pn (x) |< 10−2 everywhere in the interval [−1, 1] :

1. n=3
2. n=4
3. n=5 THIS ONE !
4. none of the above.

4
Problem 4.
If we approximate f (x) = ex in the interval [−1, 1] by interpolation at n + 1 Chebyshev points
with a polynomial of degree n or less, then what is the smallest value of n so that the maximum
interpolation error is less than 10−2 ? (Make use of the Lagrange Interpolation Theorem.)

1. n=3

2. n=4 THIS ONE !

3. n=5

4. none of the above

Suppose we approximate f (x) = ex in the interval [−1, 1] by local polynomial interpolation at three
Chebyshev points with local polynomials of degree 2 or less. From the choices below, what is the
smallest number of intervals of equal size needed so that the maximum interpolation error is less
than 10−3 :

1. N =5 THIS ONE !

2. N =7

3. N =9

4. none of the above

For small positive h, the finite difference expression


f (2h) − 2f (h) + f (0)
,
h2
can be used to approximate the following derivative:

1. f ′ (0)

2. f ′′ (0) THIS ONE !

3. f ′′′ (0)

4. none of the above

How many function evaluations are needed when using the composite Simpson Rule to integrate a
function f (x) over an interval [a, b], based on local integration in N subintervals of size h = (b−a)/N.

1. N +1

2. 2N + 1 THIS ONE !

3. 3N

4. none of the above

5
Problem 5.
Consider the fixed point iteration x(k+1) = f (x(k) ) , where

2x3 + 2
f (x) = .
3x2

(a) Analytically determine all fixed points of this fixed point iteration, and for each fixed point
determine whether it is attracting or repelling. If a fixed point is attracting then also determine if
the convergence is linear or quadratic. Show the details of your computations, and enter your final
answers in the box below.

This is Newton for x3 − 2 = 0.


1
The only fixed point is x∗ = 2 3 .

Convergence is quadratic.

(b) In the space below, draw the standard graphical interpretation of this fixed point iteration,
showing the line y = x, the curve y = f (x), and indicating several iterations, starting with x(0) ∼
= 0.5 .
Make sure that your graph is qualitatively accurate.

6
Problem 6.
(a) Write down the Lagrange interpolating polynomial p(x) that interpolates the function f (x) = ex
at the points x0 = −1, x1 = 0, and x2 = 1. You must write p(x) using the complete expressions for
the appropriate Lagrange basis functions ℓ0 (x), ℓ1 (x), and ℓ2 (x). Enter your answer in the box.

(x−x1 )(x−x2 ) (x−x0 )(x−x2 ) (x−x0 )(x−x1 )


p(x) = ex0 (x0 −x1 )(x0 −x2 )
+ ex1 (x1 −x0 )(x1 −x2 )
+ ex2 (x2 −x0 )(x2 −x1 )

where x0 = −1, x1 = 0, x2 = 1

(b) Use the interpolating polynomial p(x) determined above to approximate the value of f (x) = ex
at the point x = 0.5. Enter this value in the box below.

e0.5 ≈ 1.72337

( exact value is 1.6487 · · · )

7
Problem 7.
(a) Use Taylor expansions to determine the leading error term of the numerical differentiation formula

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


f ′′ (0) ∼
= .
h2
Show the details of your work, and enter your final answer in the box below.

NOTE: This is a so-called ”one-sided approximation”, as opposed to a ”central approximation”.

The leading error term is h f ′′′ (0)

(b) Showing all details, derive the numerical differentiation formula in Part (a) of this Problem. You
must make use of the Lagrange interpolation polynomial that interpolates f (x) at the points, x0 = 0,
x1 = h, and x2 = 2h, and the corresponding Lagrange basis functions, ℓ0 (x), ℓ1 (x), and ℓ2 (x).

The derivation is similar (but not identical) to the derivation on Page 234 of the Lecture Notes:
Letting x0 = 0, x1 = h, and x2 = 2h, we have
f ′′ (x0 ) ∼
= f0 ℓ′′0 (x0 ) + f1 ℓ′′1 (x0 ) + f2 ℓ′′2 (x0 ) .
Here
(x − x1 )(x − x2 )
l0 (x) = ,
(x0 − x1 )(x0 − x2 )
so that
2 1
ℓ′′0 (x) = = 2 .
(x0 − x1 )(x0 − x2 ) h
In particular,
1
ℓ′′0 (x0 ) = .
h2
Similarly
2 1
ℓ′′1 (x0 ) = − , ℓ′′2 (x0 ) = .
h2 h2
Hence
f0 − 2f1 + f2
f ′′ (x0 ) ∼
= .
h2

8
Problem 8.
The formula Z h
2
f (x) dx ≈ h f (0) ,
− h2

defines the local Midpoint Rule for the reference interval [− h2 , h2 ] .

(a) Use Taylor expansions to derive the leading error term for this local formula. Show the details
of your work and enter your final answer in the box below.

See the page following Page 285 in the Lecture Notes with Solutions

(b) Based on the leading error term in the local formula, determine a bound on the leading error
term of the composite Midpoint Rule, when integrating a function f (x) over an interval [a, b].
Enter your answer in the box.

See the page following Page 285 in the Lecture Notes with Solutions

(c) Determine how many subintervals of equal size are needed to numerically integrate the function
f (x) = ex over the interval [−1, 1] using the composite Midpoint Rule, so that the error is
less than 10−4 . Show the details of your work and enter your final answer in the box below.

N ≥ 96

You might also like