Bisection Method
Bisection Method
a+b/2
[a,c] [c,b]
f(a)f(c) < 0
yes no
2
b0 a 0
ln nln2
2
ln b 0 a 0 - ln(2. )
n
ln2
+&-
Robost (very nice and very stable)
Each time iter only cut half of error
Many iteration 50 ~ 60
Very slow
a b 1
6
tol 10
Examples
1. Given that f ( x) x 3 2 x 2 0
has a root between 0 and 1. Find the root to
1 decimal place (1 dp), using the bisection
method
2. f(x) 2x 4 3x 8 0 ; 1 & 1.5
3. f(x) e x 5x 2 interval 0, 1 dan 0.00001
II. Fixed Point Iteration : x = g(x) method
if g ' ( ) 1 ek 1 ek ; Divergen
Convergence Condition
There exist an interval
I = [r c, r + c] for some c > 0, s.t |g(x)| < 1
On I, and x0 I
Back to example
1 g(x) cos(x), g' (x) sin(x)
[0.5 , 1] m max g' (x) sin(1) 1
2 g(x) e 2x (x 1 ) x
g' (x) 2e 2x (x 1) e 2x 1
g' (1) e 2 1 1 Divergen
Pseudo Code
r = fixed point(g, x, tol, nmax)
r = g(x) ; nit = 1;
while(abs r g(r) > tol and nit < nmax)
r = g(r),
nit = nit + 1;
end
end
How many iteration to achieve !!
Q : Assume convergence given x0 , find minimum iteration
needed
A :Assume g' (x) m 1 on [r c, r c]
e k 1 m . e k induction steps
e k m . e k 1 m . me k 2 . . . . m k e 0 ; e 0 unknown
e 0 r x 0 r x1 x1 x 0 r x1 x1 x 0
m.e 0 x1 x 0 e1 m.e 0
x1 x 0
(1 m)e 0 x1 x 0 e0
1 m
Plug in :
x1 x 0
ek m . k
1 m
Given tolerance (e) i.e e k e
x1 x 0
m k
e
1 m
e1 m e(1 m)
m k
k(ln m) ln
x1 x 0 x
1 x 0
e(1 m)
k(ln m) ln
x1 x 0
e(1 m)
k ln
ln m
x
1 x 0
Ex.3
x = g(x) = cos(x) |g(x)| = sin(x)
x0 = 1 ; r 0.7 I = [0,1]
M = max |sin(x)| = sin(1) = 0.8415
0 x 1
X1 = cos(1) = 0.5403
Tol e = 10-5
By formula k 73 (worst possible scenario)
Real time simulation (iteration = 25)