You are on page 1of 18

MATH-352 Numerical Methods – 2+1 CHs

By

Prof Dr Safia Akram

INTRODUCTION

Lec # 1

1
NUMERICAL METHODS
INTRODUCTION
Numerical Analysis involves the study of methods of computing
numerical data. In many problems this implies producing a sequence
of approximation by repeating the procedure again and again. People
who employ numerical methods for solving problems must worry
about the following issues:
➢ the rate of convergence (how long does it take for the method to
find the answer).
➢ the accuracy (or even validity) of the answer.
➢ the completeness of the response (do other solutions in addition of
the one found, exist). 2
Numerical Methods provide approximations to the problems in
question. No matter how accurate they are they don't, in most cases,
provide the exact answer. In some instances, working out the exact
answer by a different approach may not be possible or may be too
time consuming and it is in these cases where numerical methods are
most often used.

3
APPROXIMATIONS AND ERRORS
OR
ESTIMATION OF ERRORS
EXACT NUMBERS:
Numbers with which no uncertainty is associated, or no approximation is
taken, are known as exact numbers.
3 2
For example: 5, , , … are exact numbers.
6 3
APPROXIMATE NUMBERS:
There are numbers which are not exact e.g 2 = 1.41421356 … , and
e = 2.718281828 … etc. are not exact numbers.
Since they contain infinitely many non-recurring digits.
The numbers obtained by retaining a few digits are called
approximate numbers.
Consider the numbers 𝜋 ≅ 3.142, e = 2.718
(Read ≅ approximately equal to) 3.142, 2.718 are the approximate
values of 𝜋, e .
4
SIGNIFICANT DIGITS / FIGURES
The significant figures in a measurement include all the digits that
are known, plus a last digit that is which is uncertain or is estimated.
For Example: Study the diagram below

Using the ruler at the top of the diagram, what is the length of the darker rectangle
found in between the two rulers?
Answer: The length is between 4 and 5 cm. The “4” is certain, but the distance past 4
cm will have to be estimated. A possible estimate might be 4.3. Both digits are
significant. The first digit is certain, and the second digit is uncertain because it is an
estimate. 5
Determining Significant Figures in Measurements
To determine whether a digit in a measured value is significant, you
need to apply the following rules.
Rule 1: Every nonzero digit is significant
For Example:
➢ 438
➢ 714 Each of these measurements has THREE
➢ 0.743 significant digits.
➢ 26.4

Rule 2: Zeros appearing between nonzero digits are significant.


These are called “sandwich zeros”.
For Example:
➢ 7008
➢ 70.14 Each of these measurements has FOUR
significant digits.
➢ 900.4
6
Rule 3: Zeros to the right of a non zero digit
a) If they are to the right of a nonzero number but not sandwiched
between nonzero and decimal point, they are not significant.
For Example:
➢ 4380 3 Significant digits
➢ 70 1 Significant digits
➢ 4000 1 Significant digits
b) If these zeros are sandwiched between a nonzero number and a
decimal point, they are significant.
For Example:
➢ 43802 5 Significant digits
➢ 700.34 5 Significant digits
➢ 400.1 4 Significant digits
c) All zeros to the right of a decimal point and to the right of a non-
zero digit are significant.
For Example:
➢ 0.870 3 Significant digits
➢ 16.40 4 Significant digits 7
Question: Which ZERO digits are NOT significant figures?
Leading zeros before real numbers
Example 0.000231
Trailing zeros after real numbers if no decimal is written-
Example 1,000,000

EXAMPLE: The measurements 0.0071 meter, 0.42 meter,


0.000 099 meter has only two significant figures. Why?
Answer:
0.0071 meter
0.42 meter
0.000 099 meter
These are leading zeros
8
EXAMPLE:
Suppose that the winner of a 100-meter dash finishes the race in 9.98
seconds. The runner in second place has a time of 10.05 seconds.
How many significant figures are in each measurement? Give
reasons.
SOLUTION:
There are three significant figures in 9.98
(Rule 1- every nonzero digit is significant)
There are four significant figures in 10.05
Rule 1- every nonzero digit is significant
Rule 2 – sandwich zeros between nonzero
digits are significant

9
EXAMPLE:
How many significant figures are in each measurement? Give the
rule(s) for counting significant figures
a. 123 m
3 Significant digits
(all nonzero numbers)
b. 40,506 mm
5 Significant digits
❖ all nonzero numbers
❖ sandwich zeros
c. 9.8000 x 104 m
5 Significant digits
(trailing zeros with a decimal are significant)
10
ROUND-OFF NUMBERS:
2
If we divide 2 by 7, we get = 0.285714 … , a quotient which is a
7
non-terminating decimal fraction. For using such number in practical
computation, it is to be cut-off to a manageable size such as 0.29, 0.286,
0.2857, …
The process of cutting-off super-fluous digits and retaining as many digits
as desired is known as “ ROUNDING-OFF A NUMBER”.
The rule of rounding-off a number to “ 𝑘 ” decimal is as follows.
Discard the “ (𝑘 + 1)𝑡ℎ ” and all subsequent decimals.

