0% found this document useful (0 votes)
17 views32 pages

Numerical Methods - Lecture-02

the lecture sheet of course numerical method (part 02)

Uploaded by

mdalislamrifat1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views32 pages

Numerical Methods - Lecture-02

the lecture sheet of course numerical method (part 02)

Uploaded by

mdalislamrifat1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

CSE 3107 : Numerical Method

Marjia Sultana
Assistant Professor
Department of Computer Science and
Engineering
Begum Rokeya University, Rangpur
Lecture 2: Approximations and Errors in
Computing
Taxonomy of Errors
Significant digits
Significant digits are certain digits that have significance or meaning
and give more precise details about the value of the number. In order
to find out which ones are significant, we have to follow some rules:
Rule 1: Every non zero digit is significant
Example:
1. 456 has 3 significant digits
2. 68.29 has 4 significant digits
All the other rules have to do with the number zero
Significant digits (Cont…)

Significant digits (Cont…)
Rule 4: Zeros behind non-zero digits are sometimes significant. Two
cases for rule 4.
Case 1: When there is no decimal, Zeros behind non-zero digits are not
significant i.e. when the decimal point is not written, trailing zeros are
not considered to be significant.
Example:
1. 4000 has 1 significant digit
2. 82,700,000 has 3 significant digits
3. 341,600 has 4 significant digits
Significant digits (Cont…)
Case 2: When there is a decimal point, zeros behind non-zero digits are
significant i.e. when the decimal point is written, trailing zeros are
considered to be significant.
Example:
1. 3.50, 65.0 and 0.230 have 3 significant digits
2. 82,700,000. has 8 significant digits
Accuracy and Precision
• Accuracy: Accuracy is how close a value is to its true value. An
example is how close an arrow gets to the bull's-eye center.
The ability of the instrument to measure the accurate value is known
as accuracy.

• Precision: Precision is how repeatable a measurement is. An example


is how close a second arrow is to the first one.
The closeness of two or more measurements to each other is known
as the precision of a substance
Accuracy and Precision (Example)
• If you take the measurement of the mass of a body of 20 kg and you
get 17.4,17,17.3 and 17.1, your weighing scale is precise but not very
accurate. If your scale gives you values of 19.8, 20.5, 21.0, and 19.6, it
is more accurate than the first balance but not very precise.
Accuracy Vs. Precision
Accuracy Vs. Precision
Accuracy Precision
1. Accuracy refers to the level of 1. Precision implies the level of
agreement between the actual variation that lies in the values of
measurement and the absolute several measurements of the same
measurement factor.
2. Represents how closely the results
2. Represents how closely results
agree with the standard value. agree with one another
3. Single-factor or measurement. 3. Multiple measurements or factors
are needed.
Example: the weather temperature Example: If the thermometer
reads 28 °C outside and it is 28 °C continuously registers the same
outside, then the measurement is temperature for several days then the
said to be accurate measurement is also precise.
Precision Calculation
⮚By the precision of an approximate number , we mean the
actual position of the rightmost significant digit.

⮚ If that digit is to the right of the decimal point, we state the


position as so many decimal places.

⮚ If that position is to the left of the decimal point, it is more


common to state the precision using “tens”, “hundreds”,
“thousands”, etc..
Accuracy and Precision (Example 1)
Example 1:
1. 321.56 has an accuracy of 5 significant digits and a precision of 2
decimal places.
2. 3.2156 has an accuracy of 5 significant digits and a precision of 4
decimal places.
3. 321560 has an accuracy of 5 significant digits and a precision tens
( assuming the rightmost zero is not significant).
4. 0.00000003 has an accuracy of 1 significant digits and a precision of
8 decimal places.
5. 325,000,000 has an accuracy of 3 significant digits and a precision of
millions.
Accuracy and Precision (Example 2)
For practice:
Which of the following number has greatest precision?
a) 4.3201 b) 4.32 c) 4.320106
Different types of Errors
1. Modelling errors
2. Inherent errors (Input errors)
2.1 Data errors (Empirical errors)
2.2 Conversion errors (Representation errors)
3. Numerical errors (Procedural errors)
3. 1 Round-off errors
3.1.1 Symmetric round-off errors
3.1.2 Chopping
3.2 Truncation errors
4. Blunders (Human imperfection)
Modelling Errors
• A mathematical model is built to represent a physical process or a phenomenon.
When a mathematical model being formulated is not exact/accurate when
compared to the underlying physical process, errors can occur in the resulting
solution.

