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

MA 572 Numerical Analysis (August 4, 2021)

The document defines types of errors in numerical analysis, including the true solution (xT), approximate solution (xA), error (xT - xA), and relative error. It discusses significant digits and how errors propagate and are affected during arithmetic operations like multiplication, division, and addition/subtraction. For example, the relative error in multiplication is approximately equal to the sum of the relative errors when the individual relative errors are small. The document provides examples to illustrate definitions and error propagation concepts.

Uploaded by

Shreya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

MA 572 Numerical Analysis (August 4, 2021)

The document defines types of errors in numerical analysis, including the true solution (xT), approximate solution (xA), error (xT - xA), and relative error. It discusses significant digits and how errors propagate and are affected during arithmetic operations like multiplication, division, and addition/subtraction. For example, the relative error in multiplication is approximately equal to the sum of the relative errors when the individual relative errors are small. The document provides examples to illustrate definitions and error propagation concepts.

Uploaded by

Shreya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

MA 572 Numerical Analysis

Lecture 2
(August 4, 2021)

MA572 1 / 12
Errors: Definitions and Sources

While solving a problem, we seek an exact or true solution, denoted by xT . In solving the problem,
approximations are usually made which results in an approximate solution, denoted by xA .

The error in xA is denoted by

Error(xA ) = Error in xA = xT − xA .

The relative or percentage error in xA is defined by


xT − xA
Rel(xA ) = Relative Error in xA = ,
xT

provided xT 6= 0.

Example
19
xT = e = 2.7182818 . . . , xA = = 2.712857 . . . .
7
Error(xA ) = .003996 . . . , Rel(xA ) = .00147 . . .

MA572 2 / 12
Errors: Definitions and Sources

Alternative Concept
In place of relative error, very often the concept of significant digits is used. We say xA has m
significant (decimal) digits with respect to xT if the error xT − xA has magnitude less than or
equal to 5 in the (m + 1)-th digit of xT , counting to the right from the first non-zero digit in xT .

Formal Definition
(i) Let the true value have digits d1 d2 . . . dm dm+1 . . . dp .
(ii) Let the approximate value have digits d1 d2 . . . dm em+1 . . . ep ,
where d1 6= 0 and with the first difference in the digits occurring at the (m + 1)-th digit. Then we
say that (i) and (ii) agree to m significant digits if |dm+1 − em+1 | < 5.

Example
1 .
xT = , i .e., xT = .3333 and xA = .333, |xT − xA | = .00033
3
xA has three significant digits with respect to xT (The error is less than 5 in the fourth digit to
the right of the first non-zero digit in xT ).

MA572 3 / 12
Errors: Definitions and Sources

Example
xT = 23.496, and xA = 23.494, |xT − xA | = .002

xA has four significant digits with respect to xT (The error is less than 5 in the fifth digit to the
right of the first non-zero digit in xT ).

Example
xT = .03148, and xA = .03154, |xT − xA | = .00006

xA has two significant digits with respect to xT , not three (It is counted from the first non-zero
digit which is 3 in this case).

Alternative way to measure significant digits


If
xT − xA
≤ 5 × 10−m−1 , (1)
x
T
then xA has m significant digits with respect to xT .

MA572 4 / 12
Errors: Definitions and Sources

Consider the case 0.1 ≤ |xT | < 1. Then (1) implies

|xT − xA | ≤ 5 × 10−m−1 |xT | < 0.5 × 10−m .

Since 0.1 ≤ |xT | < 1, this implies that xA has m significant digits. In a similar manner, the same
may be established for a general xT . It can done by taking xT = x̂T .10e , with 0.1 ≤ |xT | < 1, e
an integer.

(1) is a sufficient condition, but not a necessary one, in order that xA has m significant digits.
Two examples above have one more significant digit than that indicated by (1).

MA572 5 / 12
Errors: Definitions and Sources

The following are main sources of error.


1 Mathematical modelling of a physical problem
2 Blunders
3 Uncertainty in physical data
4 Machine errors
5 Mathematical truncation error

