Chapter 1. Numerical Errors. Module No. 1. Errors in Numerical Computations

Similar documents
Chapter 1: Introduction and mathematical preliminaries

Numerical Methods in Physics and Astrophysics

Chapter 1 Mathematical Preliminaries and Error Analysis

Errors. Intensive Computation. Annalisa Massini 2017/2018

Numerical Methods. King Saud University

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Chapter 1. Numerical Errors. Module No. 3. Operators in Numerical Analysis

Introduction CSE 541

Notes for Chapter 1 of. Scientific Computing with Case Studies

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460

Appendix F. Treatment of Numerical Data. I. Recording Data F-1

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

2 ways to write the same number: 6,500: standard form 6.5 x 10 3 : scientific notation

Mathematical preliminaries and error analysis

How do computers represent numbers?

Measurement Uncertainties

Chapter 1 Error Analysis

Lesson 1.3: Algebra and Scientific Notation with Small Numbers

Chapter 1 Computer Arithmetic

Chapter 4. Solution of Non-linear Equation. Module No. 1. Newton s Method to Solve Transcendental Equation

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

NUMERICAL AND STATISTICAL COMPUTING (MCA-202-CR)

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Mathematics for Engineers. Numerical mathematics

The Rules of the Game

Chapter 2 - Measurements and Calculations

An Introduction to Differential Algebra

Decimal Scientific Decimal Scientific

Engineering Fundamentals and Problem Solving, 6e. Chapter 6 Engineering Measurements

Numerical Methods. Dr Dana Mackey. School of Mathematical Sciences Room A305 A Dana Mackey (DIT) Numerical Methods 1 / 12

Chapter 1 Mathematical Preliminaries and Error Analysis

Base unit-a defined unit of measurement based on an object or event in the physical world. Length

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

NUMERICAL METHODS C. Carl Gustav Jacob Jacobi 10.1 GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING

Latest Syllabus - NMO

Mathematics Foundation for College. Lesson Number 1. Lesson Number 1 Page 1

INTRODUCTION TO COMPUTATIONAL MATHEMATICS

(Significant Digits are in BOLD type and the non-significant digits are underlined)

Measurement. Scientific Notation. Measurements and Problem Solving. Writing Numbers in Scientific Notation

Errors Intensive Computation

Chemistry: The Study of Change Chang & Goldsby 12 th edition

Every time a measurement is taken, we must be aware of significant figures! Define significant figures.

Section 4.7 Scientific Notation

Introduction and mathematical preliminaries

GEOMETRY AND MENSURATION...

Scientific Notation. Scientific Notation. Table of Contents. Purpose of Scientific Notation. Can you match these BIG objects to their weights?

ECE 102 Engineering Computation

Round-off Errors and Computer Arithmetic - (1.2)

Floating-point Computation

PHY 335 Data Analysis for Physicists

Radiological Control Technician Training Fundamental Academic Training Study Guide Phase I

Chapter 3 Math Toolkit

Metric Prefixes UNITS & MEASUREMENT 10/6/2015 WHY DO UNITS AND MEASUREMENT MATTER?

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

A video College Algebra course & 6 Enrichment videos

University of South Carolina. Stephen L Morgan. Tutorial on the Use of Significant Figures

ASTRO 1050 LAB #1: Scientific Notation, Scale Models, and Calculations

Chapter 4 Number Representations

Introductory Chemistry: A Foundation, 6 th Ed. Introductory Chemistry, 6 th Ed. Basic Chemistry, 6 th Ed.

grasp of the subject while attaining their examination objectives.

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013

MTH303. Section 1.3: Error Analysis. R.Touma

Instructors Manual Algebra and Trigonometry, 2e Cynthia Y. Young

Mathematics OBJECTIVES FOR ENTRANCE TEST - YEAR 7. Numbers

Lecture 6: Introducing Complexity

Lies My Calculator and Computer Told Me

CHEM Chapter 1

Introduction to Scientific Computing Languages

Measurement and Uncertainty

1 ERROR ANALYSIS IN COMPUTATION

Lab 1: Simple Pendulum 1. The Pendulum. Laboratory 1, Physics 15c Due Friday, February 16, in front of Sci Cen 301

Stochastic calculus for summable processes 1

ALGEBRA+NUMBER THEORY +COMBINATORICS

Course Outcome Summary

Essential Mathematics

