0% found this document useful (0 votes)
141 views

Note 1 - Approximations and Errors

1. This document discusses numerical approximations and errors in calculations. Round-off error occurs due to representing real numbers on computers in floating-point form. Truncation error results from using approximations instead of exact mathematical procedures. 2. Taylor's theorem is introduced as a way to approximate functions using Taylor polynomials plus a remainder term. The order of convergence describes how quickly a sequence converges to a limit. 3. Numerical algorithms are defined and stability is discussed. Stable algorithms produce results where small changes in input lead to small changes in output, while unstable algorithms do not.

Uploaded by

Primali Perera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views

Note 1 - Approximations and Errors

1. This document discusses numerical approximations and errors in calculations. Round-off error occurs due to representing real numbers on computers in floating-point form. Truncation error results from using approximations instead of exact mathematical procedures. 2. Taylor's theorem is introduced as a way to approximate functions using Taylor polynomials plus a remainder term. The order of convergence describes how quickly a sequence converges to a limit. 3. Numerical algorithms are defined and stability is discussed. Stable algorithms produce results where small changes in input lead to small changes in output, while unstable algorithms do not.

Uploaded by

Primali Perera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

In20 S2 MA1024

1 Approximations and Errors


1.1 Round-Off Errors
• The error that is produced when a calculator or computer is used to perform real number
calculations is called round-off error.
• Real numbers are typically represented in computers using floating-point form.

1.2 Machine Numbers


• Machine numbers are represented in the normalized decimal floating-point form
± 0.d1 d2 . . . dk × 10n , 1 ≤ d1 ≤ 9, and 0 ≤ di ≤ 9, (1.1)
for each i = 2, . . . , k. Numbers of this form are called k-digit decimal machine num-
bers.
• Any positive real number can be normalized to the form
y = 0.d1 d2 . . . dk dk+1 dk+2 · · · × 10n (1.2)

• The floating-point form of y, denoted f l(y), is obtained by terminating the mantissa of y


at k decimal digits. There are two common ways of performing this termination.
– chopping: chop off the digits dk+1 dk+2 . . . to produce the floating-point form
f l(y) = 0.d1 d2 . . . dk × 10n (1.3)
– rounding: when dk+1 ≥ 5, add 1 to dk to obtain f l(y); when dk+1 < 5, chop off all
but the first k digits. Here the floating-point has the form
f l(y) = 0.δ1 δ2 . . . δk × 10n (1.4)

1.3 Measuring Errors


• Suppose that p∗ is an approximation to p. The absolute error is |p − p ∗ |, and the
p − p∗
relative error is , provided that p 6= 0.
p

1.4 Finite-Digit Arithmetic


• The arithmetic performed in a computer is not exact.
• Assume that the floating-point representations f l(x) and f l(y) are given for the real
numbers x and y and that the symbols ⊕, , ⊗, represent machine addition, subtraction,
multiplication, and division operations, respectively.
x⊕y = f l(f l(x) + f l(y)) (1.5)
x y = f l(f l(x) − f l(y)) (1.6)
x⊗y = f l(f l(x) × f l(y)) (1.7)
x y = f l(f l(x)/f l(y)) (1.8)

• Accuracy loss due to round-off error can also be reduced by rearranging calculations.

example 1.1 ex − e−x


Let f (x) = . Use four-digit rounding arithmetic to evaluate f (0.1).
x

1 UoM
In20 S2 MA1024

1.5 Truncation Error and the Taylor Series


• Truncation errors are the errors that result from using approximation in place of an exact
mathematcal procedure.

• The mathematical formulation that is used extensively in numerical methods to approx-


imate functions is the Taylor series.

Theorem 1.1 – Taylor’s Theorem. Suppose f ∈ C n [a, b], that f (n+1) exists on [a, b], and
x0 ∈ [a, b]. For every x ∈ [a, b], there exists a number ξ(x) between x0 and x with

f (x) = Pn (x) + Rn (x), (1.9)

where
f 00 (x0 ) f (n)
Pn (x) = f (x0 ) + f 0 (x0 )(x − x0 ) + (x − x0 )2 + · · · + (x0 )(x − x0 )n
2! n!
n
f (k) (x0 )
(x − x0 )k
X
= (1.10)
k=0 k!

and
f (n+1) (ξ(x))
Rn (x) = (x − x0 )n+1 (1.11)
(n + 1)!
Here Pn (x) is called the nth Taylor polynomial for f about x0 , and Rn (x) is called the
remainder term (or truncation error) associated with Pn (x).

example 1.2 (i) Find the nth Taylor polynomial of the function f (x) = ex about x0 =
0.

(ii) Approximate e0.5 within the accuracy 10−3 .

1.6 Algorithm and Convergence


• An algorithm is a set of well-defined instructions to solve a particular problem.

• If a small changes in the initial data produce correspondingly small changes in the final
results then the algorithm is stable; otherwise it is unstable.

• Some algorithms are stable only for certain choices of initial data, and are called condi-
tionally stable.

Definition 1.1. Suppose that E0 > 0 denotes an error introduced at some stage in the calcu-
lations and En represents the magnitude of the error after n subsequent operations.

• If En ≈ CnE0 , where C is a constant independent of n, then the growth of error is said


to be linear.

• If En ≈ C n E0 , for some C > 1, then the growth of error is called exponential.

2 UoM
In20 S2 MA1024

Figure 1.1

Definition 1.2 – Rate of Convergence. Suppose {βn }∞ n=1 is a sequence known to converge to

zero, and {αn }n=1 converges to a number α. If a positive constant K exists with

|αn − α| ≤ K|βn |, for large n,

then we say that {αn }∞ n=1 converges to α with rate, or order, of convergence O(βn ). (This
expression is read ”big oh of βn ”.) It is indicated by writing αn = α + O(βn ).

0
REFERENCES
(i) Numerical Analysis, Richard L. Burden, J.Douglas Faires.
(ii) Numerical Methods for Scientific and Engineering Computation, M.K. Kain, S.R.K. Iyenger, R.K. Jain

3 UoM

You might also like