You are on page 1of 11

MODULE 2.

1 ERRORS
PREPARED BY:
ENGR. MARY ABEGAIL P. CADANG
ROUND-OFF AND TRUNCATION ERRORS

Two Major Forms of Numerical Errors:


o Round-off Error – due to computer approximations
o Truncation Error – due to mathematical approximations
 Note that errors associated with both calculations and measurements ca be characterized with regard to their accuracy and
precision.
ACCURACY and PRECISION
o Accuracy – refers to how closely a computed or measured value agrees with the true value
o Precision – refers to how closely individual computed or measured values agree with each other
o Inaccuracy – also called bias is defined as systematic deviation from the truth
o Imprecision – also called uncertainty refers to the magnitude of the scatter
EXAMPLE:

(A) INACCURATE AND IMPRECISE (B) ACCURATE AND IMPRECISE


(C) INACCURATE AND PRECISE (D) ACCURATE AND PRECISE
ERROR DEFINITIONS

o For such errors, the relationship between the exact, or true, result, and the approximation can be formulated as:
TRUE VALUE = APPROXIMATION + ERROR
- By rearranging, we find that the numerical error is equal to the discrepancy between the truth and the
approximation, as in
𝑬𝒕 = 𝒕𝒓𝒖𝒆 𝒗𝒂𝒍𝒖𝒆 − 𝒂𝒑𝒑𝒓𝒐𝒙𝒊𝒎𝒂𝒕𝒊𝒐𝒏
where 𝐸𝑡 is used to designate the exact value of the error, “t” is included to designate that this is the
“true” error
TRUE PERCENT RELATIVE ERROR

- One way to account for the magnitudes of the quantities being evaluated is to normalize the error to the true
value, as in
𝒕𝒓𝒖𝒆 𝒆𝒓𝒓𝒐𝒓 − 𝒂𝒑𝒑𝒓𝒐𝒙𝒊𝒎𝒂𝒕𝒊𝒐𝒏
𝑻𝒓𝒖𝒆 𝑭𝒓𝒂𝒄𝒕𝒊𝒐𝒏𝒂𝒍 𝑹𝒆𝒍𝒂𝒕𝒊𝒗𝒆 𝑬𝒓𝒓𝒐𝒓 =
𝒕𝒓𝒖𝒆 𝒗𝒂𝒍𝒖𝒆

The relative error can also be multiplied by 100% to express it as


𝒕𝒓𝒖𝒆 𝒗𝒂𝒍𝒖𝒆 − 𝒂𝒑𝒑𝒓𝒐𝒙𝒊𝒎𝒂𝒕𝒊𝒐𝒏
𝜺𝒕 = 𝟏𝟎𝟎%
𝒕𝒓𝒖𝒆 𝒗𝒂𝒍𝒖𝒆
Where 𝜀𝑡 designates the true percent relative error
APPROXIMATE RELATIVE ERROR

- For numerical methods, the true value will only be known when we deal with functions that can be solved
analytically. Such will typically be the case when we investigate the theoretical behavior of a particular technique
for simple systems. However in the real world applications, we will obviously not know the true answer “ a prior”.
For these situations, an alternative is to normalize the error using the best available estimate of the true value –
that is, to the approximation itself, as in
𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑒𝑟𝑟𝑜𝑟
𝜀𝑎 = 100%
𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛

where the subscript “a” signifies that the error is normalized to an approximate value.
- For such cases, the error is often estimated as the difference between the previous and present approximations.
Thus, percent relative error is determined according to
𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 − 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
𝜀𝑎 = 100%
𝑝𝑟𝑒𝑠𝑒𝑛𝑡 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
PRESCRIBED PERCENT TOLERANCE

Often, when performing computations, we may not be concerned with the sign of the error but are interested in
whether the percent absolute value is lower than the sign of the error but are interested in whether the absolute value
is lower than the prescribed percent tolerance “𝜀𝑠 ”.
𝜺𝒂 = 𝜺𝒔
This relationship is referred to as a “stopping criterion”. If it is satisfied, our result is assumed to be within the
prespecified acceptable level “𝜀𝑠 ”. Note that for the remainder of this text, we almost always employ absolute values
when using relative errors.
𝜺𝒔 = 𝟎. 𝟓 𝒙 𝟏𝟎𝟐−𝒏 %
where: n is the no. of significant figures
EXAMPLE:

 Problem Statements.
