Numerical Analysis. Yutian LI. 2018/19 Term 1 CUHKSZ. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41

Size: px
Start display at page:

Download "Numerical Analysis. Yutian LI. 2018/19 Term 1 CUHKSZ. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41"

Transcription

1 Numerical Analysis Yutian LI CUHKSZ 2018/19 Term 1 Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41

2 Reference Books BF R. L. Burden and J. D. Faires, Numerical Analysis, 9th edition, Thomsom Brooks/Cole, At K. E. Atkinson, An Introduction to Numerical Analysis, 2nd edition, John Wiley, DMN D. Kahaner, C. Moler and S. Nash, Numerical Methods and Software, Prentice-Hall, St G. W. Stewart, Afternotes on Numerical Analysis, SIAM, Software Matlab Python Julia Yutian LI (CUHKSZ) Numerical Analysis 2018/19 2 / 41

3 Contents 1 Introduction 2 Nonlinear Equations 3 Interpolation 4 Numerical Integration 5 Numerical Differentiation 6 Linear System of Equations Yutian LI (CUHKSZ) Numerical Analysis 2018/19 3 / 41

4 Chapter 1: Introduction 1 Overview & Motivation 2 Computational Errors 3 Computer Arithmetic 4 Convergence and Stability 5 Some basic algorithms and Matlab codes Yutian LI (CUHKSZ) Numerical Analysis 2018/19 4 / 41

5 Overview & Motivation 1. Solve Nonlinear Equations (Chapter 2) The LambertW function is the inverse function of fpwq we w : that is z : wpzqe wpzq. One needs to solve a nonlinear equation to find the value of wpzq. e.g., to fnid wp1q, we need solve we w 1. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 5 / 41

6 2. Interpolation (Chapter 3) (a) piecewise linear function (b) polynomials Yutian LI (CUHKSZ) Numerical Analysis 2018/19 6 / 41

7 3. Numerical Integration (Chapter 4) The c.d.f. (cumulative distribution function) of the standard normal distribution is given by Npxq? 1» x e t2 1 2 dt 2π 8 2» 1 x? e t2 2 dt 2π 0 To find the (approximate) values of Npxq, we need perform a numerical method to evaluate the above integral. This is the quadrature rules. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 7 / 41

8 4. Solve linear system (Chapter 5) In solving the application problems, the last step is often to find the solution of a linear system of equations AX b. (e.g., when we use finite difference or finite element methods to solve a differential equation) When A is large, it is necessary to use some numerical method and to solve it on a computer. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 8 / 41

9 5. Least squares Figure: The result of fitting a set of data points with a quadratic function Yutian LI (CUHKSZ) Numerical Analysis 2018/19 9 / 41

10 Computational Errors Truncation error the error made by numerical algorithms that arises from taking finite number of steps in computation. Round-off error the error produced when a computer is used to perform real number calculations. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 10 / 41

11 Truncation error: Consider Taylor s theorem fpxq P n pxq R n pxq, where P n pxq f px 0 q f 1 px 0 qpx x 0 q R n pxq f pn 1q pξq pn 1q! px x 0q n 1. f 2 px 0 q px x 0 q 2 2! f pnq px 0 q px x 0 q n, n! If we use P n pxq to approximate fpxq, the error R n pxq is called the truncation error. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 11 / 41

