Lecture 2 PDF
Lecture 2 PDF
Lecture 2 PDF
Numerical Analysis
Lecture-2
Bisection Method
Definition
The first technique, based on the Intermediate Value Theorem, is
called the Bisection, or Binary-search, method.
1 a1 = a, b1 = b, p0 = a;
2 i = 1;
3 pi = 21 (ai + bi );
4 If |pi − pi−1 | < or |f (pi )| < then 10;
5 If f (pi )f (ai ) > 0, then 6;
If f (pi )f (ai ) < 0, then 8;
6 ai+1 = pi , bi+1 = bi ;
7 i = i + 1; go to 3;
8 ai+1 = ai ; bi+1 = pi ;
9 i = i + 1; go to 3;
10 End of Procedure.
Example
Show that f (x) = x 3 + 4x 2 − 10 = 0 has a root in [1, 2], and use
the Bisection method to determine an approximation to the root
that is accurate to at least within 10−4 .
Solution
Because f (1) = −5 and f (2) = 14 the Intermediate Value
Theorem ensures that this continuous function has a root in [1, 2].
For the first iteration of the Bisection method we use the fact that
at the midpoint of [1, 2] we have f (1.5) = 2.375 > 0. This
indicates that we should select the interval [1, 1.5] for our second
iteration. Then we find that f (1.25) = −1.796875 so our new
interval becomes [1.25, 1.5], whose midpoint is 1.375. Continuing
in this manner gives the values in Table on next slide.
Solution Contd...
Solution Contd...
Theorem
Suppose that f ∈ C [a, b] and f (a)f (b) < 0. The Bisection method
generates a sequence {pn }∞n=1 approximating a zero p of f with
b−a
|pn − p| ≤ , when n ≥ 1.
2n
Proof
For each n ≥ 1, we have
1
bn − an = (b − a) and p ∈ (an , bn ).
2n−1
Since pn = 12 (an + bn ) for all n ≥ 1, it follows that
1 b−a
|pn − p| ≤ (bn − an ) = .
2 2n
Rate of Convergence
Because
1
|pn − p| ≤ (b − a) ,
2n
the sequence {pn }∞n=1 converges to p with rate of convergence
O( 21n ); that is,
1
pn = p + O( ).
2n
Example
Using the Error Bound Determine the number of iterations
necessary to solve f (x) = x 3 + 4x 2 − 10 with accuracy 10−3 using
a1 = 1 and b1 = 2.
Solution
We we will use logarithms to find an integer N that satisfies
Solution Contd...
Since 2−N < 10−3 implies that log10 2−N < log10 10−3 = −3,
we have
3
−Nlog10 2 < −3 and N > ≈ 9.96.
log10 2
Hence, ten iterations will ensure an approximation accurate to
within 10−3 .
The earlier numerical results show that the value of
p9 = 1.365234375 is accurate to within 10−4 .
Again, it is important to keep in mind that the error analysis
gives only a bound for the number of iterations.
In many cases, this bound is much larger than the actual
number required.
Dr. Ilyas Fakhir Numerical Analysis