Professional Documents
Culture Documents
Revision On Bisection Method
Revision On Bisection Method
BISECTION
METHOD
IN GENERAL :
• Problem: to find the root of the function.
Condition:
• a) The function f(x) must be a continous
function defined on the interval [a,b].
• b) f(a) and f(b) must be in opposite sign.
Therefore, we need to run a test on it.
Test of the sign of f(a) and f(b):
f(a) . f(b)
<0
-root exists between this
interval [a,b]
>0
-root does not exist
between this interval
Algorithm:
Iteration 0: As an example, let
f(x)=2x
Let f(x)=0 2x=0
Iteration 1:
Choose 2 initial guess as a1 and b1and run a test for f(a).f(b)<0
If f(a).f(b)<0 means that there is
Iteration 2: a1 between
at least a root exist b1 the
else there is no
p1 [a,b];
interval of
Find p1 (mid point of a1 and b1) by using the formula
root exists. 2
Iteration 3:
Find the absolute relative error and compare it with the tolerance error.
Pn Pn 1
If | a || | tolerance , STOP!!! Else ,continue.
Pn
Iteration 4:
Test f(a1) . f(p1).
• In iteration 4:
• Case 1: f ( a1 ). f ( p1 ) 0 Means that a1 and p1 has
different sign.
a2 a1
b2 p1 Thus, there is at least one
root exists in this interval
of [a1,p1]
• Case 2:
f ( a1 ). f ( p1 ) 0 Means that a1 and p1 has
SAME sign.
a 2 p1
Thus, NO root exists in this
b2 b1 interval of [a1,p1]
But, there is at least one
root exists in the interval of
[p1,b1]
• Case 3:
f (a1 ). f ( p1 ) 0 The root is p1 itself. so we
STOP!!!