0% found this document useful (0 votes)
48 views

Lecture 2

This document discusses various types of errors that can occur in numerical analysis calculations. It defines significant digits and how they are used to measure the accuracy of results. There are two main types of errors discussed - true error, which is the difference between the true and approximate values, and rounding error, which occurs due to approximating real numbers with a finite number of digits. The document also covers fixed point and floating point representations of real numbers in computers, and how these representations can introduce errors. Significant digits help quantify errors by indicating which digits in a number are meaningful. Understanding different error types is important for determining the accuracy of numerical results.

Uploaded by

Geeta Arora
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)
48 views

Lecture 2

This document discusses various types of errors that can occur in numerical analysis calculations. It defines significant digits and how they are used to measure the accuracy of results. There are two main types of errors discussed - true error, which is the difference between the true and approximate values, and rounding error, which occurs due to approximating real numbers with a finite number of digits. The document also covers fixed point and floating point representations of real numbers in computers, and how these representations can introduce errors. Significant digits help quantify errors by indicating which digits in a number are meaningful. Understanding different error types is important for determining the accuracy of numerical results.

Uploaded by

Geeta Arora
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/ 58

LECTURE-2,3 MTH-314

Numerical Analysis
MEASURING ERRORS

Errors and Operators :


representation of real numbers,
floating point,
fixed point and computer arithmetic, rounding of numbers,
significant digits and propagation of error,
forward, backward, and central difference operator, examples and
properties of operators
LETS WARM UP!
SIGNIFICANT DIGITS
In the concept of error in numerical analysis a term significant digits
plays a very important role to measure the accuracy of the predicted
results.
EXAMPLE
x =1/3=0.3333333
The computers generally store the finite number of digits,
so every computer performs the computation by taking
finite number of digits. However, this particular number
in decimal format can be written with the infinite number
of digits after decimal, so the computer cannot perform
the computation with such infinite long string of digits.
WHAT IS THE SOLUTION?
There is need to cut down this number somewhere after some fixed
decimal places
This is introducing an error in computation.
WHAT IS THE
POPULATION OF INDIA?
A. Near about 1 crores
B. 135 crores
C. 135.36 crores
HOW THE COMPUTER
STORES THE NUMBER?
In computer each number can be stored by a fixed length, so fixed
length means the fixed number of digits and it depends on computer
that how many digits can be stored in the computer.
Different computers can have different ability to store the number
and to perform the computation with different number of digits.
NUMBER TYPES

True • 1,1/2
Number

Approximat • 1/3, √2,


e Numbers
THERE ARE TWO TYPES OF NUMBERS:
EXACT (TRUE) AND APPROXIMATE.

Exact numbers are 2, 4, 9, 1


numbers such as 4/3 =1.33333..., sqrt(2) =1.414213... and pi =
3.141592...
which cannot be expressed by a finite number of digits.
may be approximated by numbers 1.3333, 1.4142 and 3.1416,
respectively.
Such numbers which represent the given numbers to a certain degree
of accuracy are called approximate numbers
REPRESENTATION OF
REAL NUMBERS
There two types of approaches that are developed to store real
numbers with the proper method.

Fixed point
number

Floating point
number
FIXED POINT REPRESENTATION

In computing, fixed-point number representation is a real data type


for a number.
With the help of fixed number representation, data is converted into
binary form, and then data is processed, stored and used by the
system
FIXED POINT REPRESENTATION

Fixed point representation of data has three parts


 
Sign bit -The fixed-point numbers in binary uses a sign bit. A positive
number has a sign bit 0, while a negative number has a sign bit 1.

Integral Part – The integral part is of different lengths at different places.


It depends on the register's size, like in an 8-bit register, integral part is 4
bits.

Fractional part – Fractional part is also of different lengths at different


places. It depends on the register's size, like in an 8-bit register, integral
part is of 3 bits.

 8 bits =  1Sign bit + 4 bits(integral) + 3bits (fractional part)


 16 bits =  1Sign bit + 9 bits(integral) +6 bits (fractional part)
  32 bits =  1Sign bit + 15 bits(integral) + 9 bits (fractional part)
LIMITATIONS
Range of fixed-point notation is from -15.875 to  +15.875.

The fixed-point notation range is very less as can only represent the
number in a set limit.

