0% found this document useful (0 votes)
25 views15 pages

Lec-3 (Errors)

Uploaded by

zakia.syeed51
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)
25 views15 pages

Lec-3 (Errors)

Uploaded by

zakia.syeed51
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/ 15

Numerical Methods

Lecture 03
5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 1
Numerical Methods
❑ Significant Digits
– All computers operate with a fixed length of numbers.
– The concept of significant digits has been introduced primarily to indicate the
accuracy of a numerical value.
– Basic concept of significant digits:
All non-zero digits are significant.
All zeros occurring between non-zero digits are significant digits.
Trailing zeros following a decimal point are significant.
For example, 3.50, 65.0 and 0.230 have three significant digits each.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 2


Numerical Methods
❑ Significant Digits
– Zeros between the decimal point and preceding a non-zero digit are not
significant.
For example, the following numbers have four significant digits.
0.0001234 (1234 x 10-7 )
0.001234 (1234 x 10-6 )
0.1234 (1234 x 10-5)
– When the decimal point is not written, trailing zeros are not considered to be
significant.
For example, 4500 may be written as 45x102 and contains only two significant
digits. However, 4500.0 contain five significant digits. Further examples are:
7.56 x 104 has three significant digits.
7.560 x 104 has four significant digits.
7.5600 x 104 has five significant digits.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 3


Numerical Methods
❑ Accuracy and Precision
The concept of accuracy and precision are closely related to significant digits.
They are related as follows:
– Accuracy refers to the number of significant digits in a value. For example, the
number 57.396 is accurate to five significant digits (sd).
– Precision refers to the number of decimal positions, i.e. the order of magnitude
of the last digit in a value. For example, the number 57.396 has a precision of
0.001 or 10-3.

Example 4.1: Which of the following numbers has the greatest precision?
(a) 4.3201 (b) 4.32 (c) 4.320106
Answer: (a) 4.3201 has a precision of 10-4.
(b) 4.32 has a precision of 10-2.
(c) 4.320106 has a precision of 10-6.
The last number has the greatest precision.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 4


Numerical Methods
❑ Accuracy and Precision
Example 4.2: What is the accuracy of the following numbers?
(a) 95.763 (b) 0.008472 (c) 0.0456000 (d) 36 (e) 3600 (f) 3600.00

Answer: (a) This has five significant digits (sd).


(b) This has four sd. The leading or higher order zeros are only place
holders.
(c) This has six sd.
(d) This has two sd.
(e) This has two sd.
(f) This has six sd. The zeros were made significant by writing .00 after
3600.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 5


Numerical Methods
❑ Approximations and Errors in Computing
– Approximations and errors are an integral part of human life. They are
everywhere and unavoidable.
– Errors come in a variety of forms and sizes in numerical methods. Some are
avoidable, some are not. For example, data conversion and round-off errors
cannot be avoided, but a human error can be eliminated. So it is necessary to
know how errors arise and how they grow during the numerical process and
how they affect the accuracy of the solution.
– A number of different types of errors arise during the process of numerical
computing. All these errors contribute to the total error in the final result.
Taxonomy of errors encountered in a numerical process is given below.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 6


Numerical Methods
❑ Approximations and Errors in Computing

Total error

Modelling Inherent Numerical Blunders


errors errors errors

Missing Data Conversion Round-off T runcation Human


information errors errors errors errors imperfection

Measuring
Computing Numerical
method
machine method

Fig.: Taxonomy of errors

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 7


Numerical Methods
❑ Inherent Errors
– Inherent errors are those that are present data supplied to the model.
– Inherent errors (also known as input errors) contain two components, namely, data
errors and conversion errors.
Data Errors:
– Data errors (also known as empirical errors) arises when data for a problem are
obtained by some experimental means and are therefore, of limited accuracy and
precision.
– This may be due to some limitations in instrumentation and reading, and therefore may
be unavaidable.
Conversion Errors:
– Conversion errors (also known as representation errors) arise due to the limitations of
the computer to store the data exactly.
– We know that the floating point representation retains only a specified number of digits.
The digits that are not retained constitute the round-off error.
– Many numbers cannot be represented exactly in a given number of decimal digits. For
example, the decimal number 0.01 has a non-terminating binary form like
0.00011001100110011. . . . . but the computer retains only a specified number of bits.
5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 8
Numerical Methods
❑ Numerical Errors
Numerical errors (also known as procedural errors) are introduced during the process of
implementation of a numerical method.
They come in two forms:
i) Round-off errors and ii) Truncation errors.
The total numerical error is the summation of these two errors.
Numerical errors can be reduced by devising suitable techniques for implementing the
solution.

