Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Error_Analysis.pdf
1. Numerical Techniques for Engineers
(21UHSMA301)
Unit - 1: Error Analysis
Dr. Tushar J. Bhatt
Ph.D (Mathematics)
Assistant Professor in Mathematics
Department of Science and Humanities
Faculty of Engineering and Technology
Atmiya University
Rajkot - 360005
July 18, 2022
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 1 / 23
2. Table of Contents
1 Introduction
2 Approximate numbers and Significant figures
3 Rounding-off numbers
4 Types of errors: Absolute, Relative and Percentage
5 Error in Arithmetical operations
6 A General Error Formula
7 Errors in Numerical Computations
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 2 / 23
3. 1. Introduction
Definition: Roots / Zero’s
The values of x which satisfy the equation f(x) = 0 , are called the zero’s or
roots of the given equation.
If f(x) is quadratic, cubic or bi-quadratic expression, then algebraic formulae
are available for expressing the roots in terms of the coefficients.
But sometimes algebraic methods are not able to solve the equations then
Numerical Techniques are introduced for solving the same.
Some transcendental and algebraic equations are listed below which are not
solving by using usual methods:
1 + cosx − 5x = 0
e−x
− sinx = 0
xtanx − coshx = 0
x4
− x − 13 = 0
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 3 / 23
4. 2. Approximate numbers and Significant figures
Definition: Exact Numbers
There are the numbers in which no uncertainty and no approximations are called
exact numbers.
For example: 2. 4, 7, 9, 1/2 , 5/4 and etc...
Definition: Approximate Numbers
There are the numbers in which represent a certain degree of accuracy but not the
exact value.
Moreover, these numbers can not be represented in terms of finite number of
digits.
For example
1/3
1/13
π
√
2 and etc...
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 4 / 23
5. 2. Approximate numbers and Significant figures
Definition: Significant digits /figures
It refers to the number of digits in a given number excluding leading zeros.
For example
158, 1.58, 1.08, 0.00109 all are having three significant digits, excluding
leading zeros.
Definition: Chopping and Round off numbers
Next exact numbers can be approximated with a finite number of digits of
precision in two ways.
If n digits are used to represent a non - terminating mixed number then the
simplest scheme is to keep the first n digit and chop off all remaining digits.
For example
Let us consider a number 1.00248 which is chopping off and that can be
reduced only 1.
But the chopping off number is not give any accurate number. Then it needs
some modification, is nothing but round off number.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 5 / 23
6. 3. Rounding - off numbers
The modified version of chopping off is called round off process. This process is
divided into two categories:
1 Rounding down
If the number at (n + 1)th
place is less than 5, leave all the digits after nth
digit.
For example:
A number 12.423 has rounding down value is only 12 since the digits after
decimal point are less than 5.
2 Rounding up
If the number at (n + 1)th
place is greater than 5, add 1 to the digit at nth
place.
For example:
The rounding up value of the number 12.623 is 13.
Note: If the number (n + 1)th
place is exactly 5 then round off the digit at the
nth
place to the nearest even decimal.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 6 / 23
7. 3. Rounding - off numbers
For example
1 Round off 1.2535 to 3 decimal places is 1.254
2 Round off 1.2535 to 2 decimal places is 1.25
3 Round off 1.2535 to 1 decimal place is 1.2
4 Round off 1.25 to 1 decimal place is 1.2
5 Round off 3.45 to 1 decimal place is 3.4
6 Round off 3.55 to 1 decimal place is 3.6
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 7 / 23
8. 3. Rounding - off numbers
Example - I
Round - off the following numbers correct up to four decimal places:
(a)96.243827
(b)1.789654
(c)0.004789
(d)0.245082
Solution - I
(a) 96.2458
(b) 1.7896
(c) 0.0048
(d) 0.2451
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 8 / 23
9. 3. Rounding - off numbers
Example - II
Round - off the following numbers correct up to four significant figures:
(a)4.2056
(b)0.23062
(c)0.0044672
(d)2.03578
Solution - II
(a) 4.206
(b) 0.2306
(c) 0.004467
(d) 2.036
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 9 / 23
10. 4. Types of Error
In this section, we will study the different types of errors from the numerical
analysis point of view:
1. Absolute Error
The absolute error of a number is defined as the difference between the true and
the approximate value.
It is denoted by Ea.
i.e. Absolute Error Ea = True value − Approximate value
2. Relative Error
The relative error of a number is defined as absolute error divided by it’s true
value.
Relative Error is denoted by Er.
i.e. Relative Error Er = Absolute error
T rue value = Ea
T rue value
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 10 / 23
11. 4. Types of Error
3. Relative Percentage Error
The relative percentage error of a number is defined as the relative error multiplies
by 100 with the sign of %.
It is denoted by Ep. .
i.e. Relative Percentage Error = ( Er × 100)%.
Remarks
Let X be the true value of number and X̄ be the approximate value obtained by
computation then,
The absolute error Ea = |X − X̄| .
The relative error Er = Ea
X = |X−X̄
X |.
The relative percentage error Ep = (Er × 100)% = (|X−X̄
X | × 100)%
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 11 / 23
12. 4. Types of Error (Examples)
Example - I
Find the error and relative error in the following three cases :
(a) X = 3.141592, X̄ = 3.14
(b) Y = 1000000, Ȳ = 999996
(c) Z = 0.000012, Z̄ = 0.000009.
Solution - I (a)
The absolute error Ea = |X − X̄| = |3.141592 − 3.14| = 0.001592.
The relative error Er = Ea
X = 0.001592
3.141592 = 0.000507
Solution - I (b)
The absolute error Ea = |Y − Ȳ | = |1000000 − 999996| = 4.
The relative error Er = Ea
Y = 4
1000000 = 0.000004
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 12 / 23
13. 4. Types of Error (Examples)
Solution - I (C)
The absolute error Ea = |Z − Z̄| = |0.000012 − 0.000009| = 0.000003.
The relative error Er = Ea
Z = 0.000003
0.000012 = 0.25.
Example - II
Find the relative error in the computation of X − Y for X = 12.05 and Y = 8.02
having absolute errors δX = 0.005 and δY = 0.001.
Solution - II
Here X = 12.05 and δX = 0.005
Y = 8.02 and δY = 0.001.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 13 / 23
14. 4. Types of Error (Examples)
Solution - II
We want to find relative error in X − Y .
So, first we find relative error in X and Y .
Now Relative error in X = Er(X)
X = 0.005
12.05 = 0.000415.
Relative error in Y = Er(Y )
Y = 0.001
8.02 = 0.000125.
Therefore relative error in
X − Y = Er(X) − Er(Y ) = 0.000415 − 0.000125 = 0.00029.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 14 / 23
15. 5. Error in Arithmetic Operations
There are some basic errors which are occurred in the calculations as listed below:
(a) Inherent Error
These are the errors which are already present in the statement of a problem
before its solution.
Such errors arise due to uncertainty in measurement or approximation of the given
data or limitations of mathematical measurements and etc....
Inherent errors can be minimized by taking high precision data.
For example:
number 9.8204 precision is 10−4
.
In number 9.82 precision is 10−2
.
In number 9.820405 precision is 10−6
.
Hence the number 9.820405 has the greatest precision.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 15 / 23
16. 5. Error in Arithmetic Operations
(b) Truncation Error
These are caused by using approximate results or on replacing an infinite process
by a finite one.
If we are using a decimal computer having a fixed word length 4 digits; rounding
off 80.758 gives 80.76 whereas truncation gives 80.75.
If S = Σ∞
i=1aixi is replaced by or truncation to S = Σn
i=1aixi then the error
developed is called truncation error.
If ex
= 1 + x
1! + x2
2! + ... + xn
n! + ... + ∞ = X(say) is truncate to
ex
= 1 + x
1! + x2
2! + x3
3! = X
′
(say) then truncation error X − X
′
.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 16 / 23
17. 5. Error in Arithmetic Operations
(c) Rounding error
These arise from the process of rounding off the numbers during the computation.
The rounding errors are also called procedure errors or numerical errors.
Example - I
Find the absolute error if the number X = 0.00545828 is
(i) Truncated to three decimal digits
(ii) Rounded off to three decimal digits.
Solution - I
Here given that X = 0.00545828 = 0.545825 × 10−2
.
(i) After truncating to three decimal places, its approximate value
X
′
= 0.545 × 10−2
.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 17 / 23
18. 5. Error in Arithmetic Operations
Solution - I
∴ Absolute Error Ea = |X − X
′
| = |0.545828 × 10−2
− 0.545 × 10−2
|.
= 0.000828 × 10−2
= 0.828 × 10−5
(ii) After rounding off to three decimal places, its approximate value
X
′
= 0.546 × 10−2
∴ Absolute Error Ea = |X − X
′
| = |0.545828 × 10−2
− 0.546 × 10−2
|
= 0.000172 × 10−2
= 0.172 × 10−5
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 18 / 23
19. 6. General Error Formula
General Error Formula
Consider y = f(x1, x2) , a function in two variables x1 and x2.
Let δx1, δx2 are the errors in x1 and x2.
Now the error in y is denoted by δy , defines as
δy = ∂y
∂x1
× δx1 + ∂y
∂x2
× δx2.
In general the error δy in the function y = f(x1, x2, ..., xn) corresponding to
the errors δxi, i = 1, 2, ..., n is given by
δy = ∂y
∂x1
× δx1 + ∂y
∂x2
× δx2 + ... + ∂y
∂xn
× δxn.
this error is also called absolute error in y .
And relative error in y is given by
Er = δy
y = ( ∂y
∂x1
× δx1
y ) + ( ∂y
∂x2
× δx2
y ) + ... + ( ∂y
∂xn
× δxn
y )
If errors are negative then takes modulus values of errors.
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 19 / 23
20. 7. Errors in Numerical Computations
Example - I
If N = 4x2
y3
z4 and δx = δy = δz = 0.001, compute maximum relative error in N
when x = 1, y = 2, z = 3 .
Solution - I
Here N = 4x2
y3
z4
Now at the point (1, 2, 3) the value of N(1,2,3) = 4(1)2
(2)3
(3)4 = 32
81 ——(1) Now
∂N
∂x = 8xy3
z4 , ∂N
∂y = 12x2
y2
z4 , ∂N
∂z = −16x2
y3
z5
Now Error in N = δN = ∂N
∂x × δx + ∂N
∂y × δy + ∂N
∂z × δz
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 20 / 23
21. 7. Errors in Numerical Computations
Solution - I
⇒ δN = (8xy3
z4 × δx) + (12x2
y2
z4 × δy) + (−16x2
y3
z5 × δz)
Since the errors δx, δy, δz may be positive or negative, we take the absolute values
of errors,
⇒ δN = |(8xy3
z4 × δx)| + |(12x2
y2
z4 × δy)| + |(−16x2
y3
z5 × δz)|
⇒ |δN|(1,2,3) = |(8xy3
z4 × δx)|(1,2,3) + |(12x2
y2
z4 × δy)|(1,2,3) + |(−16x2
y3
z5 × δz)|(1,2,3)
. ⇒ |δN|(1,2,3) = 8(1)(2)3
(3)4 ×(0.0001)+ 12(1)2
(2)2
(3)4 ×(0.0001)+ 16(1)2
(2)3
(3)5 ×(0.0001)
⇒ |δN|(1,2,3) = 0.00079 + 0.00059 + 0.00053 = 0.00191
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 21 / 23
22. 7. Errors in Numerical Computations
Solution - I
Hence the maximum relative error
= (δN)max
N = 0.00191
32/81 = 0.00191 × 81
32 = 0.0048
(Dr. Tushar J. Bhatt) Error Analysis July 18, 2022 22 / 23