It is not suitable for presenting a large amount of data, so it is not


used in computer nowadays.

Therefore, scientists feel that the system needs a new representation


format with the least or no limit because data is becoming a vast
nowadays.
So, floating-point representation came into existence.
FLOATING-POINT
REPRESENTATION

To discard the limitation of fixed-point notation, floating-point number


representation was developed by scientists.
The computer system uses floating-point numbers representation to
convert input data into binary form.
THE FLOATING-POINT NOTATION IS OF TWO TYPE

Scientific notation
Normalized
notation
SCIENTIFIC NOTATION 

Method of representing binary numbers into a x be form.


For example:-
Number = 376.423 ( its not scientific notation)
Number in scientific = 36.4423 x 101 or 3.64423 x 102

The major problem in this notation is while storing mantissa, we need


to tell the decimal position every time to the processor.

So to overcome this problem, normalized notation was invented and


used.
NORMALIZED
NOTATION- 
It is a special case of scientific notation.
Normalized means after the decimal point, we have atleast one non-
zero digit. 
FLOATING POINT
REPRESENTATION
Computer stores the number in a floating point representation,
A number can be written as

M is called mantissa and k is an integer.


M will depend on the base of the number and has range given as

If a number is having base 10 so β=10, thus the range of M will be


0.1 ≤ M
EXAMPLES
2345

7.28

0.0089
WHAT ARE
SIGNIFICANT DIGITS?

Scientists use significant digits to help them with more precise


information about measurement and other numeric data.
These digits also help them with rounding very large or very small
numbers.
Digits in mantissa of a floating point number are called
significant digits.
COUNTING
SIGNIFICANT DIGITS

Rule 1: Every Non-Zero Digit Is Significant


Let's look at some examples:
456 has -------- significant digits
456 has 3 significant digits
68.29 has ___________significant digits
68.29 has 4 significant digits
RULE 2: ZEROS BETWEEN NON-ZERO
DIGITS ARE ALWAYS SIGNIFICANT

Let's look at a few examples:


5,609 has _________ significant digits.
5,609 has 4 significant digits.

700.0879 has _______ significant digits.


700.0879 has 7 significant digits.
RULE 3: ZEROS BEFORE NON-ZERO
DIGITS ARE NEVER SIGNIFICANT

Zeros Before Non-Zero Digits are called leading zeros.


That means if a number begins with zero, as in decimals, they are not
significant.
Let's look at a few examples:
0.067 has __ significant digits
0.067 has 2 significant digits

0.000008 has __ significant digit


0.000008 has 1 significant digit

098 has ___ significant digits


098 has 2 significant digits
RULE 4: ZEROS BEHIND
NON-ZERO DIGITS ARE
SOMETIMES SIGNIFICANT.
We have two cases for rule 4. Notice that zeros behind non-zero
digits are called trailing zeros.
When there is no decimal, zeros behind non-zero digits are not
significant.
Ex: 1000 has 1 s.d
When there is decimal, zeros behind non-zero digits are
significant.
Ex 380.0 has 4 s.d
MORE EXAMPLES
36,600 has___ significant digits

Has 3 significant digits

0.00563 has___ significant digits

Has 3 significant digits


LETS PRACTICE TO FIND SIGNIFICANT DIGITS
BY FLOATING POINT REPRESENTATION
567000 =0.567 x 106
has only 3 significant digits.
560070 =0.56007 x 106
Has 5 significant figures.
56.0070 =0.560070 x 102
has 6 significant figures.
 0.00567 =0.567 x 10-2
has only 3 significant digits.
0.05670 has ______ significant digits.
WHY MEASURE ERRORS?
1) To determine the accuracy of numerical results.
2) To develop stopping criteria for iterative algorithms.

30
HTTP://NUMERICALMETHODS.ENG.USF.EDU
WHY ERROR ARISES?
Errors arises due to approximate calculation procedures.
HOW TO DEAL WITH
ERRORS?
To deal with errors we need to perform 3 steps:
1. Identify Errors
2. Quantify Errors
3. Minimize Errors
HOW TO QUANTIFY Lets start Learning
ERRORS?
ERROR
Error is defined as the difference between the true and the
approximate values.
Also called as True error.
TRUE ERROR
Defined as the difference between the
true value in a calculation and the
approximate value found using a
numerical method etc.