Round-off Errors:
Round-off errors occur when a fixed number of digits are used to represent exact numbers.
Since the numbers are stored at every stage of computations, round-off error is introduced at
the end of the every arithmetic operation. Consequently, even though an individual round-off
error could be very small, the cumulative effect of a series of computations can be very
significant.
Rounding a number can be done in two ways:
A) Chopping and B) Symmetric rounding.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 9


Numerical Methods
❑ Numerical Errors
Chopping:
– In chopping, the extra digits are dropped. This is called truncating the number.
– Suppose we are using a computer with a fixed word length of four digits. Then a number
42.7893 will be stored as 42.78 and the digits 93 will be dropped.

Symmetric Round-off:
– In the symmetric roun-off method, the last retained significant digit is “rounded up” by 1
if the first discarded digit is larger or equal to 5; otherwise, the last retained digit is
unchanged.
– For example, the number 42.7893 would become 42.79 and the number 76.5432 would
become 76.54.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 10


Numerical Methods
❑ Truncation errors
– Truncation errors arise from using an approximation in place of an exact
mathematical procedure.
– Typically, it is the error resulting from the truncation of the numerical process.
We often use some finite number of terms to estimate the sum of an infinite
series. For example,
x3 x5 x7
sin x = x − + − + ............
3! 5! 7!
– We terminate the process after a certain term is calculated. The terms truncated
introduce an error which is called truncation error.
– Truncation error can be reduced by using a better numerical model which
usually increases the number of arithmetic operations.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 11


Numerical Methods
❑ Modeling Errors
– Mathematical models are the basis for numerical solutions.
– They are formulated to represent physical processes using certain parameters
involved in the situations. In many situations, it is impractical or impossible to
include all of the real problems and therefore, certain simplifying assumptions
are made.
– For example, while developing a model for calculating the force acting on a
falling body, we may not be able to estimate the air resistance coefficient
properly or determine the direction and magnitude of wind force acting on the
body and so on.
– To simplify the model, we may assume that there is no wind force acting on the
body. All such simplifications certainly result in errors in the output from such
models.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 12


Numerical Methods
❑ Blunders
– Blunders are errors that are caused due to human imperfection.
– Since these errors are due to human mistakes, it should be possible to avoid them to a
large extent by acquiring a sound knowledge of all aspects of the problem as well as the
numerical process.
– Human errors can occur at any stage of the numerical processing cycle. Some common
types of error are:
• Lack of understanding the problem
• Wrong assumptions
• Overlooking of some basic assumptions required for formulating the model
• Errors in deriving the mathematical equation or using a model that does not describe adequately the physical
system under study
• Selecting a wrong numerical method for solving the mathematical model
• Selecting a wrong algorithm for implementing the numerical method
• Making mistakes in the computer program
• Mistakes in data input, such as misprints, giving values column-wise instead of row-wise to a matrix, forgetting
a negative sign, etc.
• Wrong guessing of initial values.

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 13


Numerical Methods
❑ Absolute and Relative Errors
An error is usually quantified in two different but related ways:
– Absolute error and
– Relative error.

Absolute Error
– Let us suppose that the true value of a data item is denoted by xt and its approximate
value is denoted by xa. Then, they are related as follows:
– True value xt = Approximate value xa + Error.
– The error is then given by
Error = xt - xa
– The error may be negative or positive depending on the values of xt and xa. In error
analysis, the magnitude of the error is important and not the sign and, therefore, we
normally consider what is known as absolute error which is denoted by

ea = xt − x a

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 14


Numerical Methods
❑ Absolute and Relative Errors
Relative Error
– In many cases, absolute error may not reflect its influence correctly as it does not take
into account the order of magnitude of the value under study.
– For example, an error of 1 gram is much more significant in the weight of a 10 gram gold
chain than in the weight of a bag of rice.
– Relative error is the normalized absolute error. It is defined as follows:

absolute error
er =
true value
xt − x a xa
= = 1−
xt xt

5/27/2023 Md. Golam Moazzam, Dept. of CSE, JU 15

You might also like