Approximation
Approximation is the process of finding a value that is close to, but not
exactly, the true value.
Consider the calculation of π (pi). The true value of π is an irrational
number with infinite decimal places. However, in practical
computations, we approximate π to a finite number of decimal places,
such as 3.1416.
Accuracy & Precision
• Accuracy refers to how closely a
computed or measured value agrees
with the true value.
• Precision refers to how closely
individual computed or measured
values agree with each other.
Concept of errors
The concept of errors is crucial as it helps in understanding how the
results of computations deviate from the true values.
Types of Errors-
• Absolute Error
• Relative Error
• Percentage Error
• Round-off Error
• Truncation Error
• Inherent Error
Absolute Error/True Error
Absolute error is the difference between the true value and the
approximate value obtained through computation.
Example: If the true value is 5.678 and the approximate value is 5.67.
So, the absolute error is
=∣5.678−5.67∣
=0.008
Relative Error
Relative error is the absolute error divided by the true value.
Example: Using the same values as above, the relative error is
0.008/5.678 ≈ 0.00141
Percentage Error
Percentage error is the relative error multiplied by 100.
Example: Continuing the previous example, the percentage error is
0.141%.
Round-off Error
Round-off error occurs when numbers are rounded during calculations.
Example: If π is approximated as 3.14159 instead of its true value, the
difference between these values is the round-off error.
Truncation Error
Truncation error arises when an infinite process (like a series or an
iterative method) is approximated by terminating it after a finite
number of steps.
The error is the difference between the exact mathematical result and
the approximation.
Inherent Error
Inherent error refers to the unavoidable error that arises due to the
limitations of the method or model being used to approximate or
compute a result.
Unlike errors that result from mistakes in calculation or measurement,
inherent error is a fundamental aspect of the mathematical or
computational approach itself.
Floating-point arithmetic
• Floating-point arithmetic is a method used in computers to represent and manipulate real
numbers that can have fractional components.
• Especially useful for handling very large or very small numbers, or numbers that require a high
degree of precision.
Example: The number 156.78 could be represented as
0.15678 × 10^3 in a floating point base-10 system.
Floating-point arithmetic
Figure: The manner in which a floating-point number is stored in a word
Disadvantages:
o Take up more room
o Longer to process than integer numbers
o Mantissa holds only a finite number of significant figures. Thus, a round-off
error occurs.