True Error =
True Value – Approximate Value

35
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE
Gravitation force g has true value 9.8 m/s2 but some times
approximated as 10 m/s2
What is error here?
EXAMPLE
Gravitation force g has true value 9.8 m/s2 but some times
approximated as 10 m/s2
What is error here?
Et=9.8-10=-0.2
ANOTHER EXAMPLE—
TRUE ERROR
The derivative, of a function can be
approximated by the equation,

If and
a) Find the approximate value of
b) True value of
c) True error for part (a)

38
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE (CONT.)
Solution:
a) For and

39
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE (CONT.)
Solution:
b) The exact value of can be found by using
our knowledge of differential calculus.

So the true value of is

40
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE (CONT.)
c) True error is calculated as

True Value – Approximate Value

41
HTTP://NUMERICALMETHODS.ENG.USF.EDU
TYPES OF ERRORS

In general, the errors in a practical problem may


get introduced into four forms as follows:
I. Initial error/Error of the problem
II. Residual error or truncation error

III. Rounding error/ Round-off error


1. INITIAL ERROR
These are involved in the statement of problem itself. In fact, the
statement of a problem generally gives an idealized model and not
the exact picture of the actual phenomena.
For example, in the calculation of the value of earth’s gravitational
force g by simple pendulum, the experiment is based upon certain
axioms: such as
(i) bob is weight less
(ii) the motion of the bob is linear, that is, in a straight line; which are
not true, in fact. So the value of the parameter (s) involved can only
be determined approximately.
2. RESIDUAL ERROR OR
TRUNCATION ERROR
This error occurs when mathematical functions like

whose infinite series expansion exist, are used in the calculations.


Because, in calculating the value of such function for an assigned
value of x, only a finite number of terms can be taken, an error get
introduced for not considering the remaining terms.
3.ROUNDING ERROR/
ROUND-OFF ERROR:
When the rational numbers like 1/3; 22/7; 5/9; 8/9 etc, whose
decimal representation involve infinite number of digits, are involved
in our calculations, we are forced to take only a few number of digits
from their decimal expression and thus an error named round-off
error gets involved.
There are universal rules for rounding a number as rounding rules.
4. INHERENT ERROR
/ERROR OF THE
OPERATION
When performing computations with algebraic operations among
approximate numbers, we naturally carry to some extent the errors
of the original data into final result.
Such errors are called inherent error/error of the operation. For
example, let x=0.3333 and y=3.1416 be two approximate numbers
for the exact number 1/3 and pi.
Obviously, if we perform an algebraic operation between these two
approximate numbers, the error will introduce in the final result
accordingly.
5. ABSOLUTE, RELATIVE,
AND PERCENTAGE
ERRORS
If is the true value of a quantity and  is its approximate value, then i.e, |
Error| is called the absolute error.

Magnitude of Error does not show how bad the error is as it depends upon
the other factors also. This lead to the definition of Relative error. The
relative error is defined by

and the percentage error is


MAGNITUDE OF ERROR
Magnitude of Error does not show how bad the error is as it depends
upon the other factors also.
These lead to the definition of Relative error.
Relative can be obtained for the true error and the approximate
error if true value is not known.
RELATIVE TRUE ERROR
Defined as the ratio between the true error, and the true value.

True Error
Relative True Error ( )=
True Value

49
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE-RELATIVE
ERROR
For the previous example for true error,
find the relative and percentage error for
at
with

x 100
=7.588%

50
HTTP://NUMERICALMETHODS.ENG.USF.EDU
APPROXIMATE ERROR
What can be done if true values are not known or are very
difficult to obtain?
Approximate error is defined as the difference between the
present approximation and the previous approximation.

Approximate Error ( ) = Present Approximation – Previous Approximation

51
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE—
APPROXIMATE ERROR
For at find the following,
a) using
b) using
c) approximate error for the value of for part b)

52
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE (CONT.)
Solution: (cont.)

b) For and

54
HTTP://NUMERICALMETHODS.ENG.USF.EDU
EXAMPLE (CONT.)
Solution: (cont.)

c) So the approximate error, is


Present Approximation – Previous Approximation

55
HTTP://NUMERICALMETHODS.ENG.USF.EDU
LETS FIND
 
SOLUTION
Thanks!

You might also like