Chapter 1: Errors: Methods of Approximation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

BEKG 2452 Numerical Methods

Chapter 1: Errors

- Introduction to Numerical Methods


- Errors
- Floating Point Number System
- Errors Measuring
- Norms

Prepared by: DR. LOH SER LEE (FKE)

BEKG 2452 Numerical Methods

1.1 Introduction

WHAT ARE NUMERICAL METHODS?

Methods of approximation

slloh@utem.edu.my

1
BEKG 2452 Numerical Methods

1.1 Introduction

Two factors to be considered when applying numerical


methods:

• How to obtain the approximations?

• How accurate are the approximations?

Error is the difference between the


true value and the approximate value.

slloh@utem.edu.my

BEKG 2452 Numerical Methods

1.2 Errors
1.2.1 Floating Point System

𝑦 = ± 𝑚 × 𝑏𝑛

• m – mantissa
• b – base, e.g. base 10
• n – exponent
• If
0.1 ≤ m < 1
then the system is said to be normalised.

slloh@utem.edu.my

2
BEKG 2452 Numerical Methods

1.2.1 Floating Point System


Example:
A computer with a four decimal digit floating point arithmetic
means that the number of digits is limited to four. Hence, all
the numbers are in the form
(± 0. ××××) 10n

1 = +0.1000 101
−0.005 = (−0.5000)10−2
1
− = (−0.3333)100
3
slloh@utem.edu.my

BEKG 2452 Numerical Methods

1.2.2 Measuring Errors


Error = |true value – approximate value|
= 𝑋𝑇 − 𝑋𝐴

error 𝑋𝑇 −𝑋𝐴
Relative error = =
true value 𝑋𝑇

true value – approximate value


True percent relative error = × 100%
true value

present approximation – previous approximation


Approximate percent relative error = × 100%
present approximation

slloh@utem.edu.my

3
BEKG 2452 Numerical Methods

1.2.3 Norm

A norm is a real-valued function that provides a measure of the size or


‘length’ of multicomponent mathematical entities such as vectors and
matrices.

slloh@utem.edu.my

BEKG 2452 Numerical Methods

Example of Common Norms:

𝐿1 norm

Definition:
The 𝑳𝟏 norm on ℝ𝑛 is given by
𝑛

𝐱 1 = 𝑥𝑖
𝑖=1
where 𝐱 = (𝑥1 , 𝑥2 , … 𝑥𝑛 )T

Example:
Let 𝐱 = (−1, 2, −3)T . Find the 𝐿1 norm of 𝐱.

Solution:
3

𝐱 1 = 𝑥𝑖 = −1 + 2 + −3 = 6
𝑖=1

slloh@utem.edu.my

4
BEKG 2452 Numerical Methods

𝐿∞ norm (maximum or infinity norm)

Definition:
The 𝑳∞ norm on ℝ𝑛 is given by

𝐱 ∞ = max{ 𝑥𝑖 : 𝑖 = 1,2, … , 𝑛}

where 𝐱 = (𝑥1 , 𝑥2 , … 𝑥𝑛 )T

Example:
Let 𝐱 = (−1, 2, −3)T . Find the 𝐿∞ norm of 𝐱.

Solution:

𝐱 ∞ = max 𝑥𝑖 : 𝑖 = 1,2,3 = max −1 , 2 , −3 = max 1,2,3 = 3

slloh@utem.edu.my

BEKG 2452 Numerical Methods

𝐿2 norm (Euclidean norm)

Definition:
The 𝑳𝟐 norm on ℝ𝑛 is given by

𝑛 1/2

𝐱 2 = 𝑥𝑖2
𝑖=1

where 𝐱 = (𝑥1 , 𝑥2 , … 𝑥𝑛 )T

Example:
Let 𝐱 = (−1, 2, −3)T . Find the 𝐿2 norm of 𝐱.

Solution:

1/2
3

𝐱 2 = 𝑥𝑖2 = 1+4+9 1/2 = 14


𝑖=1

slloh@utem.edu.my

5
BEKG 2452 Numerical Methods

𝐿𝑝 norm (Holder 𝐿𝑝 norm or p-norm)

Definition:
The 𝑳𝒑 norm on ℝ𝑛 is given by

𝑛 1/𝑝

𝐱 = 𝑥𝑖 𝑝
𝑝
𝑖=1

where 𝐱 = (𝑥1 , 𝑥2 , … 𝑥𝑛 )T

Example:
Let 𝐱 = (−1, 2, −3)T and 𝑝 = 3. Find the 𝐿𝑝 norm of 𝐱.

Solution:

1/3
3
3 1/3 3
𝐱 3 = 𝑥𝑖 = 1 + 8 + 27 = 36
𝑖=1

slloh@utem.edu.my

BEKG 2452 Numerical Methods

Let 𝐴 ∈ ℝ𝑛×𝑚 be a 𝑛 × 𝑚 matrix.

Definition:
Let the 𝑖, 𝑗 entry of a matrix 𝐴 ∈ ℝ𝑛×𝑚 be denoted 𝑎𝑖𝑗 . Then the 1-norm
of a matrix is the maximum of the column sums of the absolute values of
the entries of the matrix:
𝑛

𝐴 1 = max 𝑎𝑖𝑗
𝑗
𝑖=1

Example:
Find the 1-norm of 𝐴 given:
1 −2 3
𝐴 = −6 5 4
7 −8 −9
Solution:
𝐴 1 = max 𝟏 + 𝟔 + 𝟕, 𝟐 + 𝟓 + 𝟖, 𝟑 + 𝟒 + 𝟗 = max 14, 15, 16 = 16

slloh@utem.edu.my

6
BEKG 2452 Numerical Methods

Let 𝐴 ∈ ℝ𝑛×𝑚 be a 𝑛 × 𝑚 matrix.

Definition:
Let the 𝑖, 𝑗 entry of a matrix 𝐴 ∈ ℝ𝑛×𝑚 be denoted 𝑎𝑖𝑗 . Then the ∞-norm
of a matrix is the maximum of the row sums of the absolute values of the
entries of the matrix :
𝑚

𝐴 ∞ = max 𝑎𝑖𝑗
𝑖
𝑗=1

Example:
Find the ∞-norm of 𝐴 given:
1 −2 3
𝐴 = −6 5 4
7 −8 −9
Solution:
𝐴 ∞ = max 𝟏 + 𝟐 + 𝟑, 𝟔 + 𝟓 + 𝟒, 𝟕 + 𝟖 + 𝟗 = max 6, 15, 24 = 24

slloh@utem.edu.my

You might also like