Professional Documents
Culture Documents
S - 1.3 E A Big "O" Truncation Error: O (H) Order of Approximation
S - 1.3 E A Big "O" Truncation Error: O (H) Order of Approximation
3 E RROR A NALYSIS 29
Definition 1.9. The function f (h) is said to be big Oh of g(h), denoted f (h) =
O(g(h)), if there exist constants C and c such that
Example 1.20. Consider the functions f (x) = x 2 + 1 and g(x) = x 3 . Since x 2 ≤ x 3 and
1 ≤ x 3 for x ≥ 1, it follows that x 2 + 1 ≤ 2x 3 for x ≥ 1. Therefore, f (x) = O(g(x)).
30 C HAP. 1 P RELIMINARIES
The big Oh notation provides a useful way of describing the rate of growth of a
function in terms of well-known elementary functions (x n , x 1/n , a x , loga x, etc.).
The rate of convergence of sequences can be described in a similar manner.
n2 − 1 1 n2 − 1 n2 1
Example 1.21. 3
= O , since 3
≤ 3
= whenever n ≥ 1.
n n n n n
Often a function f (h) is approximated by a function p(h) and the error bound is
known to be M|h n |. This leads to the following definition.
Definition 1.11. Assume that f (h) is approximated by the function p(h) and that
there exist a real constant M > 0 and a positive integer n so that
| f (h) − p(h)|
(9) ≤M for sufficiently small h.
|h n |
We say that p(h) approximates f (h) with order of approximation O(h n ) and write
When relation (9) is rewritten in the form | f (h) − p(h)| ≤ M|h n |, we see that the
notation O(h n ) stands in place of the error bound M|h n |. The following results show
how to apply the definition to simple combinations of two functions.
Theorem 1.15. Assume that f (h) = p(h) + O(h n ), g(h) = q(h) + O(h m ), and
r = min{m, n}. Then
and
f (h) p(h)
(13) = + O(h r ) provided that g(h) = 0 and q(h) = 0.
g(h) q(h)
to zero with the same rapidity that h n+1 converges to zero as h approaches zero, as
expressed in the relationship
for sufficiently small h. Hence the notation O(h n+1 ) stands in place of the quantity
Mh n+1 , where M is a constant or “behaves like a constant.”
Theorem 1.16 (Taylor’s Theorem). Assume that f ∈ C n+1 [a, b]. If both x0 and
x = x0 + h lie in [a, b], then
n
f (k) (x0 ) k
(15) f (x0 + h) = h + O(h n+1 ).
k!
k=0
The following example illustrates the theorems above. The computations use the
addition properties (i) O(h p ) + O(h p ) = O(h p ), (ii) O(h p ) + O(h q ) = O(h r ),
where r = min{ p, q}, and the multiplicative property (iii) O(h p )O(h q ) = O(h s ),
where s = p + q.
h2 h3 h2 h4
eh = 1 + h + + + O(h 4 ) and cos(h) = 1 − + + O(h 6 ).
2! 3! 2! 4!
h2 h3 h2 h4
eh + cos(h) = 1 + h ++ + O(h 4 ) + 1 − + + O(h 6 )
2! 3! 2! 4!
h3 h4
=2+h+ + O(h 4 ) + + O(h 6 ).
3! 4!
h4
Since O(h 4 ) + = O(h 4 ) and O(h 4 ) + O(h 6 ) = O(h 4 ), this reduces to
4!
h3
eh + cos(h) = 2 + h + + O(h 4 ),
3!
Definition 1.12. Suppose that limn→∞ xn = x and {rn }∞ n=1 is a sequence with
limn→∞ rn = 0. We say that {xn }∞ n=1 converges to x with the order of conver-
gence O(rn ), if there exists a constant K > 0 such that
|xn − x|
≤K for n sufficiently large.
|rn |
This is indicated by writing xn = x + O(rn ), or xn → x with order of conver-
gence O(rn ).
Example 1.23. Let xn = cos(n)/n 2 and rn = 1/n 2 ; then limn→∞ xn = 0 with a rate of
convergence O(1/n 2 ). This follows immediately from the relation
| cos(n)/n 2 |
= | cos(n)| ≤ 1 for all n.
|1/n 2 |
Numerical Methods Using Matlab, 4th Edition, 2004
John H. Mathews and Kurtis K. Fink
ISBN: 0-13-065248-2
Prentice-Hall Inc.
Upper Saddle River, New Jersey, USA
http://vig.prenhall.com/