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

Quiz 01

Sep 26, 2017.

1. (30 pts) How many bits does it take to store a binary floating point number of the form ±1.a_{1}a_{2} ⋯ a_{t} × 2^{e} with t = 10, a_{j} ∈ {0, 1}, −14 ≤ e ≤ 15? Write down the binary floating number representation (binary machine number, a finite sequence of 0,

1) of −0.6875. Explain. Leave some spacing between sign and exponent and between exponent and mantissa for easy reading.

2. (30 pts) \underline{Derive} an upper bound for relative error caused by chopping for the floating point system in problem 1 (also known as ε_{M}). Give an upper bound in terms of ε_{M} on the relative error of evaluating x × y with the floating point arithmetics.

3. (20 pts) Solve for x^{2} − 2100x + 1 = 0 to 15 correct digits. Explain how you find your answer (direct evaluation using ’calculator’ will receive no credits).

4. (20 pts) Find the smallest N so that |∑_{i=0}^{N} \frac{3^{i}}{i!} − e^{3}| < 10^{−5}. Let your code print the

answer N and |∑_{i=0}^{N} \frac{3^{i}}{i!} − e^{3}| on screen, and also write them down on the answer sheet.

Extra credits for more efficient method(s).

Name your codes in the same format as 104000001 p03.m or 103000002 p04.c .

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

Quiz 01

Sep 26, 2017.

1. (30 pts) How many bits does it take to store a binary floating point number of the form ±1.a_{1}a_{2} ⋯ a_{t} × 2^{e} with t = 10, a_{j} ∈ {0, 1}, −14 ≤ e ≤ 15? Write down the binary floating number representation (binary machine number, a finite sequence of 0,

1) of −0.6875. Explain. Leave some spacing between sign and exponent and between exponent and mantissa for easy reading.

2. (30 pts) \underline{Derive} an upper bound for relative error caused by chopping for the floating point system in problem 1 (also known as ε_{M}). Give an upper bound in terms of ε_{M} on the relative error of evaluating x × y with the floating point arithmetics.

3. (20 pts) Solve for x^{2} − 2100x + 1 = 0 to 15 correct digits. Explain how you find your answer (direct evaluation using ’calculator’ will receive no credits).

4. (20 pts) Find the smallest N so that |∑_{i=0}^{N} \frac{3^{i}}{i!} − e^{3}| < 10^{−5}. Let your code print the

answer N and |∑_{i=0}^{N} \frac{3^{i}}{i!} − e^{3}| on screen, and also write them down on the answer sheet.

Extra credits for more efficient method(s).

Name your codes in the same format as 104000001 p03.m or 103000002 p04.c .