UCCM2153 / UDPS2013 - Numerical Methods
Topic 1: Mathematical Preliminaries
Tutorial 1
3
Q1. Let f (x )=x .
a) Find the second Taylor polynomial P2 ( x) at about x=0 . [Ans.: P2 ( x) = 0]
b) Find the error term when P2 (0.5) is used to estimate f (0. 5 ) . [Ans.: 0.125]
2
c) Repeat part (a) using x=1 . [Ans.: P2 ( x )=1+ 3( x−1)+3( x−1 ) ]
d) Repeat part (b) using the polynomial from part (c). [Ans.: -0.125]
x
Q2. Find the second Taylor polynomial P2 ( x) for the function f (x )=e cos x at
about x=0 . [Ans.: P2 ( x )=1+ x ]
a) Use P2 (0.5) to approximate f (0. 5 ) . [ Ans.: 1.5]
b) Find an upper bound for |f (0.5)−P2 (0.5)| . [ Ans.: 0.0932]
c) Find an upper bound for |f ( x)−P2 (x )| over the interval [0,1]. [Ans.: 1.2520]
1 1
∫ f ( x)dx ∫ P2 (x )dx
d) Approximate 0 using 0 . [Ans.: 1.5]
1
∫|R 2( x)|dx R2 ( x )=f ( x )−P2 ( x ) .
e) Find an upper bound for 0 , where
[Ans.:0.3130]
1 1
∫ f ( x)dx ∫ P2 (x )dx
f) What is the actual error to approximate 0 using 0 ? [Ans.:
0.1220]
Q3. Perform the following computations using three-digit chopping arithmetic.
1 3 3
( − )
+
3 11 20 [Ans.: 0.211]
Compute the absolute error and relative error incurred. [Ans.: 0.0004;0.0019]
x cos x−sin x
f (x )=
Q4. Let x−sin x .
lim f ( x )
a) Find x →0 . [Ans.: -2]
b) Using four-digit rounding arithmetic to evaluate f (0.1). [Ans.: -1.941]
c) By replacing each trigonometric function in f (x ) with third Maclaurin
lim f ( x )
polynomial, approximate x →0 . [Ans.: -2]
Q5. Using the 64-bit long real number representation to find the equivalent decimal for the
following floating-point machine number.
1 10000001010 1001001100000000000000000000000000000000000000000000
[Ans.: -3224]
Q6. Find the rate of convergence for
a)
sin ( 1n ) when n→ ∞ . [Ans.:
O ( 1n ) ; Hint :
sin ( 1n )≤ 1n for
n=1,2,... ]
b) ln(n+1)−ln n when n→ ∞ . [Ans.:
O ( 1n ) ; Hint:
1 1
ln(1+ )≤
n n for
n=1,2,... ]
1−cos h
c) h when h→ 0 . [Ans.: O ( h ) ]
sin h−h cos h
2
d) h when h→ 0 . [Ans.: O ( h ) ]
Q7. Construct an algorithm that has input an integer n≥1 , numbers x 0 , x1 , x 2 , .. . , x n
and number x that produces an output for the product ( x−x 0 )(x −x1 ).. .( x−x n ) .
[No
fixed answer]
Q8. (i) Show that nth Taylor polynomial for f (x )=ln(1+x ) at x=0
n
xi
Pn ( x )=∑ (−1)i+1
i=1 i .
(ii) Construct an algorithm to determine minimal value of n for f (0.1) to be
approximated by Pn (0.1) with the accuracy up to 3 decimal places.
[No fixed answer]
______________________________________________________________________________