12 Round-off error: In the computational world, each representable number has only a fixed and finite number of digits. Only a small subset of the real number can be represented in a typical computer So for example, 1{3, π,? 2, these numbers cannot be represented exactly in the computation by a computer. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 12 / 41

13 Round-Off Error Can Be Fatal. On February 25, 1991 an Iraqi Scud missle hit an American Army barracks and killed 28 soldiers. The Patriot Missle System that was supposed to intercept and destroy the Scud failed. The General Accounting Office report, GAO/IMTEC-92-26, Patriot Missile Defense: Software Problem Led to System Failure at Dhahran, Saudi Arabia gave the reason as round-off error. See When we do computations using computers, the round-off errors are inevitable. But we can try to minimize the negative impact of these errors by rewriting the formula you wish to compute. This must be done on a case-by-case basis. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 13 / 41

14 Computer Arithmetic Binary Floating Point Number. In 1985, the IEEE (Institute for Electrical and Electronic Engineers) published a report called Binary Floating Point Arithmetic Standard An updated version was published in 2008 as IEEE A 64-bit (binary digit) representation is used for a real number. The first bit is a sign indicator, denoted s. This is followed by an 11-bit exponent, c, called the characteristic, and a 52-bit binary fraction, f, called the mantissa. The base for the exponent is 2. p 1q s 2 c 1023 p1 fq Yutian LI (CUHKSZ) Numerical Analysis 2018/19 14 / 41

15 e.g., s 0, c , f and the machine number precisely represents the decimal number p 1q s 2 c 1023 p1 fq Numbers occurring in calculations that have a magnitude less than p1 0q result in underflow and are generally set to zero. Numbers greater than p q result in overflow and typically cause the computations to stop. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 15 / 41

16 Decimal floating-point number 0.d 1 d 2 d k 10 n, 1 d 1 9, 0 d 2, d 3 9. Any positive real number within the numerical range of the machine can be normalized to the form y 0.d 1 d 2 d k d k 1 d k 2 10 n. The floating-point form of y, denoted f lpyq, is obtained by terminating the mantissa of y at k decimal digits. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 16 / 41

17 There are two common ways of performing this termination Chopping: simply chops off the digits d k 1 d k 2 This produces the floating-point form flpyq 0.d 1 d 2 d k 10 n. Rounding: adds 5 10 n pk 1q to y and then chops the result to obtain a number of the form flpyq 0.δ 1 δ 2 δ k 10 n. For rounding, when d k 1 5, we add 1 to d k to obtain flpyq; that is, we round up. When d k 1 5, we simply chop off all but the first k digits; that is, round down. The error that results from replacing a number with its floating-point form is called round-off error regardless of whether the rounding or the chopping method is used. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 17 / 41

18 Example Determine the five-digit (a) chopping and (b) rounding values of π. The number π has an infinite decimal expansion of the form π Written in normalized decimal form, we have π The floating-point form of π using five-digit chopping is flpπq Since the sixth digit of the decimal expansion of π is a 9, the floating-point of π using five-digit rounding is flpπq p q Yutian LI (CUHKSZ) Numerical Analysis 2018/19 18 / 41

19 Definition Suppose that p is an approximation to p. The actual error is p p, the absolute error is p p, and the relative error is p p p, provided that p 0. Definition The number p is said to approximate p to t significant digits (or figures) if t is the largest nonnegative integer for which p p p 5 10 t. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 19 / 41

20 Example Determine the actual, absolute, and relative errors when approximating p by p when (a) p and p ; (b) p and p ; (c) p and p As a measure of accuracy, the absolute error can be misleading and the relative error more meaningful because the relative error takes into consideration the size of the value. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 20 / 41

21 Inaccurate representation of numbers. We see that the floating-point representation flpyq for the number y has the relative error y flpyq y. If k decimal digits and chopping are used for the machine representation of y 0.d 1 d 2 d k d k 1 10 n, then y flpyq y 0.d k 1 d k 2 10 n k 0.d 1 d 2 10 n k 10 k 1. In a similar manner, a bound for the relative error when using k-digit rounding arithmetic is k 1. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 21 / 41

22 Inaccurate calculation. Assume that the floating-point representations f lpxq and f lpyq are given for the real numbers x and y and that the symbols `, a, b, c represent machine addition, substraction, multiplication and division operations, respectively. We will assume a finite-digit arithmetic given by x ` y flpflpxq flpyqq, x a y flpflpxq flpyqq, x b y flpflpxq flpyqq, x c y flpflpxq flpyqq. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 22 / 41

23 Example Suppose x 5 7 and y 1 3 x and y. we want to do arithmetic calculations involving x , y Five-digit chopping x ` y flpflpxq flpyqq flp q flp q Five-digit rounding x ` y flpflpxq flpyqq flp q flp q Yutian LI (CUHKSZ) Numerical Analysis 2018/19 23 / 41

24 Absolute Error , Relative Error , Yutian LI (CUHKSZ) Numerical Analysis 2018/19 24 / 41

25 How to avoid loss of accuracy due to round-off error? Reformulate the problem. One of the most common error producing calculations involves the cancelation of significant digits due to subtraction of nearly equal numbers. So we should reformulate the problem to avoid subtracting nearly equal numbers. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 25 / 41

26 Example The two roots of ax 2 bx c 0 are given by x 1 b? b 2 4ac 2a, x 2 b? b 2 4ac, 2a Consider the equation x x 1 0. The two roots are x , x In this equation, b 2 is much larger than 4ac, so the numerator of x 1 is a subtraction of two nearly equal numbers. Use 4-digit rounding we get flpx 1 q Yutian LI (CUHKSZ) Numerical Analysis 2018/19 26 / 41

27 which is a poor approximation to x 1 with the large relative error To improve the accuracy of the calculation, we change the formula by rationalizing the numerator, x 1 b Using this we get? b 2 4ac b? b 2 4ac 2a b? b 2 4ac 2c? b b 2 4ac. flpx 1 q , which has the small relative error Yutian LI (CUHKSZ) Numerical Analysis 2018/19 27 / 41

28 Rewrite polynomials into nested form. Example Evaluate fpxq x 3 6.1x 2 3.2x 1.5 for x Using 3-digit arithmetic we have, x x 2 x 3 6.1x 2 3.2x Result Relative error Exact Chopping Rounding Yutian LI (CUHKSZ) Numerical Analysis 2018/19 28 / 41

29 In both cases, large relative errors occur. To improve the calculation, we change the polynomial to the following nested form, fpxq x 3 6.1x 2 3.2x 1.5 ppx 6.1qx 3.2qx 1.5 Then using chopping we have f p4.71q pp q q The relative error is Yutian LI (CUHKSZ) Numerical Analysis 2018/19 29 / 41

30 Using rounding we have f p4.71q pp q q The relative error is Polynomials should always be expressed in nested form before performing an evaluation, because this form minimized the number of arithmetic calculations. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 30 / 41

31 Avoid large numbers eat small numbers. We should add those numbers with small magnitude first when we do the summation Example fl ņ i1 flpx i q x and x i 0.01, i 2,, 101, using 4-digit arithmetic, we have flpx 1 q and flpx i q , i 2,, 101. So after doing the summation s 101 flp i1 flpx iqq, we have s If we define x i 0.01, i 1,, 100 and x , then we have s which is the true value of the summation.. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 31 / 41

32 Convergence and Stability Convergence Definition Suppose tβ n u 8 n1 is a sequence known to converge to zero, and tα nu 8 n1 converges to a number α. If a positive constant K exists with α n α K β n for large n, then we say that tα n u 8 n1 converges to α with the rate (or, order) of convergence Opβ n q (big oh of β n ), and written as α n α Opβ n q. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 32 / 41

33 In most cases, β n 1{n p, (p 0), so we have α n α Op1{n p q Similarly, if a function F phq satisfies F phq L Kh p for small positive h, we write F phq L Oph p q. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 33 / 41

34 Stability. If small changes in the initial data produce correspondingly small changes in the final results, then we say that the algorithm is stable. Otherwise, the algorithm is said unstable. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 34 / 41

35 Example The solution of the recursive equation is p n 10 3 p n 1 p n 2, n 2, 3, p n c n c 2 3 n. If p 0 1 and p 1 1{3, we have c 1 1 and c 2 0, then p n p1{3q n. If we use 5 digit rounding to compute p n, then the computed sequence ˆp , ˆp , which corresponding to ĉ and ĉ , and 1 n ˆp n n. 3 The round-off error is p n ˆp n p3 n q This error grows exponentially, so the algorithm is unstable. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 35 / 41

36 Example The solution of the recursive equation p n 3 4 p n p n 2, n 2, 3, is p n c n 1 n c 2. 4 If the computed values for c 1 and c 2 are ĉ 1 and ĉ 2, due to round-off errors, then we have the round-off error in computing p n is p n ˆp n 1 n 1 n pc 1 ĉ 1 q pc 2 ĉ 2 q c 1 ĉ 1 1 c 2 ĉ Small changes in the initial errors c 1 ĉ 1 and c 2 ĉ 2 will result in a small change in p n ˆp n, the algorithm is stable. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 36 / 41

37 Relation between convergence and stability. The concept of convergence is about the theoretical errors (truncation errors) between the exact value and the true value of an algorithm. The concept of stability is about the computational errors (round-off error) between the true value of an algorithm and the computed value from the algorithm. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 37 / 41

38 Consider the algorithm p n 10 3 p n 1 p n 2, n 2, 3, When p 0 1 and p 1 1{3, we have p n p1{3q n. Clearly, However, for the computed value lim p n 0. nñ8 lim ˆp n 8. nñ8 Yutian LI (CUHKSZ) Numerical Analysis 2018/19 38 / 41

39 Some basic algorithms and Matlab codes Sum n i1 x i s = 0; % initialize for i = 1 : n s = s + x(i); % A common mistake is forget the s here! end Or we can use Matlab command sum(x). Yutian LI (CUHKSZ) Numerical Analysis 2018/19 39 / 41

40 Product ± n i1 x i s = 0; % initialize for i = 1 : n s = s * x(i); % A common mistake is forget the s here! end Or we can use Matlab command prod(x). Yutian LI (CUHKSZ) Numerical Analysis 2018/19 40 / 41

41 Matrix-vector multiplication y A x for i = 1 : n y(i) = 0; % initialize for j = 1 : n y(i) = y(i)+a(i, j) x(j); end end % Use ; to compress the outputs. Or we can use Matlab command y = A*x. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 41 / 41

Mathematical preliminaries and error analysis

Mathematical preliminaries and error analysis Mathematical preliminaries and error analysis Tsung-Ming Huang Department of Mathematics National Taiwan Normal University, Taiwan September 12, 2015 Outline 1 Round-off errors and computer arithmetic

More information

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

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic Computer Arithmetic MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Machine Numbers When performing arithmetic on a computer (laptop, desktop, mainframe, cell phone,

More information

Notes for Chapter 1 of. Scientific Computing with Case Studies

Notes for Chapter 1 of. Scientific Computing with Case Studies Notes for Chapter 1 of Scientific Computing with Case Studies Dianne P. O Leary SIAM Press, 2008 Mathematical modeling Computer arithmetic Errors 1999-2008 Dianne P. O'Leary 1 Arithmetic and Error What

More information

Chapter 1 Mathematical Preliminaries and Error Analysis

Chapter 1 Mathematical Preliminaries and Error Analysis Numerical Analysis (Math 3313) 2019-2018 Chapter 1 Mathematical Preliminaries and Error Analysis Intended learning outcomes: Upon successful completion of this chapter, a student will be able to (1) list

More information

Round-off Errors and Computer Arithmetic - (1.2)

Round-off Errors and Computer Arithmetic - (1.2) Round-off Errors and Comuter Arithmetic - (.). Round-off Errors: Round-off errors is roduced when a calculator or comuter is used to erform real number calculations. That is because the arithmetic erformed

More information

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

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le Floating Point Number Systems Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le 1 Overview Real number system Examples Absolute and relative errors Floating point numbers Roundoff

More information

Can You Count on Your Computer?

Can You Count on Your Computer? Can You Count on Your Computer? Professor Nick Higham School of Mathematics University of Manchester higham@ma.man.ac.uk http://www.ma.man.ac.uk/~higham/ p. 1/33 p. 2/33 Counting to Six I asked my computer

More information

Chapter 1: Introduction and mathematical preliminaries

Chapter 1: Introduction and mathematical preliminaries Chapter 1: Introduction and mathematical preliminaries Evy Kersalé September 26, 2011 Motivation Most of the mathematical problems you have encountered so far can be solved analytically. However, in real-life,

More information

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

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460 Notes for Part 1 of CMSC 460 Dianne P. O Leary Preliminaries: Mathematical modeling Computer arithmetic Errors 1999-2006 Dianne P. O'Leary 1 Arithmetic and Error What we need to know about error: -- how

More information

Chapter 1 Mathematical Preliminaries and Error Analysis

Chapter 1 Mathematical Preliminaries and Error Analysis Chapter 1 Mathematical Preliminaries and Error Analysis Per-Olof Persson persson@berkeley.edu Department of Mathematics University of California, Berkeley Math 128A Numerical Analysis Limits and Continuity

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Numerical Analysis and Computing

Numerical Analysis and Computing Numerical Analysis and Computing Lecture Notes #02 Calculus Review; Computer Artihmetic and Finite Precision; and Convergence; Joe Mahaffy, mahaffy@math.sdsu.edu Department of Mathematics Dynamical Systems

More information

Floating-point Computation

Floating-point Computation Chapter 2 Floating-point Computation 21 Positional Number System An integer N in a number system of base (or radix) β may be written as N = a n β n + a n 1 β n 1 + + a 1 β + a 0 = P n (β) where a i are

More information

Chapter 1 Computer Arithmetic

Chapter 1 Computer Arithmetic Numerical Analysis (Math 9372) 2017-2016 Chapter 1 Computer Arithmetic 1.1 Introduction Numerical analysis is a way to solve mathematical problems by special procedures which use arithmetic operations

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Chapter 1: Preliminaries and Error Analysis

Chapter 1: Preliminaries and Error Analysis Chapter 1: Error Analysis Peter W. White white@tarleton.edu Department of Tarleton State University Summer 2015 / Numerical Analysis Overview We All Remember Calculus Derivatives: limit definition, sum

More information

Introduction to Scientific Computing Languages

Introduction to Scientific Computing Languages 1 / 19 Introduction to Scientific Computing Languages Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de Numerical Representation 2 / 19 Numbers 123 = (first 40 digits) 29 4.241379310344827586206896551724137931034...

More information

Notes on floating point number, numerical computations and pitfalls

Notes on floating point number, numerical computations and pitfalls Notes on floating point number, numerical computations and pitfalls November 6, 212 1 Floating point numbers An n-digit floating point number in base β has the form x = ±(.d 1 d 2 d n ) β β e where.d 1

More information

Introduction to Scientific Computing Languages

Introduction to Scientific Computing Languages 1 / 21 Introduction to Scientific Computing Languages Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de Numerical Representation 2 / 21 Numbers 123 = (first 40 digits) 29 4.241379310344827586206896551724137931034...

More information

Numerical Methods - Lecture 2. Numerical Methods. Lecture 2. Analysis of errors in numerical methods

Numerical Methods - Lecture 2. Numerical Methods. Lecture 2. Analysis of errors in numerical methods Numerical Methods - Lecture 1 Numerical Methods Lecture. Analysis o errors in numerical methods Numerical Methods - Lecture Why represent numbers in loating point ormat? Eample 1. How a number 56.78 can

More information

Lecture 7. Floating point arithmetic and stability

Lecture 7. Floating point arithmetic and stability Lecture 7 Floating point arithmetic and stability 2.5 Machine representation of numbers Scientific notation: 23 }{{} }{{} } 3.14159265 {{} }{{} 10 sign mantissa base exponent (significand) s m β e A floating

More information

Introduction CSE 541

Introduction CSE 541 Introduction CSE 541 1 Numerical methods Solving scientific/engineering problems using computers. Root finding, Chapter 3 Polynomial Interpolation, Chapter 4 Differentiation, Chapter 4 Integration, Chapters

More information

Introduction and mathematical preliminaries

Introduction and mathematical preliminaries Chapter Introduction and mathematical preliminaries Contents. Motivation..................................2 Finite-digit arithmetic.......................... 2.3 Errors in numerical calculations.....................

More information

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Jim Lambers MAT 610 Summer Session Lecture 2 Notes Jim Lambers MAT 610 Summer Session 2009-10 Lecture 2 Notes These notes correspond to Sections 2.2-2.4 in the text. Vector Norms Given vectors x and y of length one, which are simply scalars x and y, the

More information

Chapter 1 Error Analysis

Chapter 1 Error Analysis Chapter 1 Error Analysis Several sources of errors are important for numerical data processing: Experimental uncertainty: Input data from an experiment have a limited precision. Instead of the vector of

More information

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

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science EAD 115 Numerical Solution of Engineering and Scientific Problems David M. Rocke Department of Applied Science Computer Representation of Numbers Counting numbers (unsigned integers) are the numbers 0,

More information

Math 411 Preliminaries

Math 411 Preliminaries Math 411 Preliminaries Provide a list of preliminary vocabulary and concepts Preliminary Basic Netwon s method, Taylor series expansion (for single and multiple variables), Eigenvalue, Eigenvector, Vector

More information

1 ERROR ANALYSIS IN COMPUTATION

1 ERROR ANALYSIS IN COMPUTATION 1 ERROR ANALYSIS IN COMPUTATION 1.2 Round-Off Errors & Computer Arithmetic (a) Computer Representation of Numbers Two types: integer mode (not used in MATLAB) floating-point mode x R ˆx F(β, t, l, u),

More information

Mathematics for Engineers. Numerical mathematics

Mathematics for Engineers. Numerical mathematics Mathematics for Engineers Numerical mathematics Integers Determine the largest representable integer with the intmax command. intmax ans = int32 2147483647 2147483647+1 ans = 2.1475e+09 Remark The set

More information

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

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Introduction to Numerical Analysis

Introduction to Numerical Analysis Introduction to Numerical Analysis Lecture Notes for SI 507 Authors: S. Baskar and S. Sivaji Ganesh Department of Mathematics Indian Institute of Technology Bombay Powai, Mumbai 400 076. Contents 1 Mathematical

More information

Semester Review Packet

Semester Review Packet MATH 110: College Algebra Instructor: Reyes Semester Review Packet Remarks: This semester we have made a very detailed study of four classes of functions: Polynomial functions Linear Quadratic Higher degree

More information

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1 Tu: 9/3/13 Math 71, Fall 2013, Section 001 Lecture 1 1 Course intro Notes : Take attendance. Instructor introduction. Handout : Course description. Note the exam days (and don t be absent). Bookmark the

More information

Introductory Numerical Analysis

Introductory Numerical Analysis Introductory Numerical Analysis Lecture Notes December 16, 017 Contents 1 Introduction to 1 11 Floating Point Numbers 1 1 Computational Errors 13 Algorithm 3 14 Calculus Review 3 Root Finding 5 1 Bisection

More information

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b.

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b. CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5 GENE H GOLUB Suppose we want to solve We actually have an approximation ξ such that 1 Perturbation Theory Ax = b x = ξ + e The question is, how

More information

Introduction to Numerical Analysis

Introduction to Numerical Analysis Introduction to Numerical Analysis S. Baskar and S. Sivaji Ganesh Department of Mathematics Indian Institute of Technology Bombay Powai, Mumbai 400 076. Introduction to Numerical Analysis Lecture Notes

More information

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

Numerical Methods. Dr Dana Mackey. School of Mathematical Sciences Room A305 A   Dana Mackey (DIT) Numerical Methods 1 / 12 Numerical Methods Dr Dana Mackey School of Mathematical Sciences Room A305 A Email: Dana.Mackey@dit.ie Dana Mackey (DIT) Numerical Methods 1 / 12 Practical Information The typed notes will be available

More information

Numerical Methods in Physics and Astrophysics

Numerical Methods in Physics and Astrophysics Kostas Kokkotas 2 November 6, 2007 2 kostas.kokkotas@uni-tuebingen.de http://www.tat.physik.uni-tuebingen.de/kokkotas Kostas Kokkotas 3 Error Analysis Definition : Suppose that x is an approximation to

More information

Root Finding For NonLinear Equations Bisection Method

Root Finding For NonLinear Equations Bisection Method Root Finding For NonLinear Equations Bisection Method P. Sam Johnson November 17, 2014 P. Sam Johnson (NITK) Root Finding For NonLinear Equations Bisection MethodNovember 17, 2014 1 / 26 Introduction The

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors Roundoff errors and floating-point arithmetic

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors 3-1 Roundoff errors and floating-point arithmetic

More information

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

Compute the behavior of reality even if it is impossible to observe the processes (for example a black hole in astrophysics). 1 Introduction Read sections 1.1, 1.2.1 1.2.4, 1.2.6, 1.3.8, 1.3.9, 1.4. Review questions 1.1 1.6, 1.12 1.21, 1.37. The subject of Scientific Computing is to simulate the reality. Simulation is the representation

More information

Parent Guide. Number System. Diocese of Cleveland

Parent Guide. Number System. Diocese of Cleveland Parent Guide Grade Eight Algebra Curriculum Diocese of Cleveland Below is a list of skills your child will be taught in Grade Eight Algebra. As parents, you are encouraged to support the work of your child

More information

MAT 460: Numerical Analysis I. James V. Lambers

MAT 460: Numerical Analysis I. James V. Lambers MAT 460: Numerical Analysis I James V. Lambers January 31, 2013 2 Contents 1 Mathematical Preliminaries and Error Analysis 7 1.1 Introduction............................ 7 1.1.1 Error Analysis......................

More information

INTRODUCTION TO COMPUTATIONAL MATHEMATICS

INTRODUCTION TO COMPUTATIONAL MATHEMATICS INTRODUCTION TO COMPUTATIONAL MATHEMATICS Course Notes for CM 271 / AMATH 341 / CS 371 Fall 2007 Instructor: Prof. Justin Wan School of Computer Science University of Waterloo Course notes by Prof. Hans

More information

Numerical Mathematical Analysis

Numerical Mathematical Analysis Numerical Mathematical Analysis Numerical Mathematical Analysis Catalin Trenchea Department of Mathematics University of Pittsburgh September 20, 2010 Numerical Mathematical Analysis Math 1070 Numerical

More information

Numerical Algorithms. IE 496 Lecture 20

Numerical Algorithms. IE 496 Lecture 20 Numerical Algorithms IE 496 Lecture 20 Reading for This Lecture Primary Miller and Boxer, Pages 124-128 Forsythe and Mohler, Sections 1 and 2 Numerical Algorithms Numerical Analysis So far, we have looked

More information

MATH ASSIGNMENT 03 SOLUTIONS

MATH ASSIGNMENT 03 SOLUTIONS MATH444.0 ASSIGNMENT 03 SOLUTIONS 4.3 Newton s method can be used to compute reciprocals, without division. To compute /R, let fx) = x R so that fx) = 0 when x = /R. Write down the Newton iteration for

More information

Lecture Notes 7, Math/Comp 128, Math 250

Lecture Notes 7, Math/Comp 128, Math 250 Lecture Notes 7, Math/Comp 128, Math 250 Misha Kilmer Tufts University October 23, 2005 Floating Point Arithmetic We talked last time about how the computer represents floating point numbers. In a floating

More information

Numerical Methods - Preliminaries

Numerical Methods - Preliminaries Numerical Methods - Preliminaries Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Preliminaries 2013 1 / 58 Table of Contents 1 Introduction to Numerical Methods Numerical

More information

2. Review of Calculus Notation. C(X) all functions continuous on the set X. C[a, b] all functions continuous on the interval [a, b].

2. Review of Calculus Notation. C(X) all functions continuous on the set X. C[a, b] all functions continuous on the interval [a, b]. CHAPTER Mathematical Preliminaries and Error Analysis. Review of Calculus Notation. C(X) all functions continuous on the set X. C[a, b] all functions continuous on the interval [a, b]. C n(x) all functions

More information

Essential Mathematics

Essential Mathematics Appendix B 1211 Appendix B Essential Mathematics Exponential Arithmetic Exponential notation is used to express very large and very small numbers as a product of two numbers. The first number of the product,

More information

Chapter 4 Number Representations

Chapter 4 Number Representations Chapter 4 Number Representations SKEE2263 Digital Systems Mun im/ismahani/izam {munim@utm.my,e-izam@utm.my,ismahani@fke.utm.my} February 9, 2016 Table of Contents 1 Fundamentals 2 Signed Numbers 3 Fixed-Point

More information

Tenth Bit Bank Mathematics Real Numbers

Tenth Bit Bank Mathematics Real Numbers Tenth Bit Bank Mathematics Real Numbers 1. The rational number among the following is... i) 4.28 ii) 4.282828... iii) 4.288888... A) i) & ii) B) ii) & iii) C) i) & iii) D) All the above 2. A rational number