A Readable Introduction to Real Mathematics

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

A little context This paper is concerned with finite automata from the experimental point of view. The behavior of these machines is strictly determin

Students write, add and subtract numbers in scientific notation and understand what is meant by the term leading digit.

CHM111 Lab Math Review Grading Rubric

Name: Date: Practice Midterm Exam Sections 1.2, 1.3, , ,

Chapter 3: Numbers in the Real World Lecture notes Math 1030 Section C

What Every Programmer Should Know About Floating-Point Arithmetic DRAFT. Last updated: November 3, Abstract

Maths Scheme of Work. Class: Year 10. Term: autumn 1: 32 lessons (24 hours) Number of lessons

December 04, scientific notation present.notebook

Numbers and Operations

Compute the behavior of reality even if it is impossible to observe the processes (for example a black hole in astrophysics).

ARITHMETIC AND BASIC ALGEBRA

MEASUREMENT AND PROBLEM SOLVING. Chapter 3 & 4

7th Grade Advanced Pacing Guide

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 2. Predictor-Corrector Methods

Introduction to Finite Di erence Methods

Welcome to Chemistry! Sept 11, 2015 Friday

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

Introduction to Uncertainty. Asma Khalid and Muhammad Sabieh Anwar

Introduction to 1118 Labs

P.1. Real Numbers. Copyright 2011 Pearson, Inc.

Positive Rational Exponents

Name: Date: Practice Midterm Exam Sections 1.2, 1.3, , ,

Introduction to Scientific Computing

Transcription:

Numerical Analysis by Dr. Anita Pal Assistant Professor Department of Mathematics National Institute of Technology Durgapur Durgapur-73209 email: anita.buie@gmail.com

. Chapter Numerical Errors Module No. Errors in Numerical Computations

...................................................................................... Two major techniques are used to solve any mathematical problem analytical and numerical. The analytical solution is obtained in a compact form and generally it is free from error. On the other hand, numerical method is a technique which is used to solve a problem with the help of computer or calculator. In general, the solution obtained by this method contains some error. But, for some class of problems it is very difficult to obtain an analytical solution. For these problems we generally use numerical methods. For example, the solutions of complex non-linear differential equations cannot be determined by analytical methods, but these problems can easily be solved by numerical methods. In numerical method there always be a scope to occur errors and hence it is important to understand the source, propagation, magnitude, and rate of growth of these errors. To solve a problem with the help of computer, a special method is required and this method is known as numerical method. Analytical methods are not suitable to solve a problem by computer. Thus, the numerical methods are highly appreciated and extensively used by scientists and engineers. Let us discuss sources of error.. Sources of error It is well known that the solution of a problem obtained by numerical method contains some errors. But, our intension is to minimize the error. To minimize it, the most essential thing is to identify the causes or sources of the error. Three sources of errors, viz. inherent errors, round-off errors and truncation errors occur to find a solution of a problem by using numerical method. They are discussed below. (i) Inherent errors: These type of errors occur due to the simplified assumptions made during mathematical modelling of the problem. These errors also occur when the data is obtained from certain physical measurements of the parameters of the proposed problem. (ii) Round-off errors: Generally, the numerical methods are performed using computer. In numerical computation, all the numbers are represented as decimal fraction. Again, a computer can store finite number of digits for a number. Some numbers viz. /3, /6, /7 etc. can not be represented by decimal fraction in finite numbers of digits.

............................................. Errors in Numerical Computations Thus, to represent these numbers some digits must be discarded and hence the numbers should be rounded-off into some finite number of digits. So in arithmetic computation, some errors will occur due to the finite representation of the numbers; these errors are called round-off errors. These errors depend on the word length of the used computer. (iii) Truncation errors: These errors occur due to the finite representation of an inherently infinite process. These types of errors are explained by an example. Let us consider the cosine series. The Taylor s series expansion of cos x is cos x = x2 2! + x4 4! x6 6! +. This is well known that this series s infinite. If we consider the first five terms to calculate the value of cos x for a given x, then we obtained an approximate value. The error occurs due to the truncation of the remaining terms of the series and it is called the truncation of error. Note that the truncation error is independent of the computational machine..2 Exact and approximate numbers In numerical computation, a number is consider as either exact or approximate value of a solution of a problem. Exact number represents the true value of a result while the approximate number represents the value which is closed to the true value. For example, in the statements a book has 34 pages, the population of a locality is 5000 the numbers 34, 5000 are exact numbers. But, in the assertions the time taken to fly from Kolkata to New Delhi is 2 hrs, the number of leaves of a mango tree is 50000, the numbers 2 and 50000 are approximate numbers, as time to fly from Kolkata to New Delhi is approximately 2 hrs and similarly, the number of leaves of the tree is approximately 50000, because it is not possible to count exact number of leaves of a big tree. These approximations are coming either from the imperfection of measuring instruments or the measurement depends on other parameters. There are no absolutely exact measuring instruments; each of them has its own accuracy. 2

