Chapter 1: Introduction
Learning Objectives
In this chapter, you will learn:
- Types of error
- Ways of error reduction
- Types of software used to solve computational problems using numerical methods
1. Error Analysis
Definition of Error
An error, , in Numerical Mathematics is the difference between the actual value (exact value) and its computed value.
If represents the computed value of a quantity, and the actual value is xx, then the error is:
Ways of Measuring Error
Absolute Error
Relative Error
Types of Error
Note
By default, if question doesn’t specify. Use Rounding method.
Round-off Error
Round-off error occurs when numbers are rounded to a limited number of decimal places.
Rules for rounding off a number:
- If the digit to be dropped is 0, 1, 2, 3, or 4, leave the next remaining digit unchanged.
- If the digit to be dropped is 5, 6, 7, 8, or 9, increase the next remaining digit by one.
Chopping Error
A number is chopped to digits when all digits beyond the -th digit are discarded without changing any of the remaining digits.
Truncation Error
Truncation error is the error arising when an infinite series is replaced by a finite number of terms.
Example
Example: The infinite Taylor series for is:
ex=1+x+x22!+x33!+x44!+…e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \dots
Info
If question doesn’t specify, use 4 decimal places.
Example 1
Given an actual value = 1.485642x = 1.485642 and its computed value ∗=1.492101x = 1.492101, find:
(a) Absolute Error
(b) Relative Error
Example 2: Round-off Error
Round off to five decimal places and find its absolute error.
Example 3: Chopping Error
Chop to five decimal places and find its relative error.
2. Error Reduction
Notes
actual value means plucking in the value without rounding
Nested Form
A polynomial function is given by:
Rewriting in nested form:
Example 4: Consider the polynomial function:
(a) Rewrite in the nested form
(b) Compute using:
(i) Exact Evaluation
(ii) Three-digit rounding-off evaluation (iii) Three-digit chopping evaluation
Accuracy loss due to rounding and chopping errors can be reduced using nested form.
3. Avoiding Loss of Significance in Subtraction
Loss of significance occurs when nearly equal numbers are subtracted.
Example: Consider two nearly equal numbers:
This result has only five significant digits.
Techniques to reduce loss of significance:
- Rationalization
- Taylor series expansion
Example 5: Avoiding Loss of Significance
Given the function:
f(x)=x−x+1f(x) = x - \sqrt{x+1}
(a) Approximate f(500)f(500) using direct computation:
(b) Rewrite to Avoid Subtraction
(c) Approximate f(500)f(500) using the rewritten function
(d) Compare Errors
Using the rewritten function reduces the loss of significance.
4. The Use of Taylor Series
Taylor series expansions can help avoid subtraction errors.
Example 6: Given
Rewrite using the Taylor series: