You may use a formula sheet: version in pdf format .
Answers:
7 = 111 = +.111 2^3
6 = 110 = +.110 2^3
----------------------
13 = 1101 = +.110 2^4 = 12 (when truncating)
= +.111 2^4 = 14 (when rounding)
Notice that, if one works with a hidden bit (a normalized number
always have leading bit equal to one), the result can be represented
exactly.
The subtraction 7 - 6 first yields +.001 2^3 which is normalized into +.100 e^1.
Answers:
f(x + delta) = f(x) + delta f'(x) + O(delta^2)
which shows that the error on f(x) can be written as
f(x + delta) - f(x) = delta f'(x) + O(delta^2)
and depends mostly on f'(x) = -1/(x-1)^2.
We see that if x is close to the root or a random point, f'(x)
stays moderate. On the other hand, because f'(x) is so steep close
to x = 1, we will see huge differences in the function values when
there are even small errors on the input value x.
Answers:
Note that we applying the methods to the equation f(x) = x^2 - 4.12 = 0.
--------------------------------------------------------------------------- k a(k) b(k) (a(k)+b(k))/2 f(a(k)) f(b(k)) f((a(k)+b(k)/2) =========================================================================== 0 2.000 2.100 2.050 -0.1200 0.2900 0.0825 1 2.000 2.050 2.025 -0.1200 0.0825 -0.01938 2 2.025 2.050 2.038 0.0825 -0.01938 0.01314 ---------------------------------------------------------------------------
------------------------------------------------------------------- k x(k) x(k+1) x(k+2) f(x(k)) f(x(k+1)) f((x(k+2)) =================================================================== 0 1.000 2.000 2.040 -3.120 -0.1200 0.0416 1 2.000 2.040 2.030 -0.1200 0.0416 -3.059E-4 2 2.040 2.030 2.030 0.0416 -3.059E-4 --- -------------------------------------------------------------------Note that the precision of four decimal places is insufficient to make a difference in the end.
------------------------------------------------------- k x(k) f(x(k)) f(x(k))/f'(x(k)) ======================================================= 0 2 -1.200E-1 -3.000E-2 1 2.03 9.000E-4 2.217E-4 2 2.029778325 4.914E-8 1.210E-8 3 2.029778313 --------------------------------------------------------We see eight corresponding decimal places between x(2) and x(3); the last correction term in the table is of order 1.0E-8.
Answer: see lecture notes.
--------------------------------------------------------- k a b x1 x2 f(x1) f(x2) ========================================================= 0 0.0000 1.0000 0.3820 0.6180 -0.3263 -0.3820 1 0.3820 1.0000 0.6180 0.7639 -0.3820 -0.3181 2 0.3820 0.7639 0.5279 0.6180 -0.3808 -0.3820 ---------------------------------------------------------
Answer: see lecture notes.
Answer:
Error propagation is the accumulation of roundoff error during the execution of a numerical algorithm. We observed error propagation in deflation methods to find all roots of a polynomial (see the project on Bairstow's method). Other instances of error propagation are Gaussian elimination without pivoting and the solution of ODEs (see the last project).
For each of the three fixed-point iterations, make a cobweb picture illustrating the convergence (or divergence), starting at x(0) = 0.9. Compute the convergence (or divergence) rate for each iteration. Which iteration is best?
Answers:
Before making the cobweb pictures, we first best examine the rate of convergence, because this rate determines the slope of the function g(x) at the fixed point, where g(x) defines the fixed-point iteration x(k+1) = g(x(k)).
We do not list the plots here.
-1.000 x_1 - 1.000 x_2 + 1.000 x_3 = -1.000
1.000 x_1 - 1.000 x_2 + 0.000 x_3 = 0.000
2.000 x_1 + 0.000 x_2 + 1.000 x_3 = 3.000
(Partial) Answers:
> a = [-1 -1 1; 1 -1 0; 2 0 1]
a =
-1 -1 1
1 -1 0
2 0 1
>> b = [-1;0;3]
b =
-1
0
3
>> a\b
ans =
1
1
1
>> [l,u,p] = lu(a)
l =
1.0000 0 0
0.5000 1.0000 0
-0.5000 1.0000 1.0000
u =
2.0000 0 1.0000
0 -1.0000 -0.5000
0 0 2.0000
p =
0 0 1
0 1 0
1 0 0
FINAL EXAM is in 2LCE E112 on Wednesday 7 December 2005, from 1 till 3PM.