2-1. The Bisection Method

공부하자·2022년 9월 14일
0

수치해석

목록 보기
1/9
post-thumbnail

Summary

pNp2N(ba)=2N<10x.\left|p_N-p\right| \leq 2^{-N}(b-a)=2^{-N}<10^{-x} .

The Bisection Method

The Root-Finding Problem

  • The problem of finding an approximation to the root of an equation can be traced back at least to 1700 B.C.E.
  • A cuneiform table in the Yale Babylonian Collection dating from that period gives a sexigesimal (base-60) number equivalent to
    1.4142221.414222
    as an approximation to
    2\sqrt{2}
    a result that is accurate to within 10510^{-5}.

The Bisection Method

Overview

  • We first consider the Bisection (Binary search) Method which is based on the Intermediate Value Theorem (IVT).
  • Suppose a continuous function ff, defined on [a,b][a, b] is given with f(a)f(a) and f(b)f(b) of opposite sign.
  • By the IVT, there exists a point p(a,b)p \in(a, b) for which f(p)=0f(p)=0. In what follows, it will be assumed that the root in this interval is unique.

Intermediate Value Theorem

If fC[a,b]f \in C[a, b] and KK is any number between f(a)f(a) and f(b)f(b), then there exists a number c(a,b)c \in(a, b) for which f(c)=Kf(c)=K.

Bisection Technique

Main Assumptions

  • Suppose ff is a continuous function defined on the interval [a,b][a, b], with f(a)f(a) and f(b)f(b) of opposite sign.
  • The Intermediate Value Theorem implies that a number pp exists in (a,b)(a, b) with f(p)=0f(p)=0.
  • Although the procedure will work when there is more than one root in the interval (a,b)(a, b), we assume for simplicity that the root in this interval is unique.
  • The method calls for a repeated halving (or bisecting) of subintervals of [a,b][a, b] and, at each step, locating the half containing pp.

Computational Steps

To begin, set a1=aa_1=a and b1=bb_1=b, and let p1p_1 be the midpoint of [a,b][a, b]; that is,

p1=a1+b1a12=a1+b12.p_1=a_1+\frac{b_1-a_1}{2}=\frac{a_1+b_1}{2} .
  • If f(p1)=0f\left(p_1\right)=0, then p=p1p=p_1, and we are done.
  • If f(p1)0f\left(p_1\right) \neq 0, then f(p1)f\left(p_1\right) has the same sign as either f(a1)f\left(a_1\right) or f(b1)f\left(b_1\right).
    • If f(p1)f\left(p_1\right) and f(a1)f\left(a_1\right) have the same sign, p(p1,b1)p \in\left(p_1, b_1\right). Set a2=p1a_2=p_1 and b2=b1b_2=b_1.
    • If f(p1)f\left(p_1\right) and f(a1)f\left(a_1\right) have opposite signs, p(a1,p1)p \in\left(a_1, p_1\right). Set a2=a1a_2=a_1 and b2=p1b_2=p_1.

Then re-apply the process to the interval [a2,b2]\left[a_2, b_2\right], etc.

The Bisection Method to solve f(x)=0

Interval Halving to Bracket the Root

Given the function f defiend on [a,b] satisfying f(a)f(b) < 0.

The Bisection Method

Comment on Stopping Criteria for the Algorithm

  • Other stopping procedures can be applied in Step 4.
  • For example, we can select a tolerance ϵ>0\epsilon>0 and generate p1,,pNp_1, \ldots, p_N until one of the following conditions is met:
    pNpN1<ϵpNpN1pN<ϵ,pN0, or f(pN)<ϵ\begin{aligned} \left|p_N-p_{N-1}\right| &<\epsilon \\ \frac{\left|p_N-p_{N-1}\right|}{\left|p_N\right|} &<\epsilon, \quad p_N \neq 0, \quad \text { or } \\ \left|f\left(p_N\right)\right| &<\epsilon \end{aligned}
  • Without additional knowledge about ff or pp, Inequality (2) is the best stopping criterion to apply because it comes closest to testing relative error.

Solving f(x)=x3+4x210=0f(x)=x^3+4 x^2-10=0

Example: The Bisction Method

Show that f(x)=x3+4x210=0f(x)=x^3+4 x^2-10=0 has a root in [1,2][1,2] and use the Bisection method to determine an approximation to the root that is accurate to at least within 10410^{-4}.

Relative Error Test

Note that, for this example, the iteration will be terminated when a bound for the relative error is less than 10410^{-4}, implemented in the form:
pnpn1pn<104\frac{\left|p_n-p_{n-1}\right|}{\left|p_n\right|}<10^{-4}

Bisection Method applied to f(x)=x3+4x210f(x)=x^3+4 x^2-10

