EE, NCKU Tien-Hao Chang (Darby Chang) Numerical Analysis EE, NCKU Tien-Hao Chang (Darby Chang)
In the previous slide Error (motivation) Floating point number system difference to real number system problem of roundoff Introduced/propagated error Focus on numerical methods three bugs
About the exercise
In this slide Rootfinding Bisection method False position multiplicity Intermediate Value Theorem convergence measures False position yet another simple enclosure method advantage and disadvantage in comparison with bisection method
Given a function 𝑓, find a 𝑥 such that 𝑓 𝑥 =0 Rootfinding Given a function 𝑓, find a 𝑥 such that 𝑓 𝑥 =0
Is a rootfinding problem
Multiplicity
Definition
Multiplicity for polynomials For polynomials, multiplicity can be determined by factoring the polynomial That’s easy, but
For non-polynomials What about this 𝑓 𝑥 =0, where 𝑓 𝑥 =2𝑥+ ln 1−𝑥 1+𝑥 Clearly, 𝑓 0 =0, so the 𝑓(𝑥) has a root at 𝑥=0 But what is the multiplicity? 𝑓 0 = 𝑓 ′ 0 = 𝑓 ′′ 0 =0, but 𝑓 ′′′ 0 =−4 the equation has a root of multiplicity 3 at 𝑥=0 answer
For non-polynomials What about this 𝑓 𝑥 =0, where 𝑓 𝑥 =2𝑥+ ln 1−𝑥 1+𝑥 Clearly, 𝑓 0 =0, so the 𝑓(𝑥) has a root at 𝑥=0 But what is the multiplicity? 𝑓 0 = 𝑓 ′ 0 = 𝑓 ′′ 0 =0, but 𝑓 ′′′ 0 =−4 the equation has a root of multiplicity 3 at 𝑥=0
Rootfinding methods 2 categories Simple enclosure simple enclosure methods fixed point iteration schemes Simple enclosure bisection and false position guaranteed to converge to a root, but slow Fixed point iteration Newton’s method and secant method fast, but require stronger conditions to guarantee convergence
A pathological example
2.1 The Bisection Method
Bisection method The most basic simple enclosure method All simple enclosure methods are based on Intermediate Value Theorem
Drawing proof for Intermediate Value Theorem
In Plain English Find an interval of that the endpoints are opposite sign Since one endpoint value is positive and the other negative, zero is somewhere between the values, that is, at least one root on that interval
Bisection method The objective is to systematically shrink the size of that root enclosing interval The simplest and most natural way is to cut the interval in half Next is to determine which half contains a root Intermediate Value Theorem, again Repeat the process on that half
Bisection method
In action 𝑓 𝑥 = 𝑥 3 +2 𝑥 2 −3𝑥−1, and 𝑎 1 , 𝑏 1 =(1,2)
You know what the bisection method is, but so far it is not an algorithm, why?
An algorithm requires a stopping condition
Convergence of {pn}
Note The bisection method converges to a root of 𝑓, not the root of 𝑓 what’s the difference? 𝑓 𝑎 𝑓 𝑏 <0 guarantees the existence of a root, but not uniqueness, and the bisection method converge to one of these roots The bisection method cannot locate roots of even multiplicity (the sign does not change on either side of such roots) is common to all simple enclosure techniques
Rate of convergence, 𝑂( 1 2 𝑛 ) Order of convergence, 𝛼=1 and 𝜆= 1 2 http://www.dianadepasquale.com/ThinkingMonkey.jpg Rate of convergence, 𝑂( 1 2 𝑛 ) Order of convergence, 𝛼=1 and 𝜆= 1 2
We are now in position to select a stopping condition
Convergence measures For any rootfinding technique, we have 3 convergence measures to construct the stopping condition absolute error 𝑝 𝑛 −𝑝 <𝜀 relative error 𝑝 𝑛 −𝑝 𝑝 𝑛 <𝜀 test 𝑓(𝑝 𝑛 ) <𝜀
No one is always better than another Which is the Best? No one is always better than another answer
No one is always better than another Which is the Best? No one is always better than another
Algorithm Suppose that we decide to use the absolute error 𝑝 𝑛 −𝑝 <𝜀, but we don’t know the value of p With the theorem, we can now construct an algorithm
Note Performance measure Underflow number of 𝑓 evaluations rather than number of iterations (𝑓 could involve many floating point operations) Underflow both 𝑓(𝑎) and 𝑓(𝑝) will approaching zero work with the signs rather than the sign of the product 𝑓 𝑎 𝑓(𝑝)
Summary of bisection method Advantage straightforward inexpensive (1 evaluation per iteration) guarantee to converge Disadvantage error estimation can be overly pessimistic (drawing for a extreme case of bisection method)
2.1 The Bisection Method
The Method of False Position 2.2 The Method of False Position
False position Very similar to bisection method Only differ in selecting 𝑝 𝑛
Selecting 𝑝 𝑛 False position uses more information values of 𝑓 𝑎 𝑛 and 𝑓 𝑏 𝑛 rather than just the signs
Which method is better?
Which method is better From another aspect to only the convergence rate bisection method provides a theoretical bound of error, but no error estimate false position provides computable error estimate (the only one advantage of false position) Thus, we can have a more appropriate stopping condition for false position (we will use this advantage in Section 2.6)
Since false position has no theoretical bound of error, it requires effort to prove the convergence
Convergence analysis One observation to proceed the convergence analysis one of the endpoints remains fixed the other endpoint is just the previous approximation Namely an=an-1, bn=pn-1 or bn=bn-1, an=pn-1 observation
The first problem
The second problem
The third problem
Convergence analysis One observation to proceed the convergence analysis one of the endpoints remains fixed the other endpoint is just the previous approximation Namely 𝑎 𝑛 = 𝑎 𝑛−1 , 𝑏 𝑛 = 𝑝 𝑛−1 or 𝑏 𝑛 = 𝑏 𝑛−1 , 𝑎 𝑛 = 𝑝 𝑛−1
Go back to the equation (4) 𝑏 𝑛 −𝑝 = 𝑝 𝑛−1 −𝑝 = 𝑒 𝑛−1
Guarantee to convergence Now we know 𝑒 𝑛 ≈𝜆 𝑒 𝑛−1 One question that remains is whether 𝜆 is less than 1 answer
Guarantee to convergence Now we know 𝑒 𝑛 ≈𝜆 𝑒 𝑛−1 One question that remains is whether 𝜆 is less than 1
The first condition The remaining three conditions can be proved in a similar fashion
Now it’s time to select a stopping condition
Stopping condition Suppose the absolute error is used We have 𝑒 𝑛 ≈𝜆 𝑒 𝑛−1 We have to estimate 𝑒 𝑛
The first problem
The second problem
The third problem
2.2 The Method of False Position