Solutions of Equations in One Variable The Bisection Method - - PowerPoint PPT Presentation

solutions of equations in one variable the bisection
SMART_READER_LITE
LIVE PREVIEW

Solutions of Equations in One Variable The Bisection Method - - PowerPoint PPT Presentation

Solutions of Equations in One Variable The Bisection Method Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University 2011 Brooks/Cole, Cengage Learning c


slide-1
SLIDE 1

Solutions of Equations in One Variable The Bisection Method

Numerical Analysis (9th Edition) R L Burden & J D Faires

Beamer Presentation Slides prepared by John Carroll Dublin City University

c 2011 Brooks/Cole, Cengage Learning

slide-2
SLIDE 2

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 2 / 32

slide-3
SLIDE 3

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

2

Introducing the Bisection Method

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 2 / 32

slide-4
SLIDE 4

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

2

Introducing the Bisection Method

3

Applying the Bisection Method

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 2 / 32

slide-5
SLIDE 5

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

2

Introducing the Bisection Method

3

Applying the Bisection Method

4

A Theoretical Result for the Bisection Method

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 2 / 32

slide-6
SLIDE 6

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

2

Introducing the Bisection Method

3

Applying the Bisection Method

4

A Theoretical Result for the Bisection Method

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 3 / 32

slide-7
SLIDE 7

Context Bisection Method Example Theoretical Result

The Root-Finding Problem

A Zero of function f(x)

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 4 / 32

slide-8
SLIDE 8

Context Bisection Method Example Theoretical Result

The Root-Finding Problem

A Zero of function f(x)

We now consider one of the most basic problems of numerical approximation, namely the root-finding problem.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 4 / 32

slide-9
SLIDE 9

Context Bisection Method Example Theoretical Result

The Root-Finding Problem

A Zero of function f(x)

We now consider one of the most basic problems of numerical approximation, namely the root-finding problem. This process involves finding a root, or solution, of an equation of the form f(x) = 0 for a given function f.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 4 / 32

slide-10
SLIDE 10

Context Bisection Method Example Theoretical Result

The Root-Finding Problem

A Zero of function f(x)

We now consider one of the most basic problems of numerical approximation, namely the root-finding problem. This process involves finding a root, or solution, of an equation of the form f(x) = 0 for a given function f. A root of this equation is also called a zero of the function f.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 4 / 32

slide-11
SLIDE 11

Context Bisection Method Example Theoretical Result

The Root-Finding Problem

Historical Note

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 5 / 32

slide-12
SLIDE 12

Context Bisection Method Example Theoretical Result

The Root-Finding Problem

Historical Note

The problem of finding an approximation to the root of an equation can be traced back at least to 1700 B.C.E.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 5 / 32

slide-13
SLIDE 13

Context Bisection Method Example Theoretical Result

The Root-Finding Problem

Historical Note

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.414222 as an approximation to √ 2 a result that is accurate to within 10−5.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 5 / 32

slide-14
SLIDE 14

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

2

Introducing the Bisection Method

3

Applying the Bisection Method

4

A Theoretical Result for the Bisection Method

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 6 / 32

slide-15
SLIDE 15

Context Bisection Method Example Theoretical Result

The Bisection Method

Overview

We first consider the Bisection (Binary search) Method which is based on the Intermediate Value Theorem (IVT).

IVT Illustration Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 7 / 32

slide-16
SLIDE 16

Context Bisection Method Example Theoretical Result

The Bisection Method

Overview

We first consider the Bisection (Binary search) Method which is based on the Intermediate Value Theorem (IVT).

IVT Illustration

Suppose a continuous function f, defined on [a, b] is given with f(a) and f(b) of opposite sign.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 7 / 32

slide-17
SLIDE 17

Context Bisection Method Example Theoretical Result

The Bisection Method

Overview

We first consider the Bisection (Binary search) Method which is based on the Intermediate Value Theorem (IVT).

IVT Illustration

Suppose a continuous function f, defined on [a, b] is given with f(a) and f(b) of opposite sign. By the IVT, there exists a point p ∈ (a, b) for which f(p) = 0. In what follows, it will be assumed that the root in this interval is unique.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 7 / 32

slide-18
SLIDE 18

Context Bisection Method Example Theoretical Result

Bisection Technique

Main Assumptions

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 8 / 32

slide-19
SLIDE 19

Context Bisection Method Example Theoretical Result

Bisection Technique

Main Assumptions

Suppose f is a continuous function defined on the interval [a, b], with f(a) and f(b) of opposite sign.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 8 / 32

