Numerical Chapter-1
Numerical Chapter-1
Table of Contents
Unit-1: Errors in numerical computations ................................................................................. 2
1.1 Introduction ......................................................................................................................... 2
1.2 Some Mathematical preliminaries ................................................................................ 3
1.2.1 Theorem (Intermediate value theorem) ..................................................................... 3
1.2.2 Theorem (Location theorem) ....................................................................................... 3
1.2.3 Theorem (Mean value theorem) .................................................................................. 3
1.2.4 Theorem (Taylor’s theorem) ....................................................................................... 3
1.3 Errors ................................................................................................................................... 3
1.3.0 Definition of Error ........................................................................................................ 3
1.4 Sources of Errors ............................................................................................................. 3
1.4.1 Modeling Error ............................................................................................................. 4
1.4.2 Data Uncertainty........................................................................................................... 4
1.4.3 The numerical Methods used....................................................................................... 4
1.4.4 Computational Error ................................................................................................... 4
1.5 Types Error.......................................................................................................................... 5
1.5.1Inherent Error ............................................................................................................... 5
1.5.2 Round off Error ............................................................................................................ 5
1.5.3. Truncation Error ......................................................................................................... 5
1.5.4. Absolute, Relative and Percentage Error .................................................................. 5
1.6 Decimal places and Significant Digits................................................................................ 6
1.7 Propagation of Errors in Function Evaluations ............................................................... 7
1
NUMERICAL ANALYSIS CHAPTER ONE
2
NUMERICAL ANALYSIS CHAPTER ONE
Phase3: The designed algorithm will be coded or translated to a computer language. This
process is called programming.
For numerical methods, the true value will be known only when we deal with functions that can
be solved analytically. However, in real world applications, we can’t obtain exact solutions and
consequently we can’t compute the associated errors. For these situations, an alternative is to use
the best available estimate of the true value.
Errors are deliberate but often unavoidable part of the solution process, are not mistakes which are
attributed due to human imperfection or malfunctions of computers.
The following are the main sources of error in obtaining numerical solutions to mathematical
problems.
3
NUMERICAL ANALYSIS CHAPTER ONE
Input data from a physical problem may contain error or inaccuracy within it associated with
measurement or previous computations. This affects the accuracy of any calculation based on the
data, limiting the accuracy of answers. Hence, there may be an error involved due to uncertainty
of physical data.
In most cases numerical methods are approximate by themselves, that is even if the initial data are
void of errors all the arithmetic operations are identically performed, they yield the solution of the
original with some error which is called the error of the method. In a number of cases the
numerical method is constructed on the basis of an infinite process which leads the desired solution
(for instance computing the value of an elementary function with the aid of partial sums of power
series in to which this function is expanded). But in reality, the passage of the limit usually fails to
be realized and the process interrupted at a certain step yields an approximation.
Round off Error: arises because it is impossible to represent all real numbers exactly on a finite
state machine since a world in a computer memory stores only a finite number of digits and hence
a computer numbers have limited number of digits. We are forced to cut off some of the digits of
1
a number. For example, 3 , 𝑒, 𝑎𝑛𝑑 𝜋.
Truncation Error: is caused by the fact that when an exact mathematical procedure is replaced
by another to make it easier to solve a problem.
𝑥2 𝑥3
Example if 𝑒 𝑥 = 1 + 𝑥 + + + ⋯+ ⋯∞ = 𝑋
2! 3!
𝑥2 𝑥3
Is replaced by 1 + 𝑥 + + = 𝑋′
2! 3!
4
NUMERICAL ANALYSIS CHAPTER ONE
Error which are already present in the statement of a problem before its solution are called
inherent errors. Such errors arise either due to the given data being approximate or due to the
limitations of mathematical tables, calculators or the digital computer. Inherent errors can be
minimized by taking better data or by using high precision computing aids.
Arises because it is impossible to represent all real numbers exactly on a finite state machine since
a world in a computer memory stores only a finite number of digits and hence a computer numbers
have limited number of digits. We are forced to cut off some of the digits of a number
Caused by the fact that when an exact mathematical procedure is replaced by another to make it
easier to solve a problem.
I. 𝐸𝑎 = |𝑋 − 𝑋 ′ | is absolute error .
𝐸
II. 𝐸𝑟 = |𝑋|𝑎 is relative error.
III. 𝐸𝑝 = 100𝐸𝑟 % is percentage error.
Example
1
The three approximation of 3 are given as 0.30, 0.33, and 0.34
5
NUMERICAL ANALYSIS CHAPTER ONE
1. A number is rounded off by dropping one or more digits at its right. If the digit to be
dropped is less than 5, then we leave the digit to its left as it is and if the digit to be
dropped greater than or equal to 5, then we increase the digit to its left by 1.
2. Let 𝑥 be a real number having decimal representation
𝒙 = 𝒂𝒏 𝒂𝒏−𝟏 𝒂𝒏−𝟐 … 𝒂𝟐 𝒂𝟏 𝒂𝟎 . 𝒅𝟏 𝒅𝟐 … 𝒅𝒌 𝒅𝒌+𝟏 𝒅𝒌+𝟐 …
We say that 𝒙 has been correctly rounded to a 𝒌 decimal places number, which we denote it by
Example
a. 𝒅𝟑 (𝒙)
b. 𝒅𝟒 (𝒙)
c. 𝒅𝟖 (𝒙)
3. We say 𝑋 ′ approximates 𝑋 correct to 𝑘 decimal places, if 𝑘 is the largest positive
integer such that the absolute error
𝑬𝒂 (𝑿′ ) = |𝑿 − 𝑿′ | ≤ 𝟎. 𝟓 × 𝟏𝟎−𝒌
Example
4. The following rules apply to find the number of significant digits in a number.
i. All nonzero digits in the number are significant.
ii. Zeros between nonzero digits in the number are significant.
iii. Zeros to the left of the first nonzero digit in the number are not significant.
iv. When the number ends in zeros that are to the right of the decimal point,
these zeros are significant.
v. When the number ends in zeros that are not to the right of the decimal point,
these zeros are not necessary significant.
6
NUMERICAL ANALYSIS CHAPTER ONE
Example
a. 0.31416 (𝒊 ← 𝟓)
b. 102.3 (𝒊𝒊 ← 𝟒)
c. 0.000045 (𝒊𝒊𝒊 ← 𝟐)
d. 127 (𝒊 ← 𝟑)
e. 0.0494200000 (𝒊𝒊𝒊&𝒊𝒗 ← 𝟗)
f. 29000 (𝒗 ← 𝟐, 𝟑, 𝟒, 𝒐𝒓 𝟓)
′
5. An approximation 𝑿 of the number 𝑿 correct to n significant digits if n is the largest
positive integer such that the absolute error
𝑬𝒂 (𝑿′ ) = |𝑿 − 𝑿′ | ≤ 𝟎. 𝟓 × 𝟏𝟎𝑺−𝒏+𝟏 Where S is the largest integer such that
10𝑆 ≤ |𝑋|
Example
Let 𝑦 = 𝑓(𝑥) be a function that depends on 𝑥 which is in error. Let the absolute error in
𝑥 𝑏𝑒 ∆𝑥. Then, we have 𝑦 + ∆𝑦 = 𝑓(𝑥 + ∆𝑥)
The error in 𝑦 is given by ∆𝑦 = 𝑓(𝑥 + ∆𝑥) − 𝑓(𝑥)
From Taylor’s series we have
𝑓 ” (𝑥)∆𝑥 2 𝑓 ′′′ (𝑥)∆𝑥 3
𝑓(𝑥 + ∆𝑥) = 𝑓(𝑥) + 𝑓 ′ (𝑥)∆𝑥 + + +⋯
2! 3!
Dropping the second and higher order derivatives and rearranging we get
7
NUMERICAL ANALYSIS CHAPTER ONE
𝜕𝑦 𝜕𝑦 𝜕𝑦 𝜕𝑦
∆𝑦 = |𝜕𝑥 | ∆𝑥1 + |𝜕𝑥 | ∆𝑥2 + |𝜕𝑥 | ∆𝑥3 + ⋯ + |𝜕𝑥 | ∆𝑥𝑛
1 2 3 𝑛
Example
Find ∆𝑦
b. Let = 5𝑥 3 𝑦 2 𝑧 . Given that 𝑥 = 3, 𝑦 = 1, 𝑎𝑛𝑑 𝑧 = 2 with errors 0.003, 0.001, and 0.002
respectively. Find errors in 𝑤