The Bisection Method for Root finding on an Interval
A root of a function is an input value that produces an output of zero. When a function is plotted, the roots are points where the function crosses the x-axis. Usually, we can use Vieta’s formulas to find roots of polynomial equations. But how does the computer find the roots? Some scientists have implemented several numerical root- finding methods to solve the problem.
The numerical root finding methods use iteration, producing a sequence of numbers that hopefully converge towards a limit which is a root.
In this article, the animation package’s function
bisection.method()
is applied to show you one of the numercical root-finding methods – the
Bisection Method.
Basically, the bisection method finding the root from both sides by making use of the Intermediate Value Theorem. In essence, this theorem says that if is a continous function on and the sign of is different from the sign of , then there must be some point , in the interval such that , and is thus a root of the function.
Here is an example of Bisection Method, the continuous function is , the interval is . The root on the interval is 3.184.
library(animation)
ani.options(interval = 2)
par(mar = c(4, 4.5, 2, 1.5))
f = function(x) x^3 - 7 * x - 10
xx = bisection.method(f, c(-3, 5))
xx$root
## [1] 3.184