a) If the number thus discarded is less than half a unit in the (𝑘 + 1)𝑡ℎ
place, leave the 𝑘 𝑡ℎ decimal place unchanged. (i.e., rounding down).

b) If the number thus discarded is greater than half a unit in the (𝑘 + 1)𝑡ℎ
place, add one of the 𝑘 𝑡ℎ decimal place. (i.e., rounding up).

c) In case the discarded portion is exactly half a unit, 𝑘 𝑡ℎ unit is to be


increased by 1, if it odd, Otherwise it is left unchanged.
11
FOR EXAMPLE:
1) Round-off 3.45123 and 3.55034 to 1 decimal place gives 3.4 and
3.6 respectively.

2) Round-off 1.2535102 to 3 decimals is 1.254.


➢ Round-off 1.254 to 2 decimal is 1.25.
➢ Round-off 1.25 to 1 decimal is 1.2.

3) Round-off 2.3678235 to 3 places of decimal is 2.368.

4) 4.6325 when rounded to three decimal places we get 4.632 as the


rounded number. Here 3rd decimal place is even and the portion left
cut is exactly half of the unit at 3rd decimal place.

12
EXAMPLE:
Round off each measurement to the number of significant figures
shown in parentheses.
a. 314.721 meters (four)
b. 0.001 775 meter (two)
c. 8792 meters (two)
SOLUTION:
a. 314.721 meters (four)
314.7
b. 0.001 775 meter (two)
0.0018
c. 8792 meters (two)
8800

13
Scientific Notation:
An expression of numbers in the form 𝑚 × 10𝑛 , where 𝑚 is equal to
or greater than 1 and less than 10, and 𝑛 is an integer.
For Example:
➢ The Scientific notation of 0.0018 = 1.8 × 10−3 .
➢ The Scientific notation of 8800 = 8.8 × 103 .

14
ABSOLUTE, RELATIVE & PRECENTAGE ERROR:
The accuracy of any computation is always of great importance.
These are three common ways to express size of the error in a
computed result.
a) ABSOULTE ERROR: If 𝑥 ′ is the approximate value of exact
number 𝑥, the absolute error (A E) is defined as
Absolute Error = 𝐴𝐸 = |𝑥 − 𝑥 ′|
b) RELATIVE ERROR: Relative error is defined as
𝑥−𝑥′ |𝑥 − 𝑥 ′| 𝐴𝐸
Relative Error = 𝐴𝐸 = = =
𝑥 𝑥 |𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒|
c) PRECENTAGE ERROR
The percentage error in 𝑥 ′ which is the approximate value of 𝑥
𝐴𝐸 |𝑥 − 𝑥 ′|
Precentage Error = 𝑅𝐸 × 100 = 100 × = 100 ×
|𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒| 𝑥
15
EXAMPLE:
If 0.333 is the approximate value of 1/3, find absolute, relative and
percentage errors.
Solution True value = 𝑥 = 1/3
Approximate value = 𝑥 ′ = 0.333

1 1 333 1
Absolute error = 𝑥 − 𝑥′ = − 0.333 = − = = 0.00033
3 3 1000 3000

|𝑥 − 𝑥 ′| 0.00033
Relative Error = 𝑅𝐸 = = = 0.00099
𝑥 1/3

Precentage Error = 𝑅𝐸 × 100 = 100 × 0.00099 = 0.099.

16
EXERCISE
Question # 1 How many significant digits are in each of the
following examples?
1) 47.1 Answers:
2) 9700. 1) 3
3) 0.005965000 2) 4
4) 560 3) 7
5) 0.0509 4) 2
5) 3
6) 701.905
6) 6
7) 50.00
7) 4
8) 50.012
8) 5
9) 0.000009 9) 1
10) 0.0000104 10) 3

17
Question # 2 Determining Significant Digits When Rounding
1) 689.683 grams (4 significant digits)
2) 0.007219 (2 significant digits)
3) 4009 (1 significant digit)
4) 39.21 × 10−1 (1 significant digit)
5) 8792 (2 significant digits) Answers
6) 309.00275 (5 significant digits) 1) 689.7
7) .1046888 (3 significant digits) 2) 0.0072
3) 4000
4) 4 x 10-1
5) 8800
6) 309.00
7) .105

18

You might also like