Lecture 1
Numerical Methods
[MA-200]
Introduction
The analytical solution of a mathematical problem is known as exact
solution. There are many problems for which solutions by analytical
means are either impossible or may be complex that they are quite
unsuitable for practical purpose.
Why Numerical Methods ?
• Numerical methods aims to give a numerical solution to a mathematical
problem
• They are used whenever the mathematical problem is too complex or too
lengthy to give a closed form solution
• Numerical solutions are always approximations of the exact solution
Since numerical methods provide estimates to the exact solutions. So, there
are essential chances of errors.
What Are Numerical Methods?
• Numerical methods are algorithms
– Precise set of rules to follow
– Generate a numerical approximation of the mathematical problem
– Do not tell how good/poor is the approximation
• To give a complete answer an estimation of the error of the
approximation has as well to be determined
Most Algorithms Are Iterative
x2
xo
x1
Algorithm
Quality Control of Answer
Algorithm
xi xi+1
Error > TOL
Error
Error is the difference between the exact mathematical solution and the
numerical approximation.
If y is the exact solution and 𝑦 ∗ is the numerical approximation, then
Error = 𝐸 = 𝑦 − 𝑦 ∗
Sources of Errors
There are three main sources of errors
• Gross Errors
• Rounding Errors
• Truncation Errors
Gross Errors
These error often arise due to human mistake (or by the computer). For
example, misreading the figures, use of inaccurate mathematical formula
for a particular problem or use of inaccurate data.
Such errors can be avoided by taking enough care in using the proper
numerical technique.
Rounding Errors
The errors introduced by rounding off numbers to a limited number of decimal
places are called rounding errors.
For Example, If value of 𝜋 = 3.1415926535 is rounded off to 3.14 or 3.142.
By using this value, the rounding error arises.
Rounding errors are also introduced due to computers. Because computer
hardware works with only limited number of digits in machine numbers. If a
1
number is correct up to n decimal places, then it has rounding error 𝑒 ≤ ×
2
−𝑛 1
10 . E.g., 𝜋 = 3.1415926535, then 𝑒 ≤ × 10−10 =0.00000000005
2
Truncation Errors
Truncation is defined as the replacement of one series by another with
fewer terms. The error arising from this approximation is called the
truncation error.
For example, the infinite Taylor’s series expansion of 𝑒 𝑥 is
𝑥 𝑥2 𝑥3 𝑥4 𝑥5 𝑥𝑛
𝑒 =1+𝑥+ + + + +… + (𝑖)
2! 3! 4! 5! 𝑛!
It might be replaced with just the first five terms
𝑥2 𝑥3 𝑥4
1+𝑥+ + + (𝑖𝑖)
2! 3! 4!
Cont.
Using equation (ii) instead of (i) gives rise to the truncation error
1/2
න 𝑒 𝑥 𝑑𝑥 = 0.64872127
0
And
1/2
𝑥2 𝑥3 𝑥4
න (1 + 𝑥 + + + )𝑑𝑥 = 0.64869792
0 2! 3! 4!
Error = 0.64872127 − 0.64869792
= 0.00002335 [Error due to truncation]