slide-20
SLIDE 20

Context Bisection Method Example Theoretical Result

Bisection Technique

Main Assumptions

Suppose f is a continuous function defined on the interval [a, b], with f(a) and f(b) of opposite sign. The Intermediate Value Theorem implies that a number p exists in (a, b) with f(p) = 0.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 8 / 32

slide-21
SLIDE 21

Context Bisection Method Example Theoretical Result

Bisection Technique

Main Assumptions

Suppose f is a continuous function defined on the interval [a, b], with f(a) and f(b) of opposite sign. The Intermediate Value Theorem implies that a number p exists in (a, b) with f(p) = 0. Although the procedure will work when there is more than one root in the interval (a, b), we assume for simplicity that the root in this interval is unique.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 8 / 32

slide-22
SLIDE 22

Context Bisection Method Example Theoretical Result

Bisection Technique

Main Assumptions

Suppose f is a continuous function defined on the interval [a, b], with f(a) and f(b) of opposite sign. The Intermediate Value Theorem implies that a number p exists in (a, b) with f(p) = 0. Although the procedure will work when there is more than one root in the interval (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] and, at each step, locating the half containing p.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 8 / 32

slide-23
SLIDE 23

Context Bisection Method Example Theoretical Result

Bisection Technique

Computational Steps

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 9 / 32

slide-24
SLIDE 24

Context Bisection Method Example Theoretical Result

Bisection Technique

Computational Steps

To begin, set a1 = a and b1 = b, and let p1 be the midpoint of [a, b]; that is, p1 = a1 + b1 − a1 2 = a1 + b1 2 .

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 9 / 32

slide-25
SLIDE 25

Context Bisection Method Example Theoretical Result

Bisection Technique

Computational Steps

To begin, set a1 = a and b1 = b, and let p1 be the midpoint of [a, b]; that is, p1 = a1 + b1 − a1 2 = a1 + b1 2 . If f(p1) = 0, then p = p1, and we are done.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 9 / 32

slide-26
SLIDE 26

Context Bisection Method Example Theoretical Result

Bisection Technique

Computational Steps

To begin, set a1 = a and b1 = b, and let p1 be the midpoint of [a, b]; that is, p1 = a1 + b1 − a1 2 = a1 + b1 2 . If f(p1) = 0, then p = p1, and we are done. If f(p1) = 0, then f(p1) has the same sign as either f(a1) or f(b1).

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 9 / 32

slide-27
SLIDE 27

Context Bisection Method Example Theoretical Result

Bisection Technique

Computational Steps

To begin, set a1 = a and b1 = b, and let p1 be the midpoint of [a, b]; that is, p1 = a1 + b1 − a1 2 = a1 + b1 2 . If f(p1) = 0, then p = p1, and we are done. If f(p1) = 0, then f(p1) has the same sign as either f(a1) or f(b1).

⋄ If f(p1) and f(a1) have the same sign, p ∈ (p1, b1). Set a2 = p1 and b2 = b1.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 9 / 32

slide-28
SLIDE 28

Context Bisection Method Example Theoretical Result

Bisection Technique

Computational Steps

To begin, set a1 = a and b1 = b, and let p1 be the midpoint of [a, b]; that is, p1 = a1 + b1 − a1 2 = a1 + b1 2 . If f(p1) = 0, then p = p1, and we are done. If f(p1) = 0, then f(p1) has the same sign as either f(a1) or f(b1).

⋄ If f(p1) and f(a1) have the same sign, p ∈ (p1, b1). Set a2 = p1 and b2 = b1. ⋄ If f(p1) and f(a1) have opposite signs, p ∈ (a1, p1). Set a2 = a1 and b2 = p1.

Then re-apply the process to the interval [a2, b2], etc.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 9 / 32

slide-29
SLIDE 29

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

Interval Halving to Bracket the Root

x y f (a) f (p2) f (p1) f (b) y 5 f (x) a 5 a1 b 5 b1 p p1 p2 p3 a1 b1 p1 p2 a2 b2 p3 a3 b3

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 10 / 32

slide-30
SLIDE 30

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-31
SLIDE 31

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-32
SLIDE 32

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-33
SLIDE 33

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (ai + bi);

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-34
SLIDE 34

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (ai + bi);

  • 4. If |pi − pi−1| < ǫ or |f(pi)| < ǫ then 10;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-35
SLIDE 35

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (ai + bi);

  • 4. If |pi − pi−1| < ǫ or |f(pi)| < ǫ then 10;
  • 5. If f(pi)f(ai) > 0, then 6;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-36
