CMPS 251 Final, Fall 2001

American University of Beirut · Numerical Computing · 4 pages

All CMPS 251 files
CMPS 251 Final, Fall 2001, page 1

Stuck on a question? A tutor can walk you through it.

CMPS 251 Final, Fall 2001, page 2 CMPS 251 Final, Fall 2001, page 3 CMPS 251 Final, Fall 2001, page 4

More CMPS 251 files

Show the text of this final exam
FRICAN CNIVERSIT® LIBRARY OF RTEKEY AMERICAN UNIVERSITY OF BEIRUT Faculty of Arts and Sciences Mathematics Department MATH 251 FINAL EXAMINATION FALL 2001 Closed Book, 2H1/2 GIVE YOUR ANSWERS ON THE QUESTION SHEET. SUBMIT YOUR SCRATCH SHEET. STUDENT NAME ID NUMBER In the next 2 problems, we consider the IEEE single precision floating point number system. IF,. where the storage of a number in IF, uses a 32 bits word, in the following way: 1 bit for s | 8 bits for (e-127) | 23 bits for f part of mantissa Figure. A word of 32 bits to store = (~)*(1.f) « 2°. 1. Convert the following decimal numbers using the formats indicated in the following table. Fill in the empty cases: Numbers Corresponding +(1.f)2° form | Corresponding hexadecimal form (—52.934375)10 a 4 succ(=) ‘ prev(-) Note: For z € IF,. succ(x) and prev(z) are in IF ,, the closest numbers to z, such that prev(x) < 2 < suce(z). . Fill in the cases to give the decimal values corresponding to the follow- ing IEEE single precision representations: Hexadecimal representation | Fill in decimal values [45DE4000)16 OF BuRUY 3. Give (by filling the appropriate case) equivalent mathematical expres- sions that avoids loss of significant figures. when computing the following functions f(z) for z taking values in a specific domain. Case 1 Equivalent form for f(z) f(z) =V1l+2?-2 | when r— +00 Case ? Equivalent form for f(z) f(z) = tan(x) — sin(x) | when z is near 0 4. Give the minimum number of arithmetic operations (additions, sub- tractions and multiplications) to compute the following polynomials Polynomial p(z) Minimum number of operations 30%? + 6(@ — 1) + 92 — 1)? + 3(a — 1)" — (x - 1)” 5. Consider the function f(x) = z* — 2sin(z). (a) Graph ON THE SCRATCH SHEET, the function f(x) on (—1.5, 1.5). (b) How many roots does the function f(z) = 2° — 2sin(z) have on (~00, 90)? Number of roots: (c) Consider the root r located on the interval [0.5, 1.5]. e Find the least number of iterations that provide an approx- ximation to r within 7 significant method. figures using the bisection Number of iterations: & In applying Newton’s method to find r, give the interval [a,b] C [0.5,1.5], for which a choice of the initial value xo in [a. 6] does not lead to a converging sequence. Interval [a, 8]: | e Based on the function f. give the formulae of the iterative schemas that generate the sequence of approximations: v9. I1.-.. for respectively Newton's method and secant method. Newton’s method : | tp = Secant method rn = IX WHAT FOLLOWS CARRY ALL YOUR COMPUTATIONS WITH AT LEAST 5 FIGURES Give the sequence of 2 approximations obtained by applying 2 iterations of Newton's method with zp = 1. Zh: Le: Give the sequence of 2 approximations obtained by applying 9 iterations of the secant method with rp = 1.5 and2, =1. 2: 3: 6. A function f is given on a set of uniformly spaced data: {x;}i =0,..,.n}, where n is a positive integer and A = 2i41 — Fit Xj 18 : 2.0 2.1 2.2 F(x;) | 3.1268 | 3.2871 | 3.4556 3.6328 | 3.8190 ee Sa SS (a) To interpolate using a degree 3 polynomial for finding an approx- imation to (1.92), which points would lead to the best approxi- mation? Points x; to be used : (b) Obtain an approximation to f( 1.85) using second degree polyno- mial interpolation. Carry your computations with 5 figures. f Value of approximation to f(1.85): (c) Assume f(z) is diffentiable up to any order, i.e. f € C*. Vk. Using Taylor’s series expansion around 2;. give only the first term in each of the following: (i) fi _ fhe: = cyh® + coh? +... and (ii) #7, — eA = dh + hh’ +... in terms of h and one of the derivatives of f. ? dist fins = = fi = oh Cy “= | fi- Fiaa2hE Fo d, = (d) Using 6., = fan tithion obtain the best approximation to f” (2.0) using the above data, successively with ho = 0.2 and ho = 0.1, fol- lowed by one Richardson extrapolation. Fill in the empty cases. * i eh oh x x (e) Use Romberg integration with hy = 0.4, to obtain approxima- tions to R 3 f(x)dz. Subsequently, fill in the empty cases in the following table: {1 2 Tr Ww Th” x * x x x x ~~ ‘ “uy Reminder: The first column is computed using the composite trapezoidal rule; the next two are obtained through Richardson extrapolations.