Professional Documents
Culture Documents
Error
Error
E LECTRONIC LECTURE
Hoang Hai Ha
HCMUT-OISP
Email: hoanghaiha@hcmut.edu.vn
January 4, 2022
ERROR DEFINITIONS
D EFINITION 1.1
Let A be true and approximate values of some
quantity.
ERROR DEFINITIONS
D EFINITION 1.1
Let A be true and approximate values of some
quantity.
Actual error is defined by: |a − A|.
T HE ABSOLUTE ERROR
D EFINITION 1.2
We often cannot find actual error accurately, instead, we
find a positive number ∆a as small as possible such that
|a − A| ≤ ∆ A , in other word, we estimate an upper bound
for the absolute error which give us a “worst-case”. Then
∆a is called absolute error of a.
T HE ABSOLUTE ERROR
D EFINITION 1.2
We often cannot find actual error accurately, instead, we
find a positive number ∆a as small as possible such that
|a − A| ≤ ∆ A , in other word, we estimate an upper bound
for the absolute error which give us a “worst-case”. Then
∆a is called absolute error of a.
E XAMPLE 1.1
We measure the lengths of a bridge and a rivet and come
up with 9999cm and 9 cm, respectively and obtain the
same absolute error with 0.5cm. The measurement in
which case is more accurate?
Hoang Hai Ha (BK TPHCM) ERROR January 4, 2022 3 / 12
Error definitions
R ELATIVE ERROR
D EFINITION 1.3
∆a
The relative error of an approximation a is δa = .
|A|
∆u = |U − u| = | f (X , Y ) − f (x, y)|
∆u = |U − u| = | f (X , Y ) − f (x, y)|
¯ ∂u ∂u
¯ ¯
¯
≈ ¯¯ (x, y).∆x + (x, y).∆ y ¯¯
∂x ∂y
∆u = |U − u| = | f (X , Y ) − f (x, y)|
¯ ∂u ∂u
¯ ¯
¯
≈ ¯¯ (x, y).∆x + (x, y).∆ y ¯¯
∂x ∂y
¯ ∂u ¯ ∂u
¯ ¯ ¯ ¯
¯ ¯
É ¯¯ (x, y)¯¯ .∆x + ¯¯ (x, y)¯¯ .∆ y
∂x ∂y
∆u = |U − u| = | f (X , Y ) − f (x, y)|
¯ ∂u ∂u
¯ ¯
¯
≈ ¯¯ (x, y).∆x + (x, y).∆ y ¯¯
∂x ∂y
¯ ∂u ¯ ∂u
¯ ¯ ¯ ¯
¯ ¯
É ¯¯ (x, y)¯¯ .∆x + ¯¯ (x, y)¯¯ .∆ y
∂x ∂y
Then absolute error of u ≤
¯ ∂u ¯ ∂u
¯ ¯ ¯ ¯
¯ ¯
¯ (x, y)¯ .∆x + ¯ (x, y)¯ .∆ y
¯ ∂x ¯ ¯ ∂y ¯
Relative error of u
¯ ∂u ¯ ∂u
¯ ¯ ¯ ¯
¯ ¯
¯ (x, y)¯ .∆x + ¯ (x, y)¯ .∆ y
∆u ¯ ∂x ¯ ¯ ∂y ¯
δu = =
|u| |u|
¯∂ ¯∂
¯ ¯ ¯ ¯
¯ ¯
= ¯¯ ln f (x, y)¯¯ .∆x + ¯¯ ln f (x, y)¯¯ .∆ y
∂x ∂y
Relative error of y
n ¯ ∂f ¯
¯ ¯
P ¯ .∆
∆ y i =1 ¯ ∂x i ¯ xi
¯
δy = =
|y| |f |
n ¯
∂
¯ ¯
X ¯
= ¯¯ ln f (x 1 , x 2 , . . . , x n )¯¯ .∆xi
i =1 ∂x i
E XAMPLE 2.1
1
Find the absolute and relative error for volume V = πd 3
6
of a sphere whose diameter is d = 3.70cm ± 0.05cm and
π = 3.14 ± 0.0016.
E XAMPLE 2.1
1
Find the absolute and relative error for volume V = πd 3
6
of a sphere whose diameter is d = 3.70cm ± 0.05cm and
π = 3.14 ± 0.0016.
E XAMPLE 2.2
Find absolute and relative error of y = a − b + c with
a = −47.132 ± 0.003; b = 47.111 ± 0.02; c = 45.234 ± 0.5.
E XAMPLE 2.1
1
Find the absolute and relative error for volume V = πd 3
6
of a sphere whose diameter is d = 3.70cm ± 0.05cm and
π = 3.14 ± 0.0016.
E XAMPLE 2.2
Find absolute and relative error of y = a − b + c with
a = −47.132 ± 0.003; b = 47.111 ± 0.02; c = 45.234 ± 0.5.
E XAMPLE 2.3
Given f (x, y) = x 3 − x y + y 2 , where x = 2.3 ± 0.0056,
y = 0.45 ± 0.0012. Estimate the absolute and relative error
of f .
Hoang Hai Ha (BK TPHCM) ERROR January 4, 2022 10 / 12
Error of function
E XAMPLE 2.4
Given f = abc, where a = 2.3 ± 0.035, b = −3.4 ± 0.0231,
c = 4.5 ± 0.0023. Find absolute and relative error of f .
Rounding to four decimal digits.
D EFINITION 3.1
An algorithm is a procedure which describes a finite
sequence steps to approximate a solution to a given
problem.
D EFINITION 3.1
An algorithm is a procedure which describes a finite
sequence steps to approximate a solution to a given
problem.
D EFINITION 3.2
Suppose we use algorithm (A) to build an approximate
sequence of solutions x n , if x n → x, where x is the exact
solution of the problem, then we say that the algorithm
(A) converges.