Solution

  • Because f(1)=5f(1)=-5 and f(2)=14f(2)=14 the Intermediate Value Theorem ensures that this continuous function has a root in [1,2][1,2]. -ivt
  • For the first iteration of the Bisection method we use the fact that at the midpoint of [1,2][1,2] we have f(1.5)=2.375>0f(1.5)=2.375>0.
  • This indicates that we should select the interval [1,1.5][1,1.5] for our second iteration.
  • Then we find that f(1.25)=1.796875f(1.25)=-1.796875 so our new interval becomes [1.25,1.5][1.25,1.5], whose midpoint is 1.3751.375.
  • Continuing in this manner gives the values shown in the following table.

  • After 13 iterations, p13=1.365112305p_{13}=1.365112305 approximates the root pp with an error
    pp13<b14a14=1.36523441.3651123=0.0001221\left|p-p_{13}\right|<\left|b_{14}-a_{14}\right|=|1.3652344-1.3651123|=0.0001221
    Since a14<p\left|a_{14}\right|<|p|, we have
    pp13p<b14a14a149.0×105,\frac{\left|p-p_{13}\right|}{|p|}<\frac{\left|b_{14}-a_{14}\right|}{\left|a_{14}\right|} \leq 9.0 \times 10^{-5},
    so the approximation is correct to at least within 10410^{-4}.
  • The correct value of pp to nine decimal places is p=1.365230013p=1.365230013

Intermediate Value Teorem

If fC[a,b]f \in C[a, b] and KK is any number between f(a)f(a) and f(b)f(b), then there exists a number c(a,b)c \in(a, b) for which f(c)=Kf(c)=K

Theretical Result for the Bisction Method

Theorem

Suppose that fC[a,b]f \in C[a, b] and f(a)f(b)<0f(a) \cdot f(b)<0. The Bisection method generates a sequence {pn}n=1\left\{p_n\right\}_{n=1}^{\infty} approximating a zero pp of ff with

pnpba2n, when n1\left|p_n-p\right| \leq \frac{b-a}{2^n}, \quad \text { when } n \geq 1 \text {. }

Proof.

For each n1n \geq 1, we have

bnan=12n1(ba) and p(an,bn).b_n-a_n=\frac{1}{2^{n-1}}(b-a) \text { and } p \in\left(a_n, b_n\right) .

Since pn=12(an+bn)p_n=\frac{1}{2}\left(a_n+b_n\right) for all n1n \geq 1, it follows that

pnp12(bnan)=ba2n.\left|p_n-p\right| \leq \frac{1}{2}\left(b_n-a_n\right)=\frac{b-a}{2^n} .

Rate of Convergence

Because

pnp(ba)12n,\left|p_n-p\right| \leq(b-a) \frac{1}{2^n},

the sequence {pn}n=1\left\{p_n\right\}_{n=1}^{\infty} converges to pp with rate of convergence O(12n)O\left(\frac{1}{2^n}\right); that is,

pn=p+O(12n).p_n=p+O\left(\frac{1}{2^n}\right) .

Conservative Error Bound

  • It is important to realize that the theorem gives only a bound for approximation error and that this bound might be quite conservative.
  • For example, this bound applied to the earlier problem, namely where
    f(x)=x3+4x210f(x)=x^3+4 x^2-10
    ensures only that
    pp921292×103\left|p-p_9\right| \leq \frac{2-1}{2^9} \approx 2 \times 10^{-3}
    but the actual error is much smaller:
    pp9=1.3652300131.3652343754.4×106\left|p-p_9\right|=|1.365230013-1.365234375| \approx 4.4 \times 10^{-6}

Example: Using the Error Bound

Determine the number of iterations necessary to solve f(x)=x3+4x210=0f(x)=x^3+4 x^2-10=0 with accuracy 10310^{-3} using a1=1a_1=1 and b1=2b_1=2.

Solution

  • We we will use logarithms to find an integer NN that satisfies
    pNp2N(ba)=2N<103.\left|p_N-p\right| \leq 2^{-N}(b-a)=2^{-N}<10^{-3} .
  • Logarithms to any base would suffice, but we will use base-10 logarithms because the tolerance is given as a power of 10 .
  • Since 2N<1032^{-N}<10^{-3} implies that log102N<log10103=3\log _{10} 2^{-N}<\log _{10} 10^{-3}=-3, we have
    Nlog102<3-N \log _{10} 2<-3 and N>3log1029.96N>\frac{3}{\log _{10} 2} \approx 9.96
  • Hence, ten iterations will ensure an approximation accurate to within 10310^{-3}.
  • The earlier numerical results show that the value of p9=1.365234375p_9=1.365234375 is accurate to within 10410^{-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.

Final Remarks

  • The Bisection Method has a number of significant drawbacks.
  • Firstly it is very slow to converge in that NN may become quite large before ppNp-p_N becomes sufficiently small.
  • Also it is possible that a good intermediate approximation may be inadvertently discarded.
  • It will always converge to a solution however and, for this reason, is often used to provide a good initial approximation for a more efficient procedure.

이분법은 많은 중요한 결점들을 가지고 있다.
첫째, p-pN이 충분히 작아지기 전에 N이 상당히 커질 수 있다는 점에서 수렴하는 것은 매우 느리다.
또한 좋은 중간 근사치가 실수로 폐기될 수 있다.
그러나 이는 항상 솔루션으로 수렴되며, 이러한 이유로 더 효율적인 절차를 위해 좋은 초기 근사치를 제공하는 데 종종 사용된다.

profile
아주대학교 수업 기록

0개의 댓글