More information

NUMERICAL MATHEMATICS & COMPUTING 6th Edition

NUMERICAL MATHEMATICS & COMPUTING 6th Edition NUMERICAL MATHEMATICS & COMPUTING 6th Edition Ward Cheney/David Kincaid c UT Austin Engage Learning: Thomson-Brooks/Cole www.engage.com www.ma.utexas.edu/cna/nmc6 September 1, 2011 2011 1 / 42 1.1 Mathematical

More information

Introduction to Finite Di erence Methods

Introduction to Finite Di erence Methods Introduction to Finite Di erence Methods ME 448/548 Notes Gerald Recktenwald Portland State University Department of Mechanical Engineering gerry@pdx.edu ME 448/548: Introduction to Finite Di erence Approximation

More information

Binary floating point

Binary floating point Binary floating point Notes for 2017-02-03 Why do we study conditioning of problems? One reason is that we may have input data contaminated by noise, resulting in a bad solution even if the intermediate

More information

Math 411 Preliminaries

Math 411 Preliminaries Math 411 Preliminaries Provide a list of preliminary vocabulary and concepts Preliminary Basic Netwon's method, Taylor series expansion (for single and multiple variables), Eigenvalue, Eigenvector, Vector

More information

Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i

Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i 2 = 1 Sometimes we like to think of i = 1 We can treat

More information

Applied Numerical Analysis (AE2220-I) R. Klees and R.P. Dwight

Applied Numerical Analysis (AE2220-I) R. Klees and R.P. Dwight Applied Numerical Analysis (AE0-I) R. Klees and R.P. Dwight February 018 Contents 1 Preliminaries: Motivation, Computer arithmetic, Taylor series 1 1.1 Numerical Analysis Motivation..........................

More information

ALGEBRA+NUMBER THEORY +COMBINATORICS

ALGEBRA+NUMBER THEORY +COMBINATORICS ALGEBRA+NUMBER THEORY +COMBINATORICS COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming

More information

Midterm Review. Igor Yanovsky (Math 151A TA)

Midterm Review. Igor Yanovsky (Math 151A TA) Midterm Review Igor Yanovsky (Math 5A TA) Root-Finding Methods Rootfinding methods are designed to find a zero of a function f, that is, to find a value of x such that f(x) =0 Bisection Method To apply

More information

Introduction to Scientific Computing

Introduction to Scientific Computing (Lecture 2: Machine precision and condition number) B. Rosić, T.Moshagen Institute of Scientific Computing General information :) 13 homeworks (HW) Work in groups of 2 or 3 people Each HW brings maximally

More information

ECS 231 Computer Arithmetic 1 / 27

ECS 231 Computer Arithmetic 1 / 27 ECS 231 Computer Arithmetic 1 / 27 Outline 1 Floating-point numbers and representations 2 Floating-point arithmetic 3 Floating-point error analysis 4 Further reading 2 / 27 Outline 1 Floating-point numbers

More information

1 Floating point arithmetic

1 Floating point arithmetic Introduction to Floating Point Arithmetic Floating point arithmetic Floating point representation (scientific notation) of numbers, for example, takes the following form.346 0 sign fraction base exponent

More information

Lesson 7.1 Polynomial Degree and Finite Differences

Lesson 7.1 Polynomial Degree and Finite Differences Lesson 7.1 Polynomial Degree and Finite Differences 1. Identify the degree of each polynomial. a. 3x 4 2x 3 3x 2 x 7 b. x 1 c. 0.2x 1.x 2 3.2x 3 d. 20 16x 2 20x e. x x 2 x 3 x 4 x f. x 2 6x 2x 6 3x 4 8

More information

Math 471. Numerical methods Introduction

Math 471. Numerical methods Introduction Math 471. Numerical methods Introduction Section 1.1 1.4 of Bradie 1.1 Algorithms Here is an analogy between Numerical Methods and Gastronomy: Calculus, Lin Alg., Diff. eq. Ingredients Algorithm Recipe

