Assignment for numerical methods, Exercises of Numerical Methods in Engineering

Good assignment for the above mentioned topic

Typology: Exercises

2018/2019

Uploaded on 08/23/2019

sunny-kashyap-1
sunny-kashyap-1 🇮🇳

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Numerical Methods-Assignment-2
Numerical errors, Error Propagation, Basic Concepts of Iteration & Stability
(1) Let Mbe a sufficiently large number which results in an overflow of memory and mbe a suffi-
ciently small number which results in underflow of memory of a computing device. Then give the
output of the following operations:
(i) M×m(ii) M/m(iii) m/m(iv) k×M(v) k×m(vi) m/M, where kis a constant.
(2) In the following problems, show all the steps involved in the computation.
(i) Using 5digit rounding and chopping, compute 37654 +25.874 37679.
(ii) Let a=0.00456, b=0.123, c=0.128. Using 3-digit rounding and chopping, compute
(a+b) + cand a+ (b+c). What is your conclusion?
(iii) Let a=2, b=0.6, c=0.602. Using 3digit rounding and chopping, compute (a×b) + (a×
c). What is your conclusion?
(3) Let x,y, and zbe real numbers whose floating point approximations in a computing device co-
incide with x,y, and z, respectively. Show that the relative error in computing x(y+z)equals
ε1+ε2ε1ε2, where ε1=Er(f l(y+z)) and ε2=Er(f l (x×f l(y+z))).
(4) Let ε=Er(f l(x)). Show that
(i)|ε| 10n+1if the computing device uses ndigit (decimal) chopping.
(ii) |ε| 1
210n+1if the computing device uses ndigit (decimal) rounding.
(iii) Can the equality hold in the above inequalities?
(5) Let xA=3.14 and yA=2.651 be obtained from the numbers xTand yTrespectively using 4-digit
rounding. For any such values of xTand yT, find the smallest interval that contains
(i) xT+yT(ii) xT/yT(iii) xT×yT.
(6) Let x<0<ybe such that the approximate numbers xAand yAhas seven and nine significant digits
with xand yrespectively. Show that zA:=xAyAhas at least six significant digits when compared
to z:=xy.
(7) Let xTbe a real number. Let xA=2.5 be an approximate value of xTwith an absolute error at
most 0.01. The function f(x) = x3is evaluated at x=xAinstead of x=xT. Estimate the resulting
absolute error.
(8) Let f:RRand g:RRbe continuously differentiable functions such that
(i) there exists constant M>0 such that |f0(x)| Mand |g0(x)| Mfor all xR,
(ii) the condition number of fis less than 1, and
(iii) the condition number of gis greater than 1.
Show that |g(x)|<|f(x)|for all xR.
(9) Find the condition number at a point x=cfor the following functions
(i) f(x) = x2, (ii) g(x) = πx, (iii) h(x) = bx.
(10) check for stability of computing the function h(x) = sin2(x)
1cos2xfor values of xvery close to 0. Run
in Matlab and see the output for x=10(7.97)for the function h(x)and also try with some non-
negative number less than x, for instance, x=108. Note that for any xR,h(x) = 1.
1

Partial preview of the text

Download Assignment for numerical methods and more Exercises Numerical Methods in Engineering in PDF only on Docsity!

Numerical Methods-Assignment-

Numerical errors, Error Propagation, Basic Concepts of Iteration & Stability

(1) Let M be a sufficiently large number which results in an overflow of memory and m be a suffi- ciently small number which results in underflow of memory of a computing device. Then give the output of the following operations: (i) M × m (ii) M/m (iii) m/m (iv) k × M (v) k × m (vi) m/M, where k is a constant.

(2) In the following problems, show all the steps involved in the computation. (i) Using 5−digit rounding and chopping, compute 37654 + 25. 874 − 37679. (ii) Let a = 0 .00456, b = 0 .123, c = 0 .128. Using 3-digit rounding and chopping, compute (a + b) + c and a + (b + c). What is your conclusion? (iii) Let a = 2, b = 0 .6, c = 0 .602. Using 3−digit rounding and chopping, compute (a × b) + (a × c). What is your conclusion?

(3) Let x, y, and z be real numbers whose floating point approximations in a computing device co- incide with x, y, and z, respectively. Show that the relative error in computing x(y + z) equals ε 1 + ε 2 − ε 1 ε 2 , where ε 1 = Er( f l(y + z)) and ε 2 = Er( f l(x × f l(y + z))).

(4) Let ε = Er( f l(x)). Show that (i)|ε| ≤ 10 −n+^1 if the computing device uses n−digit (decimal) chopping. (ii) |ε| ≤ 12 10 −n+^1 if the computing device uses n−digit (decimal) rounding. (iii) Can the equality hold in the above inequalities?

(5) Let xA = 3 .14 and yA = 2 .651 be obtained from the numbers xT and yT respectively using 4-digit rounding. For any such values of xT and yT , find the smallest interval that contains (i) xT + yT (ii) xT /yT (iii) xT × yT.

(6) Let x < 0 < y be such that the approximate numbers xA and yA has seven and nine significant digits with x and y respectively. Show that zA := xA − yA has at least six significant digits when compared to z := x − y.

(7) Let xT be a real number. Let xA = 2 .5 be an approximate value of xT with an absolute error at most 0.01. The function f (x) = x^3 is evaluated at x = xA instead of x = xT. Estimate the resulting absolute error.

(8) Let f : R → R and g : R → R be continuously differentiable functions such that (i) there exists constant M > 0 such that | f

′ (x)| ≥ M and |g

′ (x)| ≤ M for all x ∈ R, (ii) the condition number of f is less than 1, and (iii) the condition number of g is greater than 1. Show that |g(x)| < | f (x)| for all x ∈ R.

(9) Find the condition number at a point x = c for the following functions (i) f (x) = x^2 , (ii) g(x) = πx, (iii) h(x) = bx.

(10) check for stability of computing the function h(x) = sin

(^2) (x) 1 −cos^2 x for values of^ x^ very close to 0. Run in Matlab and see the output for x = 10 (−^7.^97 )^ for the function h(x) and also try with some non- negative number less than x, for instance, x = 10 −^8. Note that for any x ∈ R, h(x) = 1.

1