One important aspect is how the error propagates and how the errors affect the computation. Let
ω denote one of the arithmetic operations +, −, ×, \. Let ω̂ denote the computer version of the
same operation which will usually include rounding.

Let xA and yA be the numbers used for calculations and suppose they are in error with true values
as follows:
xT = xA + , yT = yA + η.

MA572 6 / 12
Propagation of Errors

Then xA ω̂yA is the number actually computed and its error is given by

xT ωyT − xA ω̂yA = [xT ωyT − xA ωyA ] + [xA ωyA − xA ω̂yA ]. (2)

The first quantity in brackets on RHS is called the propagated error and the second quantity
usually represents the rounding or chopping error.

For the second quantity, we usually have

xA ω̂yA = fl(xA ωyA ), (3)

which means that xA ωyA is computed exactly and then rounded.

Recall
1 1
− β −t+1 ≤  ≤ β −t+1 . (4)
2 2

MA572 7 / 12
Propagation of Errors

Combining (4) and (3),


β
|xA ωyA − xA ω̂yA | ≤ |xA ωyA |β −t , (5)
2
provided true rounding is used.

Proof:
fl(x)−x
Recall x
= . In our case
fl(xA ωyA ) − xA ωyA
= .
xA ωyA

Therefore
Due to (3) and (4), we can write

xA ω̂yA ) − xA ωyA 1
≤ β −t+1
xA ωyA 2
β
⇒ |xA ωyA − xA ω̂yA )| ≤ |xA ωyA |β −t .
2

MA572 8 / 12
Propagation of Errors

Some particular cases are now considered to discuss propagated error. That is, we examine the
propagation of error for different operations.

Case I: Multiplication

Error(xA yA ) = xT yT − xA yA = xT yT − (xT − )(yT − η)


= xT η + yT  − η

xT yT − xA yA xT η + yT  − η
Rel(xA yA ) = =
xT yT xT yT
η   η
= + − ×
yT xT xT yT
= Rel(yA ) + Rel(xA ) − Rel(xA ) × Rel(yA )

MA572 9 / 12
Propagation of Errors

If |Rel(xA )| and |Rel(yA )| are very small, then

Rel(xA yA ) = Rel(xA ) + Rel(yA ).

Case II: Division

xT xT − 
Error(xA /yA ) = −
yT yT − η
−ηxT + yT
= .
yT (yT − η)

−ηxT +yT
yT (yT −η)
Rel(xA /yA ) =
xT /yT
−ηxT + yT
=
xT (yT − η)
−η + yT /xT
=
(yT − η)
−η/yT + /xT Rel(xA ) − Rel(yA )
= = .
1 − η/yT 1 − Rel(yA )
MA572 10 / 12
Propagation of Errors

Case III: addition and Subtraction:


For error in xA ± yA ,

(xT ± yT ) − (xA ± yA ) = (xt − xA ) ± (yT − yA ) =  ± η.

Therefore
Error(xA ± yA ) = Error(xA ) ± Error(yA ).

It can be seen that the error looks quite good and reasonable but the relative error in xA ± yA can
be quite poor when compared with Rel(xA ) and Rel(yA ) as can be observed from the following
example.

Example:
22
xT = π, xA = 3.1416, yT = , yA = 3.1429.
7
Although the error in xA − yA is very small (0.0013), the relative error in xA − yA is much larger
than that in xA or yA alone.

MA572 11 / 12
Propagation of Errors

Propagated error in functional evaluation


Errors creep in while evaluating a function. Let f (x) be a given function and let ˆ
f (x) denote the
result of evaluating f (x) on computer. Then f (xT ) denotes the desired function value and fˆ(xA )
is the value actually computed.

For the error, we write


f (xT ) − fˆ(xA ) = [f (xT ) − f (xA )] + [f (xA ) − ˆ
f (xA )]. (6)

The first quantity in brackets on RHS is the propagated error and the second quantity in brackets
is the error due to evaluating f (xA ) on a computer. The second error is usually a small random
number.

MA572 12 / 12

You might also like