Advanced Database
Advanced Database
Marys University
Faculity of Informatics
Chapter 1
Overview
Numerical Analysis is the branch of mathematics that provides tools and methods
for solving mathematical problems in numerical form. The overall goal of the field of
numerical analysis is the design and analysis of techniques to give approximate but
near to accurate solutions to hard problems i.e problems that cannot be solved using
analytical method.
Errors
Occurrence of error is unavoidable in the field of scientific computing. In- stead, numerical
analysts try to investigate the possible and best ways to minimise the error. The study of the error
and how to estimate and minimise it are the fundamental issues in error analysis
Sources of Errors
The main sources of errors in numerical computation are rounding-off, data uncertainty,
and truncation.
Round-off Errors:
Round-off error occurs because computers use fixed number of bits and hence fixed
number of binary digits to represent numbers. When the number of bits required for
representing a number is less than the number is usually rounded to fit the available
number of bits. This is done either by chopping or by symmetric rounding.
There are also the irrational numbers such as , which do not terminate. In order to
carry out a numerical calculation involving such numbers, one must approximate them
by a representation involving a finite number of significant digits (sd).
Chopping: Rounding a number by chopping amounts to dropping the extra digits. Here
the given number is truncated. Suppose that we are using a computer with a fixed word
length of four digits. Then the truncated representation of the number will be . The
digits will be dropped. Now to evaluate the error due to chopping let us consider the
normalized representation of the given number
Uncertainty in the data is always a possibility when we are solving practical problems. It
may arise in several ways: from errors in measuring physical quantities, from errors in
storing the data on the computer (rounding errors), or, if the data is itself the solution to
another problem, it may be the result of errors in an earlier computation. The effects of
errors in the data are generally easier to understand than the effects of rounding errors
committed during a computation, because data errors can be analyzed using perturbation
theory for the problem at hand, while intermediate rounding errors require an analysis
specific to the given method.
Truncation Errors:
3 5
x x
Sinx ≃ x- +
3! 5!
Significant Digit Rules
How do we determine the number of significant digits in a number such as 0.23 g or 1.20 ?
In order to determine the number of significant digits there are several rules we can use.
Non-zero digits are any digits other than zero. According to this rule, any digits in a
number that are not zero are significant. Let's look at a few examples:
Here we can see any digit that is a non-zero digit is considered significant. This is true
both in the presence or absence of a decimal.
Rule Two: Zeros That Appear Between Non-Zero Digits Are Always Significant
According to this rule, any zeros in between non-zero digits are significant. Let's look at a
few examples:
Here we can see any digit that is non-zero is considered significant (Rule 1). The zeros
between the non-zero numbers are also significant. This is true both in the presence or
absence of a decimal.
Rule Three: Zeros Before A Decimal Point That Precede Non-Zero Digits Are Not
Significant
According to this rule, zeros before a decimal point are not significant when they come
before a non-zero number. Let's look at a few examples:
In the first example, all non-zero digits are significant (Rule 1). The zeros between the
non-zero numbers are significant (Rule 2). The zeros before the decimal point preceding
the non-zero digits are not significant (Rule3).
In the second example (0.01022) there are 4 significant figures. All non-zero numbers are
significant (Rule 1) and the zero in between the non-zero numbers is also significant
(Rule 2). The zeros before the non-zero numbers are not significant (Rule 3).
Rule Four: Zeros To The Right Of A Decimal After A Non-Zero Number Are
Significant
According to this rule, all zeros after a decimal are significant only when they come
behind a non-zero number. Let's look at some examples:
Notice in the last example, only the non-zero number (Rule 1) and the 0 after that number
are considered significant (Rule 4). Rule 3 tells us the zeros before the non-zero number
are not significant.
Absolute and Relative Error
True Error e = x − ~
x
Absolute Error e | = |x −~
x|
~ ¿
Relative Error er = ¿ x− x∨ ¿ x∨¿ ¿ ¿
c. Relative Error
Solution:
a. The error
e=x−~
x = 3.141592653589793 − 3.14159265 = 3.5897929073769321x10− 09
= 3.589792907376932 × 10−9 = 0.000000003589792907376932.
e = |x−~
x | = |3.141592653589793−3.14159265| = 3.589792907376932× 10−9
Propagation of error
It refers to the methods used to determine how the uncertainty in a calculated result is related to the
uncertainties in the individual measurements. The propagation of errors in individual mathematical
operations, such as addition, multiplication, raising numbers to powers, etc. can be determined
with specific analytical formulas. In a numerical computation round-off errors are introduced at
every stage of computation. Hence though an individual round-off error due to a given number at a
given numerical step may be small but the cumulative effect can be significant. This creates
propagation of error.
However, the analysis of the propagation of errors through a model is frequently most easily
accomplished numerically.
1. How many significant digits does each of the following numbers have?
a. 185000 e. 1.850 × 102
b. 0.0185 f. 1.8500 × 10−2
c. 1.0185 g. 100.00
3
d. 1.85 × 10 h. 100.001
3. For the number 5/3 = 1.66666...determine the magnitude of the round-off error when it
I. chopping to 3sd,
II. chopping to 3sd,
III. rounding to 3sd
IV. rounding to 3sd.
3. Approximate the following numbers to four digits using rounding and chopping:
1. 1.98876.
2. 33.87654.
3. 8.98879.
4. 2.88778