• In some situations, it will be impossible to create an exact mathematical model.


Hence, the resultant model may be a simplified version of the underlying physical
process.
Example:
While evaluating disease control programs, mainly epidemiological factors are
included in the model, while others like social factors may be left out to make the
model less complex.
Inherent Errors
2. Inherent Errors / Input Errors
Errors that are present in the data that are input to the model are inherent errors.
They are also called input errors. They are classified into two – Data Errors and
Conversion Errors.
2.1 Data Errors
• Data errors arise when data to be input into a model are acquired using
experimental methods. These are also called empirical errors. Such errors occur
mostly due to the limitations or errors in the instrumentation. A voltage reading can
be accurate only up to the accuracy of the voltmeter.
• Hence, to reduce such errors, it is more important to improve the accuracy of the
data being read than improving the precision of arithmetic operations.
2.2 Conversion Errors
2.2 Conversion Errors
Conversion errors arise due to the limitation of computers to store exact decimal data.
Hence, these are called representational errors.
When a floating point number is converted into its binary form, many numbers cannot
be represented in its exact form.

For example, the floating point number 0.1 converts to a non-terminating binary
form. Since the number of decimal digits are limited, 0.1 suffers an error when stored
in computer memory. When arithmetic operations are performed on such numbers
over and over, the magnitude of error increases. In this example, adding the number
0.1 10 times over may not give us an exact 1.
3. Numerical Errors
Numerical Errors
Errors can arise during the process of implementation of numerical
method. Hence these are also called procedural errors. They are
classified into two – Round-off errors and Truncation errors.

The total numerical error in a process can be calculated as the sum


of round-off errors and truncation errors in the process.
Round-off errors
Round-off errors
Round-off errors occurs when a fixed number of digits are used to
represent exact numbers.
It is usual to round-off numbers according to the following rules:
To round-off a number to n significant digits, discard all digits to the right
of the nth digits, if the first discarded digit is:
1. Greater than 5, the last retained significant digit is “rounded up” by 1.
2. Less than 5, keep the last retained significant digit unchanged.
3. Exactly 5, “rounded up” the last retained significant digit by 1 if it is
odd; otherwise leave it unchanged.
*The number thus rounded-off is said to be correct to n significant digits.
Round-off errors (Example-1)
Example-1: Following numbers are rounded-off to four significant
digits:
⮚2.64570 to 2.646
⮚12.0354 to 12.04
⮚0.547326 to 0.5473
⮚3.24152 to 3.242

Rounding a number can be done in two ways. One is known as


chopping and the other is known as symmetric rounding.
Chopping

Chopping (Cont…)

Symmetric Round-off

Symmetric Round-off (Cont ….

Homework
• Find the round off error in storing the number 752.6835 using a four
digit mantissa.
Truncation errors
• Truncation error is the difference between a truncated value and the
actual value.
• Truncation means to chop off the decimal portion of a number.
Example:
a) 45.4523 b) 934.659
Truncate at 3 decimal point: 45.452
Truncate at 2 decimal point: 934.65
Truncation errors (Homework)

Approximation Error
The approximation error in same data is the discrepancy between an
exact value and some approximation on it. An approximation can occur
because:
1. The measurement of the data is not precise due to the instrument
(e.g. , the accurate reading of a piece of paper is 4.5cm but since
the ruler does not use decimals, we round it to 5cm) or
2. Approximations are used instead of the real data (e.g. , 3.14 instead
of π)
Absolute Error

Relative Error

Homework
1. A civil engineer has measured the height of a 10 floor building as
2950cm and the working height of each beam as 35cm while the true-
life values are 2945cm and 30cm respectively. Compare their absolute
and relative errors.

You might also like