More information

Notes: Introduction to Numerical Methods

Notes: Introduction to Numerical Methods Notes: Introduction to Numerical Methods J.C. Chrispell Department of Mathematics Indiana University of Pennsylvania Indiana, PA, 15705, USA E-mail: john.chrispell@iup.edu http://www.math.iup.edu/~jchrispe

More information

Homework and Computer Problems for Math*2130 (W17).

Homework and Computer Problems for Math*2130 (W17). Homework and Computer Problems for Math*2130 (W17). MARCUS R. GARVIE 1 December 21, 2016 1 Department of Mathematics & Statistics, University of Guelph NOTES: These questions are a bare minimum. You should

More information

Lecture 1. Introduction to Numerical Methods. T. Gambill. Department of Computer Science University of Illinois at Urbana-Champaign.

Lecture 1. Introduction to Numerical Methods. T. Gambill. Department of Computer Science University of Illinois at Urbana-Champaign. Lecture 1 Introduction to Numerical Methods T. Gambill Department of Computer Science University of Illinois at Urbana-Champaign June 10, 2013 T. Gambill (UIUC) CS 357 June 10, 2013 1 / 52 Course Info

More information

ACM 106a: Lecture 1 Agenda

ACM 106a: Lecture 1 Agenda 1 ACM 106a: Lecture 1 Agenda Introduction to numerical linear algebra Common problems First examples Inexact computation What is this course about? 2 Typical numerical linear algebra problems Systems of

