You are on page 1of 24

Lecture-4

Numerical Analysis

• Round-off Error
What we have already studied?
Lets evaluate ourself

The following gas stations were cited for


irregular dispensation by the Department of
Agriculture.
Which one cheated you the most?
Station Actual Gasoline dispensed Gasoline reading at pump

Ser 9.90 10.00


Cit 19.90 20.00
Hus 29.80 30.00
She 29.95 30.00

•Ser
•Cit
•Hus
•She
Round-off Error

When a calculator or digital computer is used to perform


numerical calculations, an unavoidable error, called
round-off error, must be considered.

This error arises because the arithmetic performed in a


machine involves numbers with only a finite number of
digits.
Round-off Error

There are two major approaches: chopping and


rounding:

• When chopping a number to a specified number of


decimal places, say m, the first m digits are retained

• When rounding a number, the closest number is


chosen that is representable of the number.
How to Round-off a number?

To round off a number to certain decimal places:

• Add 1 if next digit is greater than 5

• Add NOTHING if next digit is less than 5

• If Next Digit =5

Add 1 if previous number is odd

else NO CHANGE
How to Round-off a number?

• 3.1416 rounded to 2 decimal place is _________

• 3.1416 rounded to 3 decimal place is _________

• 1.2735 rounded to 1 decimal place is _________


How to Round-off a number?

• 3.1416 rounded to 2 decimal place is 3.14


as the next digit (1) is less than 5

• 3.1416 rounded to 3 decimal place is 3.142


as the next digit (6) is more than 5

• 1.2735 rounded to 1 decimal place is 1.3

• as the next digit (7) is more than 5.


How to Round-off a number?

• 1.2735 rounded to 3 decimal places is _________

• 4.585 rounded to 2 decimal place is _________


How to Round-off a number?

• 1.2735 rounded to 3 decimal places is 1.274

As the next digit is 5 and previous number (3) is Odd

• 4.585 rounded to 2 decimal place is

4.58

As the next digit is 5 and previous number (8) is Even


Question:

• Calculate Absolute, Relative and percentage Error when


2.8458 is round upto 3 decimal places.
Question:

• Approximate value of pi is taken as 3.14 and the true


value is 3.1415926.

• Find Ea, Er
Question:

• Approximate value of 1/3 is taken as

• 0.3

• 0.33

• 0.34

Which is the best approximation?


Question:

Which error is dependent of the unit of measurement?

• Relative

• Absolute

• Percentage
Rules for Estimating Errors

The following principles are useful for estimating the errors incurred when
numbers in a calculation are truncated or rounded to a specific number of
digits. If the approximate value of a number is , and is the exact value with
n decimal digits, then

•Absolute error due to truncation to digits is less than

•Absolute error due to rounding off digits is less than

•This can be extended to find the relative error as:

•Relative error due to truncation to digits is less than

•Relative error due to rounding off digits is less than


Rules for Estimating Errors

Also, if a number is correct to significant digits or


decimal places, then the maximum relative error
Example:

• Find percentage error if x=0.61 is correct to 2 decimal


places
Example:

• Find percentage error if x=0.61 is correct to 2 decimal


places

• if a number is correct to significant digits or decimal


places, then the maximum relative error

• Here n=2, hence relative error=0.5 x 10-2

• Thus, percentage error=0.5%


MCQ

• A computer that represents only 4 significant digits with


chopping would calculate 66.666*33.333 as

(A) 2220

(B) 2221

(C) 2221.17778

(D) 2222
MCQ

• A computer that represents only 4 significant digits with


rounding would calculate 66.666*33.333 as

(A) 2220

(B) 2221

(C) 2221.17778

(D) 2222
Continued…

You might also like