In mathematics, functions can often be represented by infinite series. For example, the exponential function can be
𝒙𝟐 𝒙𝟑 𝒙𝒏
computed using 𝒆𝒙 = 𝟏+𝒙+ + + …+
𝟐 𝟑! 𝒏!

Thus, as more terms are added in sequence, the approximation becomes better and better estimate of the true value of
𝑒 𝑥 . Equation 8 is called a Macclaurin Series expansion. Starting with the version, 𝑒 𝑥 = 1, add terms one at a time in
order to estimate 𝑒 0.5 . After each new term is added, compute the true and appropriate percent relative errors with
equation 3 and 5, respectively. Note that the true value is 𝑒 05 = 1.648721 … . .Add terms until the absolute value of the
approximate error estimate 𝜀𝑎 falls below a prespecified error criterion 𝜀𝑠 conforming to three significant figures
SOLUTION
First, equation 7 can be employed to determine the error criterion that ensures a result that is correct to at least three significant figures:
𝜀𝑠 = 0.5 𝑋 102−𝑥 %
𝜀𝑠 = 0.5 𝑋 102−3 %
𝜺𝒔 = 𝟎. 𝟎𝟓 %
Thus, we will add terms to the series until 𝜀𝑎 falls below this level.
This first estimate is simply equal to the given equation with a single term. Thus, the first estimate is equal to 1. The second estimate is then generated by
adding the second term as in
𝑒 𝑥 = 1 + 𝑥 or for x=0.5
𝑒 0.5 = 1 + 0.5 = 1.5
This represents a true percent relative error of equation 3
1.648721 − 1.5
𝜀𝑡 = 𝑋 100%
1.648721
𝜺𝒕 = 9.02%
Equation 5 can be used to determine an approximate estimate of the error, as in
1. 5 − 1
𝜀𝑎 = 𝑋 100%
1.5
𝜺𝒂 = 33.3%
TERMS RESULT (𝐞𝐱 =) 𝛆𝐭 % 𝛆𝐚 %
1 1 1 1 39.3
2 1+x 1+ 0.5 1.5 9.02 33.3
3 1+x+
𝑥2
1 + 0.5 +
0.52 1.625 1.44 7.69
2 2
4 1+x+
𝑥2
+
𝑥3
1 + 0.5 +
0.52
+
0.53 1.645833333 0.175 1.27
2 3! 2 3!
5 1+x+
𝑥2
+
𝑥3
+
𝑥4
1 + 0.5 +
0.52
+
0.53
+
0.54 1.648437500 0.00172 0.158
2 3! 4! 2 3! 4!
6 1+x+
𝑥2
+
𝑥3
+
𝑥4 𝑥5
+ 1+x+
𝑥2
+
0.53
+
0.54 0.55
+ 5! 1.648697917 0.00142 0.0158
2 3! 4! 5! 2 3! 4!

Thus, after six are included, the approximate error falls below 𝜀𝑠 = 0.05%,and the computation is terminated.
However, notice that, rather than three significant figures, the result is accurate to five! (5!) . This is because, for this
case, both equation 5 and equation 7 are conservative. That is, they ensure that the result is at least as good as they
specify. Although, this is not always the case for equation 5, it is true most of the time.
TAGLISH VERSION EXPLANATION
Ang true value ay nakukuha mula sa orihinal na formula nito na maaaring i-compute
through your calculators. Ngunit through numerical methods, pwede nating makuha
ang sagot nito sa pamamagitan ng pagobserba sa error na ibibigay ng ating manu manong
formula. Kung papansinin ang ating formula, and katumbas ng 𝑒 0.5 = 1.648721271, ito
ang true value natin.. Nayon kung, gagamitan natin siya ng numerical methods kagaya ng
paggamit ng Maclaurin Series Expansion, makikita natin na sa bawat term, pababa ng
pababa ang percent true error natin. Habang bumababa ang error na nakukuha, lalong
mas nagiging accurate ang ating sagot. Ngayon, para makita kung hanggang saang term ka,
idi-determine ito ni Approximate percentage kung saan kapag nagsimula ng mas mababa
ito kesa sa stopping criterion mo, ito na ang hudyat na dun na ang end term mo. At kung
ikukumpara mo na yung result, mapapansing halos tama na yung resulta at yung true
value. And that will be your final answer.

You might also like