Numerical methods for solving a nonlinear equation: The bisection method
The bisection method
The bisection method, also called binary search (bisection is Latin for division in two), is a special case of a method in which the search area for a solution of a non-linear equation is systematically reduced in steps.
We start with a continuous function on the closed interval with .
In other words, and have different signs and continuity means that you can draw the graph of on without having to take the pen off the paper. Then the mean value theorem informs us that at least one zero of can be found on the open interval .
All we have to do is systematically reduce the interval in which we search for a zero. In the bisection method, this is done—nomen est omen—by halving repeatedly subintervals of and determining in each step which interval contains at least one zero.
At the beginning, the interval is equal to and you first investigate whether the number is a zero of the function . If this is the case you are done because a zero has been found; if not, split the interval into left and right subintervals, and , respectively. At what interval the search for a zero continues depends on the sign of . If this sign is opposite to that of choose the left interval, otherwise continue with the right interval. You repeat this halving process until you have reached a zero or half the length of the interval is smaller than a predetermined value. In the latter case, you choose the middle of the last found interval as an answer to an approximation of the zero of the function. The figure below illustrates the first iterations in the bisection method to find a zero of a function .
So what you get is a sequence of intervals
Interactive version of the bisection method In the interactive diagram below you can observe the first 10 iteration steps in the bisection method by clicking the Next button. A restart can done via the Reset icon or by entering (again) the function or the border points.
There are, of course, other criteria for stopping to come up with.
For example, you can look at the relative truncation error
The number of iterations required to find an answer of a certain accuracy is a measure of the method's efficiency. The speed at which the series of approximations gets closer to the zero, i.e. converges to the zero, is called the convergence speed of the method. You investigate the convergence speed by checking how many iterations are needed to find the approximation within the specified tolerance at different, ever-decreasing tolerances. Usually this is done by systematically reducing the tolerance according to a sequence so that more and more decimal places become correct. The convergence is linear if the relationship between the number of iterations and the number of correctly calculated decimal places is linear. This is the case in the halving method and, moreover, the truncation error halves with every iteration.
Example of the bisection method The polynomial function has a zero on the interval because and . The bisection method successively gives the intervals and approximations from the table below.
It is tempting to look at the sequence of the middles of the consecutive intervals and use one of the stopping criteria below: