Flow Chart of Bisection Method: Start: Given a,b and ε u = f (a) ; v = f (b) c = (a+b) /2 ; w = f (c) yes no no
Flow Chart of Bisection Method: Start: Given a,b and ε u = f (a) ; v = f (b) c = (a+b) /2 ; w = f (c) yes no no
u = f(a) ; v = f(b)
c = (a+b) /2 ; w = f(c) no
yes
is no is
Stop
yes (b-a) /2<ε
u w <0
b=c; v= w a=c; u= w
CISE301_Topic2
Example
Can you use Bisection method to find a zero of :
f ( x) x 3 3x 1 in the interval [0,2]?
Answer:
f ( x) is continuous on [0,2]
and f(0) * f(2) (1)(3) 3 0
Assumption s are not satisfied
Bisection method can not be used
CISE301_Topic2
Example
Can you use Bisection method to find a zero of :
f ( x) x 3 3x 1 in the interval [0,1]?
Answer:
f ( x) is continuous on [0,1]
and f(0) * f(1) (1)(-1) 1 0
Assumption s are satisfied
Bisection method can be used
CISE301_Topic2
Best Estimate and Error Level
Bisection method obtains an interval that
is guaranteed to contain a zero of the
function.
Questions:
What is the best estimate of the zero of f(x)?
What is the error level in the obtained estimate?
CISE301_Topic2
Best Estimate and Error Level
The best estimate of the zero of the
function f(x) after the first iteration of the
Bisection method is the mid point of the
initial interval:
ba
Estimate of the zero : r
2
ba
Error
2
CISE301_Topic2
Stopping Criteria
Two common stopping criteria
CISE301_Topic2
Stopping Criteria
cn : is the midpoint of the interval at the n th iteration
( cn is usually used as the estimate of the root).
r: is the zero of the function.
After n iterations :
b a x 0
error r - cn Ean n n
2 2
CISE301_Topic2
Convergence Analysis
Given f ( x), a, b, and
How many iterations are needed such that : x - r
where r is the zero of f(x) and x is the
bisection estimate (i.e., x ck ) ?
log(b a) log( )
n
log( 2)
CISE301_Topic2
Convergence Analysis – Alternative
Form
log(b a ) log( )
n
log( 2)
CISE301_Topic2
Example
a 6, b 7, 0.0005
How many iterations are needed such that : x - r ?
n 11
CISE301_Topic2