1.2 Absolute and relative errors.

advertisement
1.2 Absolute and relative errors.
In mathematics, science, and engineering we calculate various numbers, such as the current in an electric circuit,
or the viscosity of the transmission fluid in a car, or the price of Ford Motor Company stock a year from now, or
sin(1.5). For various reasons we may not be able to obtain the exact value and we must be content with an
approximation to the true value. Some of these reasons are the following.
Errors in mathematical approximations.
Imperfect physical measurements.
Propagation of errors in exact computations.
Round-off errors and propagation of errors in floating point computations.
An imperfect mathematical model of a physical system.
To a large extent, numerical analysis is concerned with methods for obtaining approximate values and for
accessing the error in these approximations. In this section we look at two ways of specifying errors: by means
of the absolute error or by means of the relative error. Propagation of errors in exact computations is discussed
in sections 1.3 and 1.4, while sections 1.5 and 1.6 are devoted to round-off errors and propagation of errors in
floating point computations. Section 1.7 considers two other ways of specifying errors, section 1.8 looks at
binary floating point numbers and the use of mathematical software in error calculations is the subject of section
1.9.
Absolute and relative errors. The error is the difference between the true value, x, and approximate value, xa.
(1)
e =  x = x - xa
Other notations for the error are common. For example, in formula (3) in section 1.1 the remainder R is the
error in the Taylor series approximation. The absolute error,  , is the magnitude of the error
(2)
 = | x - xa |.
The relative error,  , is the absolute error divided by the magnitude of the value. Sometimes people divide by
the magnitude of the true value.
(3)
 = t =
| x -xx |
a
=
| xx
a
-1
|
Other times people divide by the magnitude of the approximate value.
(4)
 = a =
| x x- x |
a
a
=
| xx
a
-1
|
As indicated above, if we are in a situation where we are dealing with both relative errors we shall distinguish
them by writing  t and a. As we go along we shall try to make it clear which relative error we are using in
various situations where it arises below.
There is a symmetry between the two relative errors. Let us define
 (u, v) =
| u v- v |
=
| uv - 1 |
Then  t =  (xa, x) and a =  (x, xa). Because of the symmetry, certain things that hold for one type of
relative error also hold for other.
If we are in a situation where we are working with several variables then we shall either use subscripts or some
other means to indicate what variable the error is for, e.g.  x =  (x) = | x - xa |.
Example 1. Suppose we measure the length of a table to be xa = 59.7 in, but the true length is x = 59.5 in. Then
the error, absolute error and two relative errors are
e = x – xa = 59.5 – 59.7 = - 0.2 in
1.2 - 1
 = | x – xa | = | - 0.2 | = 0.2 in.
x - xa
0.2
t =  x  = 59.5 = 0.003361…. = 0.3361..%


x - xa
0.2
a =  x  = 59.7 = 0.003350…. = 0.3350..%
 a 
It is common to express the relative error as a percent and we shall generally do so. Also, it is common to round
absolute and relative errors up so they have only one significant digit. In this example, the relative error is no
greater than 0.4%. In fact errors are often simply rounded (not necessarily up) to one digit. In this case many
~ 0.3%. In general
people would say the relative error is about 0.3%. We shall express this symbolically by  <
~y
x<
(5)
is short for
x  z where z  y
While this is not very precise, it is useful.
In Example 1 the two relative errors t and a are quite close. In general, if one of the relative errors is small
then the two are approximately equal. The following proposition makes this precise.
Proposition 1 If x  0 and  t < 1, then xa  0 and
a
1+a
 t 
a
1-a
t
t
 a 
. If xa  0 and a < 1, then x  0 and
1+t
1-t
.
Proof. We prove the first part; the proof of the second follows from the symmetry of the two relative errors.
Suppose x  0 and  t < 1. Since  t = | xa/x - 1 |, one has 0 < 1 -  t  xa/x  1 +  t. Hence xa  0 and
1/(1 +  t)  x/xa  1/(1 -  t). Since a =  t | x/xa | one has  t/(1 +  t)  a   t/(1 -  t). //
Example 2. Suppose the length of a table is x = 59.7  0.3 in. So a  0.3/59.7 = 0.005025.. By Proposition 1
one has t  0.005025../(1 – 0.005025) = 0.005050..
Note that  t is not defined if x = 0. The relative error is usually not the best way of working with the error if x
could be 0. This restricts us to situations where the relative error is less than 1. Despite these restrictions, the
relative error is often more informative to work with than the absolute error since it is independent of the units in
which the quantity is measured. For example, if we are talking about the error in the measurement of the length
of a side of a rectangle, then the relative error is the same no matter whether we measure in feet, inches, or
miles.
Some people tend to use the term accuracy when speaking of absolute errors and the term precision when
speaking of relative errors. For example, a series of temperature measurements might all be made so that the
absolute error was no more than 0.1 F. In this case we would say they all had the same degree of accuracy. On
the other hand if the measurements were made so that the relative error was no more than 2%, then we would
say they all had the same degree of precision.
Problems.
1.
Suppose the measured value of the temperature is Ta = 146.2, but the true temperature is T = 145.9. What
are the error, the absolute error, and the two relative errors  t and  a?
2.
The length of a rectangular piece of land is measured to be 145 ft  4 in. What is the relative error a in this
measured value?
3.
The width of a rectangular piece of land is measured to be 48.25 ft. If the measurement has a relative error
t of at most 2%, then what is an upper bound for the absolute error?
4.
Suppose the ambient temperature is A = 76.2  0.4 F. In what interval does the true temperature lie?
Answers. 1. The error is T = T – Ta = 145.9 – 146.2 = - 0.3. The absolute error is  = | T - Ta | = | - 0.3 |
T - Ta
0.3
= 0.3. The relative error  t is  t =
=
= 0.002056… which is about than 0.2%. The relative
T
145.9
|
|
1.2 - 2
error  a is  a =
0.3
| T T- T | = 146.2
= 0.002051… which is very close to 
a
a
t
(and also about 0.2%). 2.
0.2298..%. 3. We are given t  0.02. From Proposition 1 it follows that a  0.02/(1 - 0.02) = 0.020408...
Therefore the absolute error is no more than (0.020408..)(48.25) = 0.9846… . 4. The true ambient temperature
is between 75.8 and 76.6.
1.2 - 3
Download