Professional Documents
Culture Documents
NM Tut
NM Tut
MULTIMEDIA UNIVERSITY
EEM2036: Engineering Mathematics III
Tutorial: Numerical Methods
1. Find the largest interval in which p * must lie to approximate p with relative error at most
10 −4 for each value of p .
3
(a) e (b) 7
Sol: [2.718010,2.718554]; [1.912740,1.913122] ;
1 3 3
2. Use three-digit rounding arithmetic to calculate + 4 − . Compute the absolute
3 11 19
error with the exact value determined to at least five digits.
−2
Sol: 1.26; 0.63477 × 10
3
3. Use four-digit chopping arithmetic to calculate − 10π + 6e − . Compute the relative
62
error with the exact value determined to at least five digits.
−3
Sol: −15.15; 0.305034 × 10
5. Define
1 − cos( x ) [sin (x ) x] , sin ( 2x )
2 2
f (x ) = , g ( x ) = h ( x ) = 2 x .
x2 1 + cos x
(a) Show that f ( x ) = g ( x ) = h( x ) , if they exists for the x in the question.
(b) Identify, for each of f, g and h, those ranges of x, if any, which lead to subtractive
cancellation when they are evaluated as they stand.
[Final Examination; Trimester 1 Session 1999/2000]
6. Explain why the following floating point operations are “dangerous, and how we can
rewrite the following expressions to avoid errors coming from floating-point arithmetic.
(a) cos2θ − sin2θ (b) ln x – ln y
(c) 1− 1+ x
x
(d) 9 + x2 − 3
f (x ) ∆f ( x ) ∆2 f ( x )
.
.
. 1
.
. −4
4
−6 7
.
. 10
.
. 19
.
.
Sol: f ( x ) : −25, −18, −10,6,5,26,66
8. Prove that
n −1
(a) ∑ ∆ f (x ) = ∆f (x ) − ∆f (x ).
k =0
2
k n 0 [Final examination; Trimester 1, Session 2000/01]
9. The values of f ( x ) given below are those of a certain polynomial of degree 4. Form a
difference table, and from this table find f (5) .
x 0 1 2 3 4
f (x ) 1 5 31 121 341
Sol: 781.
10. Write the Lagrangian interpolating polynomial that passes through each point:
Leave your answer in Lagrangina form. Plot the points, and sketch the polynomial that
passes through them.
12. Use Lagrange interpolation to approximate 3 with the function f ( x ) = 3 x and nodes
x0 = 0 , x1 = 1 and x 2 = 2 .
Sol: P2 (0.5) = 1.5
Trimester 1, Session 2010/11 2
EEM2036: Numerical Methods Tutorial
15. Construct the interpolating polynomial for the unequally spaced points in the following
table:
x –2 –1 0 2
f (x ) 46 5 0 2
If f (1) = 1 is added to the above table, construct the new interpolating polynomial.
Sol: P3(x) = 46 – 41(x+2) + 18(x +2)(x+1) – 4(x+2)(x+1)x; P4(x) = P3(x) + x(x+2)(x+1)(x–2)
16. Let P3 ( x ) be the interpolating polynomial for the data (0,0 ) , (0.5, y ) , (1,3) and (2,2 ) .
Find y if the coefficient of x3 in P3 ( x ) is 6.
Sol: 4.25
17. Approximate f (0.75) using the following data and the Newton forward-difference
formula.:
x 0 1 2 3
f (x ) 0 1 16 63
18. The production of a semiconductor component at a factory in the year 2005 is given below:
21. The data for question 11 were generated using the function f ( x ) = 3 xe − x . Use the error
formula to find a bound for the error and compare the bound to the actual error.
−2 −2
Sol: Absolute error = 0.672416 × 10 Error bound = 0.808792 × 10 .
22. Determine the error bound for linear interpolating polynomial in approximating
f ( x ) = sin ( x − 2 ) for an x in [ −6π , π6 ] , Your answer should be in term of h, where
h = x1 – x0.
Sol: h2/8
23. Suppose you need to construct a table of equally spaced values for the common logarithm
function from x=1 to x=10, so that interpolation with a linear interpolation in this table is
accurate to within 10-6. Determine a suitable bound for the step size for this table.
Sol: 4 × 10-3
24. Use the central-difference formula with h = 0.01 and 0.001 to estimate f ′(0.66) if
x
e
f (x ) = . Compare the absolute error for the case of h = 0.01 and 0.001.
( x − 2)
−3
Sol: − 2.521612 Absolute error: 0.218374 × 10 ;
−5
− 2.521396. Absolute error: 0.218352 × 10 ;
25. By using forward or backward numerical differentiation, complete the following table:
x f (x ) f′ (x)
0.0 0.00 000
0.2 0.74 140
0.4 1.37 182
If the data were taken from f ( x ) = e x − 2 x 2 + 3 x − 1 , compute the error bound and compare
with the actual error.
Sol:Forward 3.7070, 3.1521; Error bound: 0.300000, 0.277860; Absolute error: 0.293000; 0.269293;
Backward: 3.7070; 3.1521;Error bound: 0.300000, 0.277860; Absolute error: 0.285597, 0.260275.
27. Use the formula derived in question 26 and central difference formula to approximate
f ′( x ) in the following table:
x f (x ) f ′( x )
2.0 5.947734
2.1 6.423753
2.2 6.922009
Given that f ( x ) = e
x
3
+ x 2 , compute the absolute error and compare with the error bound.
Sol: 4.649005; 4.871375; 5.093745;
0.239680 × 10 , 0.124097 × 10 −3 , 0.258028 × 10 −3
Absolute error:
−3
−3 −3 −3
Error bound: 0.257038 × 10 , 0.128519 × 10 , 0.257038 × 10
1
3.5
28. Approximate ∫
3.0 x − 1.5
dx by using the trapezoidal rule and Simpson’s rule with one
interval. Find a bound for the error for both methods.
Sol:0.291667;0.6173 × 10-2; 0.287698, 0.342935 × 10-4
29. By using the composite trapezoidal rule and the composite Simpson’s rule, approximate
2
∫
2
x 2 e − x dx with
0
(a) 2 intervals (b) step size h = 0.25
Sol: (0.404511, 0.422736), (0.421582, 0.422716)
30. Suppose that f (0.25) = f (0.75) = α . Find α if the Composite Trapezoidal rule with n = 2
∫ f (x ) dx
1
gives the value 2 for and with n = 4 gives the value 1.75.
0
Sol: 1.5
∫ cos x
−π
dx
6
∫ f (x ) dx .
1.0
[Final examination, Trimester 2, Session 2000/01]
Sol: 8.287708
1
∫ 0
f ( x )dx = c0 f (0) + c1 f ( x1 )
36. Show that the function f ( x ) = ln( x − 1) + cos( x − 1) has at least one root in the interval
(1.3,2) . By using Newton-Raphson method with initial point 1.3, approximate the positive
root accurates to within 2 decimal places.
Sol: 1.40
37. Use Newton’s method to find solutions accurate to within 10 −5 for the following problems:
(a) Approximate the zero of f ( x ) = − x 3 − cos x . Use the initial point x0 = −0.9 .
2 x cos 2 x − ( x − 2) = 0 for 2 ≤ x ≤ 3 . Use the initial point x0 = 2.5
2
(b)
Sol: −0.8654740; 2.370869.
38. Show that the iteration formula for Newton-Raphson method in solving the equation f(x) =
xm – a = 0 to determine the root m a is of the form
1 a
xn +1 = ( m − 1) xn + m−1 .
m xn
Hence, use the iteration formula to solve for 6 , to xn − xn −1 < 10 −2.
Sol: If x0 = 2.5, x2 = 2.4495
Sol: (i) 2.000, 2.625, (ii) 1.8125, 2.48155, (iii) 1.8333, 2.5000
(i) 2.25, 2.52439; (ii) 2.262195, 2.546561; (iii) 2.263844, 2.549505
(i) 0.1, 0.222; (ii) 0.111, 0.246836; (iii) 0.1107222, 0.246314
(a) Perform your calculations in three-digit rounding arithmetic and by using Gaussian
elimination with partial pivoting.
58.9 x1 + 0.03x2 = 59.2
− 6.10 x1 + 5.31x2 = 47.0
Sol: 10.0, 1.00
(b) Perform your calculations in three-digit chopping arithmetic and by using Gaussian
elimination with
(i) partial pivoting,
(ii) scaled partial pivoting.
3.3330 x1 + 15920 x 2 + 10.333 x3 = 7953,
2.2220 x1 + 16.710 x 2 + 9.6120 x3 = 0.965,
− 1.5611x1 + 5.1792 x 2 − 1.6855 x3 = 2.714.
Sol: –9.78, 0.504, 12.0; –1.00, 0.500, 0.993
45. Find the first two iterations of the Jacobi method for the following systems, using x(0) = 0.
If necessary, rearrange the equations to achieve convergence.
10 x1 − x2 = 9,
(a) − x1 + 10 x2 − 2 x3 = 7,
− 2 x2 + 10 x3 = 6.
Sol: x1( 2 ) = 0.97, x2( 2 ) = 0.91, x3( 2 ) = 0.74.
(b) using x(0) = 0.
3x1 + 3x2 + 7 x3 = 4,
3x1 − x2 + x 3 = 1,
3x1 + 6 x2 + 2 x3 = 0.
Sol: x1( 2 ) = 0.1429, x2( 2 ) = −0.3571, x3( 2 ) = 0.4286.
(c) using x(0) = 1.
6 x1 − 3 x 2 + x3 = 11,
2 x1 + x 2 − 8 x3 = −15,
x1 − 7 x 2 + x3 = 10.
Sol: x1(2 ) = 0.886905, x2(2 ) = −0.79762, x3(2 ) = 2.27381.
47. Apply power method to the following, compute the dominant eigenvalue and the respective
approximate eigenvector.
6 − 3
x 0 = [1 1] .
T
(a) − 3 − 2; (Terminate after 4 iterations)
3 2 3
(b) 2 6 6; x 0 = [1 1 1]
T
(Terminate after 3 iterations)
3 6 3
Sol: [1 −0.26001] T, 7.553846; [0.501931 1 0.833977] T, 12.04651