...................................................................................... It may be noted that same number may be exact as well as approximate. For example, the number 3 is exact when it represents the number of rooms of a house and approximate when it represents the number π. The accuracy of a solution is defined in terms of number of digits used in the computation. The significant digits or significant figures of a number are all its digits, except for zeros which appear to the left of the first non-zero digit. But, the zeros at the end of a number are always significant digit. The numbers 0.000342 and 892.2300 have 3 and 8 significant digits respectively. Some times we need to cut off usable digits. The number of digits to be cut off depends on the problem. This process to cut off digits from a number is called rounding-off of numbers. That is, in rounding process the number is approximated to a very close number consisting of a smaller number of digits. In that case, one or more digits are kept with the number, taken from left to right, and all other digits are discarded. Rules of rounding-off (i) If the discarded digits constitute a number which is larger than half the unit in the last decimal place that remains, then the last digit that is left is increased by one. If the discarded digits constitute a number which is smaller than half the unit in the last decimal place that remains, then the digits that remain do not change. (ii) If the discarded digits constitute a number which is equal to half the unit in the last decimal place that remains, then the last digit that is half is increased by one, if it is odd, and is unchanged if it is even. This rule is often called a rule of an even digit. In Table., we consider different cases to illustrate the round-off process. In this table the numbers are rounded-off to the six significant figures. But, computer kept more number of digits during round-off. It depends on the computer and the type of the number declared in a programming language. Note that the round-off numbers contain errors and this errors are called round-off errors. 3

............................................. Errors in Numerical Computations Exact number Round-off number to six significant figures 26.023728 26.024 (added in the last digit) 23.243265 23.243 (last digit remains unchanged) 30.455354 30.4554 (added in the last digit) 9.652456 9.6525 (added in the last digit) 26.3545 26.344 (last digit remains unchanged) 34.4275 34.4280 (added in the last digit to make even digit) 8.999996 9.00000 (added in the last digit) 9.999997 0.0000 (added in the last digit) 0.0023456573 0.00234566 (added in the last digit) 6.237 6.23700 (added two 0 s to make six figures) 6754259 675422 0 2 (integer is rounded to six digits) Table.: Different cases of round-off numbers.3 Absolute, relative and percentage errors Let x A be the approximate value of the exact number X T. The difference between the exact value x T and its approximate value x A is an error. But, by principle it is not possible to determine the value of the error x T x A and even its sign, when the exact number x T is unknown. The errors are designated as absolute error, relative error and percentage error. Absolute error: Let x A be the approximate value of the exact number x T. Then the absolute error is denoted by ( x) and satisfies the relation x x T x A. Note that the absolute error is the upper bound of the difference between x T and x A. This definition is applicable when there are many approximate values of the exact number x T. Otherwise, x = x T x A. 4

...................................................................................... Also, the exact value x T lies between x A x and x A + x. It can be written as x T = x A ± x. (.) The upper bound of the absolute error is absolute error 2 0 m, (.2) when the number is rounded to m decimal places. Note that the absolute error measures the total error and hence this error measures only the quantitative side of the error. It does not measure the qualitative, i.e. how much the measurement is accurate. For example, the length and the width of a pond are determined by a tape in meter. Suppose that width w = 50 ± 2 m and the length l = 250 ± 2 m. In both the measurements the absolute error is 2 m, but it is obvious that the second measure is more accurate. To determine the quality of measurements, we introduced a new concept called relative error. Relative error: The relative error is denoted by δx and is defined by δx = x x A or This expression can also be written as x x T, x T 0 and x A 0. x T = x A ( ± δx) or x A = x T ( ± δx). Note that the absolute error is the total error when whole thing is measured, while relative error is the error when we measure unit. That is, the relative error is the error per unit measurement. In case of above example, the relative errors are δw = 2 50 0.008. Thus, the second measurement is more accurate. = 0.04 and δl = 2 250 = In general, the relative error measures the quantity of error and quality of the measurement. Thus, the relative error is a better measurement of error than absolute error. Percentage error: The relative error is measured in unit scale while the percentage error is measured 5

