Bisection method
From Wikipedia, the free encyclopedia
|
Image:Bisection method.png
A few steps of the bisection method applied over the starting range [a1;b1]. The bigger red dot is the root of the function.
In mathematics, the bisection method is a root-finding algorithm which works by repeatedly dividing an interval in half and then selecting the subinterval in which a root exists. Suppose we want to solve the equation f(x) = 0. Given two points a and b such that f(a) and f(b) have opposite signs, we know by the intermediate value theorem that f must have at least one root in the interval [a, b] as long as f is continuous on this interval. The bisection method divides the interval in two by computing c = (a+b) / 2. There are now two possibilities: either f(a) and f(c) have opposite signs, or f(c) and f(b) have opposite signs. The bisection algorithm is then applied recursively to the sub-interval where the sign change occurs. The bisection method is less efficient than Newton's method but it is much less prone to odd behavior. If f is a continuous function on the interval [a, b] and f(a)f(b) < 0, then the bisection method converges to a root of f. In fact, the absolute error is halved at each step. After n steps, the maximum absolute error is
The method converges linearly, which is quite slow. On the positive side, the method is guaranteed to converge if f(a) and f(b) have different sign. If f has several roots in the interval [a, b], then the bisection method finds the odd-numbered roots with equal, non-zero probability and the even-numbered roots with zero probability (Corliss 1977).
Pseudo-codeHere is a representation of the bisection method in Visual Basic code. The variables left and right correspond to a and b above. The initial left and right must be chosen so that f(left) and f(right) are of opposite sign (they 'bracket' a root). The variable epsilon specifies how precise the result will be.
'Bisection Method
'Start loop
Do While (abs(right - left) > 2*epsilon)
'Calculate midpoint of domain
midpoint = (right + left) / 2
'Find f(midpoint)
If ((f(left) * f(mid)) > 0) Then
'Throw away left half
left = midpoint
Else
'Throw away right half
right = midpoint
End If
Loop
Return (right + left) / 2
See also
References
External links
es:Método de bisección fr:Méthode de dichotomie it:Metodo della bisezione he:שיטת החצייה nl:Bisectie ja:二分法 pl:Metoda równego podziału ru:Метод бисекции sl:Bisekcija (numerična metoda) sr:Метода половљења интервала |