More information

CHAPTER EIGHT: SOLVING QUADRATIC EQUATIONS Review April 9 Test April 17 The most important equations at this level of mathematics are quadratic

CHAPTER EIGHT: SOLVING QUADRATIC EQUATIONS Review April 9 Test April 17 The most important equations at this level of mathematics are quadratic CHAPTER EIGHT: SOLVING QUADRATIC EQUATIONS Review April 9 Test April 17 The most important equations at this level of mathematics are quadratic equations. They can be solved using a graph, a perfect square,

More information

Romberg Integration and Gaussian Quadrature

Romberg Integration and Gaussian Quadrature Romberg Integration and Gaussian Quadrature P. Sam Johnson October 17, 014 P. Sam Johnson (NITK) Romberg Integration and Gaussian Quadrature October 17, 014 1 / 19 Overview We discuss two methods for integration.

More information

We say that a polynomial is in the standard form if it is written in the order of decreasing exponents of x. Operations on polynomials:

We say that a polynomial is in the standard form if it is written in the order of decreasing exponents of x. Operations on polynomials: R.4 Polynomials in one variable A monomial: an algebraic expression of the form ax n, where a is a real number, x is a variable and n is a nonnegative integer. : x,, 7 A binomial is the sum (or difference)

More information

1 Solutions to selected problems

1 Solutions to selected problems Solutions to selected problems Section., #a,c,d. a. p x = n for i = n : 0 p x = xp x + i end b. z = x, y = x for i = : n y = y + x i z = zy end c. y = (t x ), p t = a for i = : n y = y(t x i ) p t = p

More information

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b) Numerical Methods - PROBLEMS. The Taylor series, about the origin, for log( + x) is x x2 2 + x3 3 x4 4 + Find an upper bound on the magnitude of the truncation error on the interval x.5 when log( + x)

More information

SECTION 9.2: ARITHMETIC SEQUENCES and PARTIAL SUMS

SECTION 9.2: ARITHMETIC SEQUENCES and PARTIAL SUMS (Chapter 9: Discrete Math) 9.11 SECTION 9.2: ARITHMETIC SEQUENCES and PARTIAL SUMS PART A: WHAT IS AN ARITHMETIC SEQUENCE? The following appears to be an example of an arithmetic (stress on the me ) sequence:

More information

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition 1 Appendix A : Numbers, Inequalities, and Absolute Values Sets A set is a collection of objects with an important

More information

Numerical Methods. King Saud University

Numerical Methods. King Saud University Numerical Methods King Saud University Aims In this lecture, we will... Introduce the topic of numerical methods Consider the Error analysis and sources of errors Introduction A numerical method which

More information

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 REVIEW Lecture 1 1. Syllabus, Goals and Objectives 2. Introduction to CFD 3. From mathematical models to numerical simulations (1D Sphere in 1D flow)

More information

Lecture 28 The Main Sources of Error

Lecture 28 The Main Sources of Error Lecture 28 The Main Sources of Error Truncation Error Truncation error is defined as the error caused directly by an approximation method For instance, all numerical integration methods are approximations

More information

How do computers represent numbers?

How do computers represent numbers? How do computers represent numbers? Tips & Tricks Week 1 Topics in Scientific Computing QMUL Semester A 2017/18 1/10 What does digital mean? The term DIGITAL refers to any device that operates on discrete

More information

Chapter P. Prerequisites. Slide P- 1. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter P. Prerequisites. Slide P- 1. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide P- 1 Chapter P Prerequisites 1 P.1 Real Numbers Quick Review 1. List the positive integers between -4 and 4.. List all negative integers greater than -4. 3. Use a calculator to evaluate the expression

More information