............................................. Errors in Numerical Computations in 00 unit scale. The percentage error is measured by δx 00%. This error is sometimes called relative percentage error. Percentage error measures both the quantity and quality. Generally, when relative error is very small then the percentage error is determined. Note that the relative and percentage errors are free from the unit of measurement, while absolute error depends on the measuring unit. Example x A = 0.429.. Find the absolute, relative and percentage error in x A when x T = 7 and Solution. The absolute error x = x T x A = 7 0.429 =.0003 7 = 0.0003 = 0.000043 rounding up to two significant figures. 7 The relative error δx = x = 0.000043 = 0.000329 0.0003. x T /7 The percentage error is δx 00% = 0.0003 00% 0.03%. Example.2 Find the absolute error and the exact number corresponding to the approximate number x A = 7.543. Assume that the percentage error is 0.%. Solution. The relative error is δx = 0.% = 0.00. Therefore, the absolute error is x = x A δx = 7.543 0.00 = 0.007543 0.0075. Thus, the exact value is = 7.543 ± 0.0075. Example.3 Suppose two exact numbers and their approximate values are given by Find out which approximation is better. x T = 7 9 0.8947 and y T = 7 8.426. Solution. To find the absolute error, we take the numbers x A and y A with a larger number of decimal digits as x A 0.894736, y A = 7 8.42649. Therefore, the absolute error in x T is x = 0.894736 0.8947 0.000036, and y = 8.42649 8.426 0.000049. 6

...................................................................................... Thus, δx = 0.000036/0.8947 0.000040 = 0.0040% δy = 0.000049/8.426 = 0.0000058 = 0.00058%. The percentage error in second case is 0.00058 while in first case it is 0.0040. Thus the second measurement is more better than the first one..4 Valid significant digits A decimal integer can be represented in many ways. For example, the number 7600000 can be written as 760 0 4 or 76.0 0 5 or 0.7600000 0 7. Note that each number has two parts, the first part is called mantissa and second part is called exponent. In last form, the mantissa is a proper fraction and first digit after decimal point is non-zero. This form is known as normalize form and it is commonly used in computer. Every positive decimal number a can be expressed as a = d 0 m + d 2 0 m + + d n 0 m n+ +, where d i are the digits constituting the number (i =, 2,...). The digit d 0 and 0 m i+ is the value of the ith decimal place starting from left. Let d n be the nth digit of the approximate number x. This digit is called valid significant digit (or simply a valid digit) if it satisfies the following condition x 0.5 0 m n+. (.3) If the inequality of (.3) does not satisfied, the digit d n is said to be doubtful. If d n is a valid digit then all the digits preceding to d n are also valid. Theorem. If a number is correct up to n significant figures and the first significant digit is k, then the relative error is less than k 0 n. Proof. Let x A and x T be the approximate and exact values. Also, assume that x A is correct up to n significant figures and m decimal places. There are three cases arise: (i) m < n (ii) m = n and (iii) m > n. 7

............................................. Errors in Numerical Computations From (.2) it is known that the absolute error x 0.5 0 m. (i) When m < n. In this case, the total number of digits in integral part is n m. Let k be the first significant digit in x T. Therefore, Thus, the relative error x 0.5 0 m and x T k 0 n m 0.5 0 m. δx = x x T 0.5 0 m k 0 n m 0.5 0 m = 2k 0 n. Since, n is a positive integer and k is an integer lies between and 9, for all k and n except k = n =. Hence, (ii) When m = n. 2k 0 n > k 0 n δx < k 0 n. In this case, the first significant digit is same as first digit after decimal point, i.e. the number is proper fraction. As in previous case, (iii) When m > n. 0.5 0 m δx = k 0 n m 0.5 0 m = 2k 0 n < k 0 n. In this case, the first significant digit k is at the (n m+) = (m n )th position and the integer part is zero. Then x 0.5 0 m and x T k 0 (m n+) 0.5 0 m. Thus, Hence the theorem. 8 0.5 0 m δx = k 0 (m n+) 0.5 0 m = 2k 0 n < k 0 n.