SLIDE 36

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (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;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-37
SLIDE 37

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (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;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-38
SLIDE 38

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (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;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-39
SLIDE 39

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (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;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-40
SLIDE 40

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (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;

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-41
SLIDE 41

Context Bisection Method Example Theoretical Result

The Bisection Method to solve f(x) = 0

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

  • 1. a1 = a, b1 = b, p0 = a;
  • 2. i = 1;
  • 3. pi = 1

2 (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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 11 / 32

slide-42
SLIDE 42

Context Bisection Method Example Theoretical Result

The Bisection Method

Comment on Stopping Criteria for the Algorithm

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 12 / 32

slide-43
SLIDE 43

Context Bisection Method Example Theoretical Result

The Bisection Method

Comment on Stopping Criteria for the Algorithm

Other stopping procedures can be applied in Step 4.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 12 / 32

slide-44
SLIDE 44

Context Bisection Method Example Theoretical Result

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 and generate p1, . . . , pN until one of the following conditions is met: |pN − pN−1| < ǫ (1) |pN − pN−1| |pN| < ǫ, pN = 0,

  • r

(2) |f(pN)| < ǫ (3)

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 12 / 32

slide-45
SLIDE 45

Context Bisection Method Example Theoretical Result

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 and generate p1, . . . , pN until one of the following conditions is met: |pN − pN−1| < ǫ (1) |pN − pN−1| |pN| < ǫ, pN = 0,

  • r

(2) |f(pN)| < ǫ (3) Without additional knowledge about f or p, Inequality (2) is the best stopping criterion to apply because it comes closest to testing relative error.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 12 / 32

slide-46
SLIDE 46

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

2

Introducing the Bisection Method

3

Applying the Bisection Method

4

A Theoretical Result for the Bisection Method

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 13 / 32

slide-47
SLIDE 47

Context Bisection Method Example Theoretical Result

Solving f(x) = x3 + 4x2 − 10 = 0

Example: The Bisction Method

Show that f(x) = x3 + 4x2 − 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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 14 / 32

slide-48
SLIDE 48

Context Bisection Method Example Theoretical Result

Solving f(x) = x3 + 4x2 − 10 = 0

Example: The Bisction Method

Show that f(x) = x3 + 4x2 − 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.

Relative Error Test

Note that, for this example, the iteration will be terminated when a bound for the relative error is less than 10−4, implemented in the form: |pn − pn−1| |pn| < 10−4.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 14 / 32

slide-49
SLIDE 49

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution

Because f(1) = −5 and f(2) = 14 the Intermediate Value Theorem ensures that this continuous function has a root in [1, 2].

IVT Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 15 / 32

slide-50
SLIDE 50

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution

Because f(1) = −5 and f(2) = 14 the Intermediate Value Theorem ensures that this continuous function has a root in [1, 2].

IVT

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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 15 / 32

slide-51
SLIDE 51

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution

Because f(1) = −5 and f(2) = 14 the Intermediate Value Theorem ensures that this continuous function has a root in [1, 2].

IVT

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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 15 / 32

slide-52
SLIDE 52

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution

Because f(1) = −5 and f(2) = 14 the Intermediate Value Theorem ensures that this continuous function has a root in [1, 2].

IVT

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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 15 / 32

slide-53
SLIDE 53

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution

Because f(1) = −5 and f(2) = 14 the Intermediate Value Theorem ensures that this continuous function has a root in [1, 2].

IVT

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 shown in the following table.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 15 / 32

slide-54
SLIDE 54

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Iter an bn pn f (an) f (pn) RelErr 1 1.000000 2.000000 1.500000

  • 5.000

2.375 0.33333

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 16 / 32

slide-55
SLIDE 55

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Iter an bn pn f (an) f (pn) RelErr 1 1.000000 2.000000 1.500000

  • 5.000

2.375 0.33333 2 1.000000 1.500000 1.250000

  • 5.000
  • 1.797

0.20000

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 16 / 32

slide-56
SLIDE 56

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Iter an bn pn f (an) f (pn) RelErr 1 1.000000 2.000000 1.500000

  • 5.000

2.375 0.33333 2 1.000000 1.500000 1.250000

  • 5.000
  • 1.797

0.20000 3 1.250000 1.500000 1.375000

  • 1.797

0.162 0.09091

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 16 / 32

slide-57
SLIDE 57

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Iter an bn pn f (an) f (pn) RelErr 1 1.000000 2.000000 1.500000

  • 5.000

2.375 0.33333 2 1.000000 1.500000 1.250000

  • 5.000
  • 1.797

0.20000 3 1.250000 1.500000 1.375000

  • 1.797

0.162 0.09091 4 1.250000 1.375000 1.312500

  • 1.797
  • 0.848

0.04762 5 1.312500 1.375000 1.343750

  • 0.848
  • 0.351

0.02326 6 1.343750 1.375000 1.359375

  • 0.351
  • 0.096

0.01149 7 1.359375 1.375000 1.367188

  • 0.096

0.032 0.00571 8 1.359375 1.367188 1.363281

  • 0.096
  • 0.032

0.00287 9 1.363281 1.367188 1.365234

  • 0.032

0.000 0.00143 10 1.363281 1.365234 1.364258

  • 0.032
  • 0.016

0.00072 11 1.364258 1.365234 1.364746

  • 0.016
  • 0.008

0.00036 12 1.364746 1.365234 1.364990

  • 0.008
  • 0.004

0.00018 13 1.364990 1.365234 1.365112

  • 0.004
  • 0.002

0.00009

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 16 / 32

slide-58
SLIDE 58

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution (Cont’d)

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 17 / 32

slide-59
SLIDE 59

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution (Cont’d)

After 13 iterations, p13 = 1.365112305 approximates the root p with an error |p − p13| < |b14 − a14| = |1.3652344 − 1.3651123| = 0.0001221

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 17 / 32

slide-60
SLIDE 60

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution (Cont’d)

After 13 iterations, p13 = 1.365112305 approximates the root p with an error |p − p13| < |b14 − a14| = |1.3652344 − 1.3651123| = 0.0001221 Since |a14| < |p|, we have |p − p13| |p| < |b14 − a14| |a14| ≤ 9.0 × 10−5, so the approximation is correct to at least within 10−4.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 17 / 32

slide-61
SLIDE 61

Context Bisection Method Example Theoretical Result

Bisection Method applied to f(x) = x3 + 4x2 − 10

Solution (Cont’d)

After 13 iterations, p13 = 1.365112305 approximates the root p with an error |p − p13| < |b14 − a14| = |1.3652344 − 1.3651123| = 0.0001221 Since |a14| < |p|, we have |p − p13| |p| < |b14 − a14| |a14| ≤ 9.0 × 10−5, so the approximation is correct to at least within 10−4. The correct value of p to nine decimal places is p = 1.365230013

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 17 / 32

slide-62
SLIDE 62

Context Bisection Method Example Theoretical Result Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 18 / 32

slide-63
SLIDE 63

Context Bisection Method Example Theoretical Result

Outline

1

Context: The Root-Finding Problem

2

Introducing the Bisection Method

3

Applying the Bisection Method

4

A Theoretical Result for the Bisection Method

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 19 / 32

slide-64
SLIDE 64

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

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

|pn − p| ≤ b − a 2n , when n ≥ 1.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 20 / 32

slide-65
SLIDE 65

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Proof.

For each n ≥ 1, we have bn − an = 1 2n−1 (b − a) and p ∈ (an, bn).

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 21 / 32

slide-66
SLIDE 66

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Proof.

For each n ≥ 1, we have bn − an = 1 2n−1 (b − a) and p ∈ (an, bn). Since pn = 1

2(an + bn) for all n ≥ 1, it follows that

|pn − p| ≤ 1 2(bn − an) = b − a 2n .

  • Numerical Analysis (Chapter 2)

The Bisection Method R L Burden & J D Faires 21 / 32

slide-67
SLIDE 67

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Rate of Convergence

Because |pn − p| ≤ (b − a) 1 2n , the sequence {pn}∞

n=1 converges to p with rate of convergence O

1

2n

  • ;

that is, pn = p + O 1 2n

  • .

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 22 / 32

slide-68
SLIDE 68

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Conservative Error Bound

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 23 / 32

slide-69
SLIDE 69

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 23 / 32

slide-70
SLIDE 70

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

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 + 4x2 − 10 ensures only that |p − p9| ≤ 2 − 1 29 ≈ 2 × 10−3, but the actual error is much smaller: |p − p9| = |1.365230013 − 1.365234375| ≈ 4.4 × 10−6.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 23 / 32

slide-71
SLIDE 71

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Example: Using the Error Bound

Determine the number of iterations necessary to solve f(x) = x3 + 4x2 − 10 = 0 with accuracy 10−3 using a1 = 1 and b1 = 2.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 24 / 32

slide-72
SLIDE 72

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Example: Using the Error Bound

Determine the number of iterations necessary to solve f(x) = x3 + 4x2 − 10 = 0 with accuracy 10−3 using a1 = 1 and b1 = 2.

Solution

We we will use logarithms to find an integer N that satisfies |pN − p| ≤ 2−N(b − a) = 2−N < 10−3.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 24 / 32

slide-73
SLIDE 73

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Example: Using the Error Bound

Determine the number of iterations necessary to solve f(x) = x3 + 4x2 − 10 = 0 with accuracy 10−3 using a1 = 1 and b1 = 2.

Solution

We we will use logarithms to find an integer N that satisfies |pN − p| ≤ 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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 24 / 32

slide-74
SLIDE 74

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Solution (Cont’d)

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 25 / 32

slide-75
SLIDE 75

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Solution (Cont’d)

Since 2−N < 10−3 implies that log10 2−N < log10 10−3 = −3, we have −N log10 2 < −3 and N > 3 log10 2 ≈ 9.96.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 25 / 32

slide-76
SLIDE 76

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Solution (Cont’d)

Since 2−N < 10−3 implies that log10 2−N < log10 10−3 = −3, we have −N log10 2 < −3 and N > 3 log10 2 ≈ 9.96. Hence, ten iterations will ensure an approximation accurate to within 10−3.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 25 / 32

slide-77
SLIDE 77

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Solution (Cont’d)

Since 2−N < 10−3 implies that log10 2−N < log10 10−3 = −3, we have −N log10 2 < −3 and N > 3 log10 2 ≈ 9.96. 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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 25 / 32

slide-78
SLIDE 78

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Solution (Cont’d)

Since 2−N < 10−3 implies that log10 2−N < log10 10−3 = −3, we have −N log10 2 < −3 and N > 3 log10 2 ≈ 9.96. 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

  • nly a bound for the number of iterations.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 25 / 32

slide-79
SLIDE 79

Context Bisection Method Example Theoretical Result

Theoretical Result for the Bisection Method

Solution (Cont’d)

Since 2−N < 10−3 implies that log10 2−N < log10 10−3 = −3, we have −N log10 2 < −3 and N > 3 log10 2 ≈ 9.96. 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

  • nly a bound for the number of iterations.

In many cases, this bound is much larger than the actual number required.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 25 / 32

slide-80
SLIDE 80

Context Bisection Method Example Theoretical Result

The Bisection Method

Final Remarks

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 26 / 32

slide-81
SLIDE 81

Context Bisection Method Example Theoretical Result

The Bisection Method

Final Remarks

The Bisection Method has a number of significant drawbacks.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 26 / 32

slide-82
SLIDE 82

Context Bisection Method Example Theoretical Result

The Bisection Method

Final Remarks

The Bisection Method has a number of significant drawbacks. Firstly it is very slow to converge in that N may become quite large before p − pN becomes sufficiently small.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 26 / 32

slide-83
SLIDE 83

Context Bisection Method Example Theoretical Result

The Bisection Method

Final Remarks

The Bisection Method has a number of significant drawbacks. Firstly it is very slow to converge in that N may become quite large before p − pN becomes sufficiently small. Also it is possible that a good intermediate approximation may be inadvertently discarded.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 26 / 32

slide-84
SLIDE 84

Context Bisection Method Example Theoretical Result

The Bisection Method

Final Remarks

The Bisection Method has a number of significant drawbacks. Firstly it is very slow to converge in that N may become quite large before p − pN 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.

Numerical Analysis (Chapter 2) The Bisection Method R L Burden & J D Faires 26 / 32

slide-85
SLIDE 85

Questions?

slide-86
SLIDE 86

Reference Material

slide-87
SLIDE 87

Intermediate Value Theorem: Illustration (1/3)

Consider an arbitray function f(x) on [a, b]:

y x

y=f(x) a b f(a) f(b)

slide-88
SLIDE 88

Intermediate Value Theorem: Illustration (2/3)

We are given a number K such that K ∈ [f(a), f(b)].

y x

K y=f(x) a b f(a) f(b)

slide-89
SLIDE 89

Intermediate Value Theorem: Illustration (3/3)

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

y x

y=f(x) c K a b f(a) f(b)

Return to Bisection Method

slide-90
SLIDE 90

Intermediate Value Theorem

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

x y f(a) f(b) y 5 f (x) K (a, f(a)) (b, f(b)) a b c

(The diagram shows one of 3 possibilities for this function and interval.)

Return to Bisection Method Example