MATH 251 Final Without Solution, Spring 2011
American University of Beirut · Numerical Computing · 14 pages · with solution
Showing the first 10 of 14 pages. Download the PDF to see all of it.
More MATH 251 files
- Final Multiple Previouses · Fall 2015Final examView
- Final No Solution · Spring 2012Final exam · with solutionView
- Final · Fall 2011Final examView
- Final · Fall 2010Final examView
- Final · Fall 2006Final examView
- Final · Fall 2003Final examView
- Syllabus · Summer 2018LabView
- Syllabus · Summer 2018LabView
Show the text of this final exam
AMERICAN UNIVERSITY OF BEIRUT
Mathematics Department-FAS
MATH 251
FINAL EXAM
SPRING 2010-2011
Closed Book, 2hours
STUDENT NAME
ID NUMBER
Problem
Out of
Grade
1
15
2
20
3
20
4
15
5
15
6
15
TOTAL
100
1
1. (15 points) For which values of x is there a difficulty in computing
f(x) ? What is the problem ? What remedy do you suggest ?
• (7 points)f(x) = x +
√
x2 + 4
• (8 points)f(x) = tan(x) − 1
(N.B. Determine only the smallest positive value of x that causes
a problem.)
2
2. (20 points) Consider the function f(x) = x2 − a where 1 < a ≤ 2.
(a) (6 points)Write Newton’s formula: rn = g(rn−1) that computes
the positive root of the function f. Is there any restriction on the
initial condition r0? Justify your answer.
(b) (2 points)Find the minimum number of flops necessary in com-
puting one iteration rn = g(rn−1).
3
(c) (6 points)Prove that:
(rn − r) =
1
2rn−1
(rn−1 − r)2
then show that for n ≥ 1:
|rn − r| = 1
2(rn−1 − r)2 < 1
2n(r0 − r)2n
(d) (6 points)Let r0 = 3/2. Find an estimate on the least value of n
for which:
|rn − r| < 2−50
Hint: Using the result in (c), show first that |rn − r| < 2(−2n)
4
3. (20 points) Consider the following set of data:
Dn = {(xi, yi)|i = 0, ..., n where yi = f(xi) , and xi+1−xi = h, 0 < h ≤ 1}
(a) (6 points) Write first the Central difference formula ψh(f(xi))
that approximates the first derivative f ′(xi) , then derive the ex-
pression of the error series ϵ(h) = f
′(xi) − ψh(f(xi)) in the form:
ϵ(h) = c1hα1 + c2hα2 + c3hα3 + ....,
by determining the values of the constants {α1, α2, α3, ...}.
• ψh(f(xi)) =
• ϵ(h) =
5
(b) (6 points) Based on the Central difference formula, derive Richard-
son extrapolation operators of orders 1 and 2 and the order of their
error series.
• 1st order Richardson extrapolation operator:
ψ1
h(f(xi)) =
Corresponding Error = O(...........)
• 2nd order Richardson extrapolation operator:
ψ2
h(f(xi)) =
Corresponding Error = O(...........)
6
(c) (8 points) Let f(x) = 3xex. For the purpose of approximating
f ′(2.0) and then improving this approximation, fill in the empty
slots in the following table adequately, starting with h0 = 0.5.
Express all the results obtained in F(10, 5, −15, +15).
h
ψh(.)
ψ1
h(.)
ψ2
h(.)
h0 = 0.5
h0/2
h0/4
Best approximation to f ′(2.0) :
7
4. (15 points) Consider the following set of data, where the partition
points {xi}n
i=0 are equally spaced:
Dn = {(xi, yi)|i = 0, ..., n ; a = x0, b = xn; h = xi+1−xi; , yi = f(xi) ; }
(a) (1pt)Based on Dn, approximate the integral I =
� b
a f(x)dx using
the Composite Trapezoidal rule:
I ≈ T(h) =
(b) (4 points) Complete the following MATLAB function that approx-
imates the integral I =
� b
a f(x)dx using the Composite Trape-
zoidal rule. This function takes as inputs:
• a function f
• 2 real numbers a < b
• a positive number h, with 0 < h ≤ 1 where n = b−a
h
is the
number of subintervals determined by the partition points.
function I = CompositeTrapezoid(f, a, b, h)
(c) (2 points)Assume f ∈ C∞[a, b]. Write the Romberg extrapolation
formulae of orders 1,2 then k, based on the Composite Trapezoidal
rule (Do not derive the formulae):
i. R1(h) =
ii. R2(h) =
8
iii. Rk(h) =
(d) (8 points)Complete the following MATLAB function that applies
k iterations of the Romberg process based on the Composite Trape-
zoidal rule. The results are displayed in a lower triangular matrix
R of size (k + 1) × (k + 2).
(Call for the previous function if
adequate)
% This algorithm applies the Romberg process
up to kth order
% Input : a function f, the limits of integration a and b and
% k: the number of iterations
% Output :
a lower triangular matrix R of size (k+1) x (k+2).
function R = RombergCompositeTrapezoid(f,a, b, k)
R = zeros(k+1,k+2) ;
% The first column of R consists of all values of h, starting with the
% largest value
h=(b-a) and ending at h=(b-a)/2^k
R(1,1)=b-a ;
9
% The elements of the second column of R are
of all values of T(h) :
%
approximations
of I
using the
Composite
Trapezoidal rule
% All
elements of the remaining columns of R from the 3rd one till
% the
last
one are
the
Romberg approximations of all orders
% Display the
best approximation to I
end
10
5. (15 points)Let I =
� 2
0 3xex dx.
• (12 points) How many partition points are needed if I is to be
computed using the composite trapezoidal rule, up to two decimal
places (rounding to the closest)? Compute I in that case.
N.B The exact value of I = 25.1671683
11
.
• (3 points)In order to improve the approximation above, apply the
Romberg process once, and write the formula of the 1st Romberg
operator with the appropriate values of the new parameters. (Do
not compute the new approximation to I).
12
6. (15 points) Consider the following Initial value Problem:
(IV P)
� dy
dt = 2t + e−y ; t ∈ [1, 2.00]
y(1) = 3
To solve (IVP) in F(10, 4, −20, +20) (rounding to the closest):
(a) (3 points) (IVP) is first solved on [1, 1.25] using the discrete
scheme of Euler’s method: (RK1).
• Write first the formulae for this scheme:
(RK1)
� ................................................................
yi+1 = ....................................................
• Use 1 step ONLY of this scheme to approximate y(1.25).
i
ti
yi
k1
yi+1
0
1.00
.
.
.
(b) (5 points)(IVP) is then solved on [1.25 , 1.50] using the discrete
scheme of the 2nd order Runge Kutta method - Midpoint Rule:
(RK2.M).
• Write then the formulae of this scheme:
(RK2.M)
...............................................................
................................................................
yi+1 = ....................................................
• Use 1 step ONLY of this scheme to approximate y(1.50).
i
ti
yi
k1
k2
yi+1
0
1.25
.
.
.
.
13
(c) (6 points)Finally, (IVP) is then solved on [1.50 , 2.00] using the
discrete scheme of the 2nd order Runge Kutta method - Trape-
zoid Rule (Heun’s method): (RK2.T).
• Write then the formulae of this scheme:
(RK2.T)
...............................................................
................................................................
yi+1 = ....................................................
• Use 2 steps ONLY of this scheme to approximate y(1.75)
and y(2.00).
i
ti
yi
k1
k2
yi+1
0
1.50
.
.
.
.
1
.
.
.
.
.
(d) (1pt) The discrete solution of (IVP) is
Y4 = {y0 = 3, ....................................................................................}
14