Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

CSC3203 Numerical Computing Week-2

BISECTION METHOD

The bisection Method is one of the simplest, most reliable, easy to


implement, and convergence-guaranteed methods for finding the real
root of non-linear equations. It is also known as Binary Search or Half
Interval or Bolzano Method.

The bisection method is a bracketing method and starts with two initial
guesses say x0 and x1 such that x0 and x1 brackets the root
i.e. f(x0)f(x1)<0

The bisection method is based on the fact that if f(x) is a real and
continuous function, and for two initial guesses x0 and x1 brackets the
root such that: f(x0)f(x1)<0 then there exists at least one root
between x0 and x1.

The root is obtained in the Bisection method by successive halving the


interval i.e. If x0 and x1 are two guesses, then we compute the new
approximated root as:

x2 = (x0 + x1)/2

Now we have the following three different cases:

1. If f(x2)=0 then the root is x2.


2. If f(x0)f(x2)<0 then the root lies between x0 and x2.
3. If f(x0)f(x2)> 0 then root lies between x1 and x2.

And then the process is repeated until we find the root within the desired
accuracy.
CSC3203 Numerical Computing Week-2

Bisection Method Algorithm (Step Wise)

1. start

2. Define function f(x)

3. Choose initial guesses x0 and x1 such that


f(x0)f(x1) < 0

4. Choose pre-specified tolerable error e.

5. Calculate new approximated root as x2 = (x0 + x1)/2

6. Calculate f(x0)f(x2)
a. if f(x0)f(x2) < 0 then x0 = x0 and x1 = x2
b. if f(x0)f(x2) > 0 then x0 = x2 and x1 = x1
c. if f(x0)f(x2) = 0 then goto (8)

7. if |f(x2)| > e then goto (5) otherwise goto (8)

8. Display x2 as root.

9. Stop

In Numerical analysis (methods), Bisection method is one of the simplest,


convergence guaranteed method to find real root of non-linear
equations.

Merits of Bisection Method

Bisection method also known as Bolzano or Half Interval, or Binary


Search method has the following merits or benefits:

1. Convergence is guaranteed: The bisection method is a


bracketing method and it is always convergent.
CSC3203 Numerical Computing Week-2
2. Error can be controlled: In the Bisection method, an increasing
number of iterations always yields a more accurate root.
3. Does not involve complex calculations: The bisection method
does not require any complex calculations. To perform the
Bisection method, all we need is to calculate the average of two
numbers.
4. Guaranteed error bound: In this method, there is a guaranteed
error bound, and it decreases with each successive iteration. The
error bound decreases by ½ with each iteration.
5. Bisection method is very simple and easy to program on the
computer.
6. Bisection method is fast in case of multiple roots.

Demerits of Bisection Method

In Numerical analysis (methods), the Bisection method has a slow rate of


convergence. The bisection method has the following demerits:

1. Slow Rate of Convergence: Although the convergence of the


Bisection method is guaranteed, it is generally slow.
2. Choosing one guess close to the root has no
advantage: Choosing one guess close to the root may result in
requiring many iterations to converge.

3. Cannot find the root of some equations. For example: f(x) =


x2 as there are no bracketing values.
4. It has a linear rate of convergence.
5. It fails to determine complex roots.
6. It cannot be applied if there are discontinuities in the guess
interval.
7. It cannot be applied over an interval where the function takes
values of the same sign.
CSC3203 Numerical Computing Week-2

Example 1:

Use Bisection method to find a root of f(x) = x^3 - x – 1 with an accuracy


of 0.001.

Solution:

Initial Guess: For x = 1, f(x) = -1, and for x = 2, f(x) = 5

Step x0 x1 x2 f(x2)
1 1 2 1.5 0.875
2 1 1.5 1.25 -0.296875
3 1.25 1.5 1.375 0.224609
4 1.25 1.375 1.3125 -0.051514
5 1.3125 1.375 1.34375 0.082611
6 1.3125 1.34375 1.328125 0.014576
7 1.3125 1.328125 1.320313 -0.018711
8 1.320313 1.328125 1.324219 -0.002128
9 1.324219 1.328125 1.326172 0.006209
10 1.324219 1.326172 1.325195 0.002037
11 1.324219 1.325195 1.324707 -0.000047

Here, after the calculations, we find that 1.324707 is the


required root.
CSC3203 Numerical Computing Week-2
Example 2: Find the root of f(x) = 10 − x², with an error tolerance of
0.01
Solution:

The calculation of the value is described below in the table:

i X0 X1 X2 f(x0) f(x1) f(x2)

0 −2 5 1.5 6 −15 7.75

1 1.5 5 3.25 7.75 −15 −0.5625

2 1.5 3.25 2.375 7.75 −0.5625 4.359375

3 2.375 3.25 2.8125 4.359375 −0.5625 2.0898438

4 2.8125 3.25 3.03125 2.0898438 −0.5625 0.8115234

5 3.03125 3.25 3.140625 0.8115234 −0.5625 0.1364746

6 3.140625 3.25 3.1953125 0.1364746 −0.5625 −0.210022

7 3.140625 3.1953125 3.1679688 0.1364746 −0.210022 −0.036026

8 3.140625 3.1679688 3.1542969 0.1364746 −0.036026 0.0504112

9 3.1542969 3.1679688 3.1611328 0.0504112 −0.036026 0.0072393

At initialization (i = 0), we choose x0 = −2 and x1 = 5. After evaluating


the function at both points, we find that f(x0) is positive while f(x1) is
negative. This means that between these points, the plot of the
function will cross the x-axis at a particular point, which is the root
we need to find.

The value of f(x2) after 9 iterations is less than our defined tolerance
(0.0072393 < 0.01). This means that the value that approximates best
the root of the function f is the last value of x2 = 3.1611328.
Check:
By solving our quadratic equations in a classic way, we can check our
result:
10 − x2 =0
x² = 10
x = √10
x = ±3.16227766
CSC3203 Numerical Computing Week-2

Bisection Method Convergence

The rate of convergence of the Bisection method is linear and slow but
it is guaranteed to converge if the function is real and continuous in an
interval bounded by given two initial guesses.

The accuracy of the bisection method is very good and this method is
more reliable than other open methods like Secant, Newton Raphson
method, etc.

Despite being slower to converge, the accuracy of this method increases


as the number of iterations increases.

In the Bisection method, the error is reduced by a factor of ½ after each


iteration, for this reason, the Bisection method is said to have linear rate
of convergence.

*****

You might also like