Bisection Method
Bisection Method
COMPUTER PROGRAMMING
INDIVIDUAL ASSIGNMENT
SECTION : 8
The bisection method in mathematics is a root-finding method that repeatedly bisects an interval
and then selects a subinterval in which a root must lie for further processing. It is very simple
and robust method, but it is also relatively slow. Because of this, it is often used to obtain a rough
approximation to a solution which is then used as a straight point for more rapidly converging
methods. The method is also called the interval halving method, the binary search method or the
dichotomy method.
The Method
The method is applicable for numerically solving the equation f(x) = 0 for the real variable x,
where f is a continuous function defined on an interval [a, b] and where f(a) and f(b) have
opposite signs. In this case a and b are said to bracket a root since, by the intermediate value
theorem, the continuous function f must have at least one root in the interval (a, b).
At each step the method divides the interval in two by computing the midpoint c = (a+b) / 2 of
the interval and the value of the function f(c) at that point. Unless c is itself a root (which is very
unlikely, but possible) there are now only two possibilities: either f(a) and f(c) have opposite
signs and bracket a root, or f(c) and f(b) have opposite signs and bracket a root. The method
selects the subinterval that is guaranteed to be a bracket as the new interval to be used in the next
step. In this way an interval that contains a zero of f is reduced in width by 50% at each step. The
process is continued until the interval is sufficiently small.
Explicitly, if f(a) and f(c) have opposite signs, then the method sets c as the new value for b, and
if f(b) and f(c) have opposite signs then the method sets c as the new a. (If f(c)=0 then c may be
taken as the solution and the process stops.) In both cases, the new f(a) and f(b) have opposite
signs, so the method is applicable to this smaller interval.
Iteration tasks
The input for the method is a continuous function f, an interval [a, b], and the function
values f(a) and f(b). The function values are of opposite sign (there is at least one zero crossing
within the interval). Each iteration performs these steps:
When implementing the method on a computer, there can be problems with finite precision, so
there are often additional convergence tests or limits to the number of iterations. Although f is
continuous, finite precision may preclude a function value ever being zero. For f(x) = x , there
will never be a finite representation of x that gives zero. Floating point representations also have
limited precision, so at some point the midpoint of [a, b] will be either a or b.
Example : A few step of the bisection method applied over the starting range ( a1,b1 ) the
bigger red dot is the root of the function.
PSEUODOCODE
Output
Input