MyMathLab for School Precalculus Graphical, Numerical, Algebraic Common Core Edition 2016

MyMathLab for School Precalculus Graphical, Numerical, Algebraic Common Core Edition 2016 A Correlation of MyMathLab for School Precalculus Common Core Edition 2016 to the Tennessee Mathematics Standards Approved July 30, 2010 Bid Category 13-090-10 , Standard 1 Mathematical Processes Course

More information

Chapter Generating Functions

Chapter Generating Functions Chapter 8.1.1-8.1.2. Generating Functions Prof. Tesler Math 184A Fall 2017 Prof. Tesler Ch. 8. Generating Functions Math 184A / Fall 2017 1 / 63 Ordinary Generating Functions (OGF) Let a n (n = 0, 1,...)

More information

QUADRATIC PROGRAMMING?

QUADRATIC PROGRAMMING? QUADRATIC PROGRAMMING? WILLIAM Y. SIT Department of Mathematics, The City College of The City University of New York, New York, NY 10031, USA E-mail: wyscc@cunyvm.cuny.edu This is a talk on how to program

More information

MTH303. Section 1.3: Error Analysis. R.Touma

MTH303. Section 1.3: Error Analysis. R.Touma MTH303 Section 1.3: Error Analysis R.Touma These lecture slides are not enough to understand the topics of the course; they could be used along with the textbook The numerical solution of a mathematical

More information

Homework 2 Foundations of Computational Math 1 Fall 2018

Homework 2 Foundations of Computational Math 1 Fall 2018 Homework 2 Foundations of Computational Math 1 Fall 2018 Note that Problems 2 and 8 have coding in them. Problem 2 is a simple task while Problem 8 is very involved (and has in fact been given as a programming

More information

INTRODUCTION, FOUNDATIONS

INTRODUCTION, FOUNDATIONS 1 INTRODUCTION, FOUNDATIONS ELM1222 Numerical Analysis Some of the contents are adopted from Laurene V. Fausett, Applied Numerical Analysis using MATLAB. Prentice Hall Inc., 1999 2 Today s lecture Information

More information

2. Motivation and Introduction: Numerical Algorithms in CSE Basics and Applications

2. Motivation and Introduction: Numerical Algorithms in CSE Basics and Applications 2. Motivation and Introduction: Numerical Algorithms in CSE Basics and Applications Numerical Programming I (for CSE), Hans-Joachim Bungartz page 1 of 46 What is Numerics? Numerical Mathematics: Part of

More information

3 Polynomial and Rational Functions

3 Polynomial and Rational Functions 3 Polynomial and Rational Functions 3.1 Polynomial Functions and their Graphs So far, we have learned how to graph polynomials of degree 0, 1, and. Degree 0 polynomial functions are things like f(x) =,

More information

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Chapter 1 NUMBER REPRESENTATION, ERROR ANALYSIS 1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Floating-point representation x t,r of a number x: x t,r = m t P cr, where: P - base (the

More information

Accurate polynomial evaluation in floating point arithmetic

Accurate polynomial evaluation in floating point arithmetic in floating point arithmetic Université de Perpignan Via Domitia Laboratoire LP2A Équipe de recherche en Informatique DALI MIMS Seminar, February, 10 th 2006 General motivation Provide numerical algorithms

More information

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS THE REAL NUMBER SYSTEM C O M P E T E N C Y 1 THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS This competency section reviews some of the fundamental

More information

Algebra II with Trig 3 rd Nine Weeks Pacing Guide Grade 11

Algebra II with Trig 3 rd Nine Weeks Pacing Guide Grade 11 2017-2018 Grade 11 Week 1 (1/8-1/12) 6-1, 6-2, 6-3 First Semester Report Cards go home January 10 th Week 2 (1/15-1/19) 6-4, 6-5 24. [A-REI.12T] Solve simple rational and radical equations in one variable,

More information

Solution of Algebric & Transcendental Equations

Solution of Algebric & Transcendental Equations Page15 Solution of Algebric & Transcendental Equations Contents: o Introduction o Evaluation of Polynomials by Horner s Method o Methods of solving non linear equations o Bracketing Methods o Bisection

More information

Mathematics Review. Sid Rudolph

Mathematics Review. Sid Rudolph Physics 2010 Sid Rudolph General Physics Mathematics Review These documents in mathematics are intended as a brief review of operations and methods. Early in this course, you should be totally familiar

More information

The numerical stability of barycentric Lagrange interpolation

The numerical stability of barycentric Lagrange interpolation IMA Journal of Numerical Analysis (2004) 24, 547 556 The numerical stability of barycentric Lagrange interpolation NICHOLAS J. HIGHAM Department of Mathematics, University of Manchester, Manchester M13

More information

1. Motivation and Introduction. Numerical Algorithms in Computer Science Basics and Applications

1. Motivation and Introduction. Numerical Algorithms in Computer Science Basics and Applications 1. Motivation and Introduction Numerical Algorithms in Computer Science Basics and Applications Numerisches Programmieren, Hans-Joachim Bungartz page 1 of 48 What is Numerics? Numerical Mathematics: Part

More information

Analysis of California Mathematics standards to Common Core standards Algebra I

Analysis of California Mathematics standards to Common Core standards Algebra I Analysis of California Mathematics standards to Common Core standards Algebra I CA Math Standard Domain Common Core Standard () Alignment Comments in 1.0 Students identify and use the arithmetic properties

More information