Numerical Analysis I, Fall 2009 (http://www.math.nthu.edu.tw/˜ wangwc/)

Midterm 1

Oct 27, 2009.

Downlowd relevant program from http://www.math.uiowa.edu/ftp/atkinson/ENA Materials.

1. How many terms of Taylor polynomial are needed to approximate e^{x} within 10^{−6} on [−1, 1]? Explain.

2. Write down Taylor’s polynomial p_{3}(x, y) for f(x, y) around the origin (0, 0), assuming f ∈ C^{∞}(R^{2}). That is, f(x, y) = p_{3}(x, y) + R_{3}(x, y), degree of p_{3} = 3. Write down p_{3} (need NOT give R_{3}).

3. Solve for x^{2} −1900x+1 = 0 to 15 correct digits. Explain your method, implement it in matlab and then copy your computed result carefully. Every digit counts.

4. How many ”bits” does it take to store a floating point number in the range

±1.d_{1}d_{2} ⋯ d_{s} × 2^{e}

with s = 23, d_{j} ∈ {0, 1}, −126 ≤ e ≤ 127? What is the largest possible rounding error caused by floating number representation in this case? In other words, what it the largest possible number of |\frac{x−fl(x)}{x}|, where x is a real number lying in the representable range specified above and fl(x) is the floating number representation of x obtained by ”rounding”? \underline{Explain}.

5. Suppose that a floating point algorithm gives rises to |\frac{x−fl(x)}{x}| ≤ ϵ, give an estimate of the relative error of evaluating 2^{xy} with x = 0.9, y = 1.9.

6. Give the formula of Newton’s method for solving x^{2}−2x+1 = 0. Find the order of convergence and prove your answer.

7. Given the data set {x_{0}, y_{0}} = (0, 2), {x_{1}, y_{1}} = (1, 1), {x_{2}, y_{2}} = (2, 3), {x_{3}, y_{3}} = (3, 0), Write down the Lagrangian polynomials L_{i}(x), i = 0, 1, 2, 3 and the interpolating polynomial in terms of L_{i} and y_{i}. Need NOT simplify. Then prove that L_{0}(x) + L_{1}(x) + L_{2}(x) + L_{3}(x) is a constant function.

8. (Analysis and Programming)

Prepare a matlab program for evaluating

g(x) = ∫_{0}^{x} e^{−t^{4}}dt

Find its Taylor polynomial so that the error is bounded by 10^{−9} for |x| ≤ 1. Let your main program plot the graph of g(x) on [−1, 1] and show g(1/2) on screen. Attach relevant functions at the end of the main program and name it u916xxxx pr8.m.

9. (Analysis and Programming) Use fixed point iteration to find the solution to

x = −2 sin x + 0.1

If your fixed point method does not converge, you can use Newton’s method (half credit) or bisection (1/4 credit). Attach relevant functions at the end of the main program and name it u916xxxx pr9.m. Create a directory on your desktop called u916xxxx and put your source code in it.