- Source: Bisection method
In mathematics, the bisection method is a root-finding method that applies to any continuous function for which one knows two values with opposite signs. The method consists of repeatedly bisecting the interval defined by these values and then selecting the subinterval in which the function changes sign, and therefore must contain a root. It is a 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 starting point for more rapidly converging methods. The method is also called the interval halving method, the binary search method, or the dichotomy method.
For polynomials, more elaborate methods exist for testing the existence of a root in an interval (Descartes' rule of signs, Sturm's theorem, Budan's theorem). They allow extending the bisection method into efficient algorithms for finding all real roots of a polynomial; see Real-root isolation.
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 parts/halves by computing the midpoint c = (a+b) / 2 of the interval and the value of the function f(c) at that point. If c itself is a root then the process has succeeded and stops. Otherwise, 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(c)=0 then c may be taken as the solution and the process stops. Otherwise, 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. 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:
Calculate c, the midpoint of the interval, c = a + b/2.
Calculate the function value at the midpoint, f(c).
If convergence is satisfactory (that is, c − a is sufficiently small, or |f(c)| is sufficiently small), return c and stop iterating.
Examine the sign of f(c) and replace either (a, f(a)) or (b, f(b)) with (c, f(c)) so that there is a zero crossing within the new interval.
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 example, consider f(x) = cos x; there is no floating-point value approximating x = π/2 that gives exactly zero. Additionally, the difference between a and b is limited by the floating point precision; i.e., as the difference between a and b decreases, at some point the midpoint of [a, b] will be numerically identical to (within floating point precision of) either a or b.
= Algorithm
=The method may be written in pseudocode as follows:
input: Function f,
endpoint values a, b,
tolerance TOL,
maximum iterations NMAX
conditions: a < b,
either f(a) < 0 and f(b) > 0 or f(a) > 0 and f(b) < 0
output: value which differs from a root of f(x) = 0 by less than TOL
N ← 1
while N ≤ NMAX do // limit iterations to prevent infinite loop
c ← (a + b)/2 // new midpoint
if f(c) = 0 or (b – a)/2 < TOL then // solution found
Output(c)
Stop
end if
N ← N + 1 // increment step counter
if sign(f(c)) = sign(f(a)) then a ← c else b ← c // new interval
end while
Output("Method failed.") // max number of steps exceeded
= Example: Finding the root of a polynomial
=Suppose that the bisection method is used to find a root of the polynomial
f
(
x
)
=
x
3
−
x
−
2
.
{\displaystyle f(x)=x^{3}-x-2\,.}
First, two numbers
a
{\displaystyle a}
and
b
{\displaystyle b}
have to be found such that
f
(
a
)
{\displaystyle f(a)}
and
f
(
b
)
{\displaystyle f(b)}
have opposite signs. For the above function,
a
=
1
{\displaystyle a=1}
and
b
=
2
{\displaystyle b=2}
satisfy this criterion, as
f
(
1
)
=
(
1
)
3
−
(
1
)
−
2
=
−
2
{\displaystyle f(1)=(1)^{3}-(1)-2=-2}
and
f
(
2
)
=
(
2
)
3
−
(
2
)
−
2
=
+
4
.
{\displaystyle f(2)=(2)^{3}-(2)-2=+4\,.}
Because the function is continuous, there must be a root within the interval [1, 2].
In the first iteration, the end points of the interval which brackets the root are
a
1
=
1
{\displaystyle a_{1}=1}
and
b
1
=
2
{\displaystyle b_{1}=2}
, so the midpoint is
c
1
=
2
+
1
2
=
1.5
{\displaystyle c_{1}={\frac {2+1}{2}}=1.5}
The function value at the midpoint is
f
(
c
1
)
=
(
1.5
)
3
−
(
1.5
)
−
2
=
−
0.125
{\displaystyle f(c_{1})=(1.5)^{3}-(1.5)-2=-0.125}
. Because
f
(
c
1
)
{\displaystyle f(c_{1})}
is negative,
a
=
1
{\displaystyle a=1}
is replaced with
a
=
1.5
{\displaystyle a=1.5}
for the next iteration to ensure that
f
(
a
)
{\displaystyle f(a)}
and
f
(
b
)
{\displaystyle f(b)}
have opposite signs. As this continues, the interval between
a
{\displaystyle a}
and
b
{\displaystyle b}
will become increasingly smaller, converging on the root of the function. See this happen in the table below.
After 13 iterations, it becomes apparent that there is a convergence to about 1.521: a root for the polynomial.
Analysis
The method is guaranteed to converge to a root of f if f is a continuous function on the interval [a, b] and f(a) and f(b) have opposite signs. The absolute error is halved at each step so the method converges linearly. Specifically, if c1 = a+b/2 is the midpoint of the initial interval, and cn is the midpoint of the interval in the nth step, then the difference between cn and a solution c is bounded by
|
c
n
−
c
|
≤
|
b
−
a
|
2
n
.
{\displaystyle |c_{n}-c|\leq {\frac {|b-a|}{2^{n}}}.}
This formula can be used to determine, in advance, an upper bound on the number of iterations that the bisection method needs to converge to a root to within a certain tolerance.
The number n of iterations needed to achieve a required tolerance ε (that is, an error guaranteed to be at most ε), is bounded by
n
≤
n
1
/
2
≡
⌈
log
2
(
ϵ
0
ϵ
)
⌉
,
{\displaystyle n\leq n_{1/2}\equiv \left\lceil \log _{2}\left({\frac {\epsilon _{0}}{\epsilon }}\right)\right\rceil ,}
where the initial bracket size
ϵ
0
=
|
b
−
a
|
{\displaystyle \epsilon _{0}=|b-a|}
and the required bracket size
ϵ
≤
ϵ
0
.
{\displaystyle \epsilon \leq \epsilon _{0}.}
The main motivation to use the bisection method is that over the set of continuous functions, no other method can guarantee to produce an estimate cn to the solution c that in the worst case has an
ϵ
{\displaystyle \epsilon }
absolute error with less than n1/2 iterations. This is also true under several common assumptions on function f and the behaviour of the function in the neighbourhood of the root.
However, despite the bisection method being optimal with respect to worst case performance under absolute error criteria it is sub-optimal with respect to average performance under standard assumptions as well as asymptotic performance. Popular alternatives to the bisection method, such as the secant method, Ridders' method or Brent's method (amongst others), typically perform better since they trade-off worst case performance to achieve higher orders of convergence to the root. And, a strict improvement to the bisection method can be achieved with a higher order of convergence without trading-off worst case performance with the ITP Method.
Generalization to higher dimensions
The bisection method has been generalized to multi-dimensional functions. Such methods are called generalized bisection methods.
= Methods based on degree computation
=Some of these methods are based on computing the topological degree, which for a bounded region
Ω
⊆
R
n
{\displaystyle \Omega \subseteq \mathbb {R} ^{n}}
and a differentiable function
f
:
R
n
→
R
n
{\displaystyle f:\mathbb {R} ^{n}\rightarrow \mathbb {R} ^{n}}
is defined as a sum over its roots:
deg
(
f
,
Ω
)
:=
∑
y
∈
f
−
1
(
0
)
sgn
det
(
D
f
(
y
)
)
{\displaystyle \deg(f,\Omega ):=\sum _{y\in f^{-1}(\mathbf {0} )}\operatorname {sgn} \det(Df(y))}
,
where
D
f
(
y
)
{\displaystyle Df(y)}
is the Jacobian matrix,
0
=
(
0
,
0
,
.
.
.
,
0
)
T
{\displaystyle \mathbf {0} =(0,0,...,0)^{T}}
, and
sgn
(
x
)
=
{
1
,
x
>
0
0
,
x
=
0
−
1
,
x
<
0
{\displaystyle \operatorname {sgn}(x)={\begin{cases}1,&x>0\\0,&x=0\\-1,&x<0\\\end{cases}}}
is the sign function. In order for a root to exist, it is sufficient that
deg
(
f
,
Ω
)
≠
0
{\displaystyle \deg(f,\Omega )\neq 0}
, and this can be verified using a surface integral over the boundary of
Ω
{\displaystyle \Omega }
.
= Characteristic bisection method
=The characteristic bisection method uses only the signs of a function in different points. Lef f be a function from Rd to Rd, for some integer d ≥ 2. A characteristic polyhedron (also called an admissible polygon) of f is a polytope in Rd, having 2d vertices, such that in each vertex v, the combination of signs of f(v) is unique and the topological degree of f on its interior is not zero (a necessary criterion to ensure the existence of a root). For example, for d=2, a characteristic polyhedron of f is a quadrilateral with vertices (say) A,B,C,D, such that:
sgn
f
(
A
)
=
(
−
,
−
)
{\displaystyle \operatorname {sgn} f(A)=(-,-)}
, that is, f1(A)<0, f2(A)<0.
sgn
f
(
B
)
=
(
−
,
+
)
{\displaystyle \operatorname {sgn} f(B)=(-,+)}
, that is, f1(B)<0, f2(B)>0.
sgn
f
(
C
)
=
(
+
,
−
)
{\displaystyle \operatorname {sgn} f(C)=(+,-)}
, that is, f1(C)>0, f2(C)<0.
sgn
f
(
D
)
=
(
+
,
+
)
{\displaystyle \operatorname {sgn} f(D)=(+,+)}
, that is, f1(D)>0, f2(D)>0.
A proper edge of a characteristic polygon is a edge between a pair of vertices, such that the sign vector differs by only a single sign. In the above example, the proper edges of the characteristic quadrilateral are AB, AC, BD and CD. A diagonal is a pair of vertices, such that the sign vector differs by all d signs. In the above example, the diagonals are AD and BC.
At each iteration, the algorithm picks a proper edge of the polyhedron (say, A—B), and computes the signs of f in its mid-point (say, M). Then it proceeds as follows:
If
sgn
f
(
M
)
=
sgn
(
A
)
{\displaystyle \operatorname {sgn} f(M)=\operatorname {sgn}(A)}
, then A is replaced by M, and we get a smaller characteristic polyhedron.
If
sgn
f
(
M
)
=
sgn
(
B
)
{\displaystyle \operatorname {sgn} f(M)=\operatorname {sgn}(B)}
, then B is replaced by M, and we get a smaller characteristic polyhedron.
Else, we pick a new proper edge and try again.
Suppose the diameter (= length of longest proper edge) of the original characteristic polyhedron is D. Then, at least
log
2
(
D
/
ε
)
{\displaystyle \log _{2}(D/\varepsilon )}
bisections of edges are required so that the diameter of the remaining polygon will be at most ε.: 11, Lemma.4.7 If the topological degree of the initial polyhedron is not zero, then there is a procedure that can choose an edge such that the next polyhedron also has nonzero degree.
See also
Binary search algorithm
Lehmer–Schur algorithm, generalization of the bisection method in the complex plane
Nested intervals
References
Burden, Richard L.; Faires, J. Douglas (1985), "2.1 The Bisection Algorithm", Numerical Analysis (3rd ed.), PWS Publishers, ISBN 0-87150-857-5
Further reading
Corliss, George (1977), "Which root does the bisection algorithm find?", SIAM Review, 19 (2): 325–327, doi:10.1137/1019044, ISSN 1095-7200
Kaw, Autar; Kalu, Egwu (2008), Numerical Methods with Applications (1st ed.), archived from the original on 2009-04-13
External links
Weisstein, Eric W. "Bisection". MathWorld.
Bisection Method Notes, PPT, Mathcad, Maple, Matlab, Mathematica from Holistic Numerical Methods Institute
Kata Kunci Pencarian:
- Metode bagi-dua
- Parabola
- Bisection method
- Brent's method
- Root-finding algorithm
- Regula falsi
- Bisect
- Bisection (software engineering)
- Shooting method
- ITP method
- List of mathematics-based methods
- Newton's method