Program 1 Foundations of Computational Math 1 Fall 2018

Size: px
Start display at page:

Download "Program 1 Foundations of Computational Math 1 Fall 2018"

Transcription

1 Program 1 Foundations of Computational Math 1 Fall 2018 Due date: 11:59PM on Friday, 28 September 2018 Written Exercises Problem 1 Consider the summation σ = n ξ i using the following binary fan-in tree algorithm described below for n = 8 but which clearly generalizes easily to n =2 k : or equivalently σ = {[(ξ 0 + ξ 1 )+(ξ 2 + ξ 3 )] + [(ξ 4 + ξ 5 )+(ξ 6 + ξ 7 )]} σ (0) j = ξ j, 0 j 3 σ (1) 0 = ξ 0 + ξ 1, σ (1) 1 = ξ 2 + ξ 3, σ (1) 2 = ξ 4 + ξ 5, σ (1) 3 = ξ 6 + ξ 7 σ (2) 0 = σ (1) 0 + σ (1) 1, σ (2) 1 = σ (1) 2 + σ (1) 3 σ = σ (3) 0 = σ (2) 0 + σ (2) 1 In general, there will be k =logn levels and σ = σ (k) 0. Level i has 2 k i values of σ (i) j, each of which corresponds to a sum σ (i) j = ξ 2j ξ 2j+2 i 1. The algorithm is easily adaptable to n that are not powers of Derive an expression for the absolute forward error of the method for n =2 k Derive an expression for the absolute backward error of the method for n =2 k Bound the errors and discuss stability relative to the simple sequential summation algorithm given by, for n = 8 but easily generalizable to any n, or equivalently σ = (((((((ξ 1 + ξ 2 )+ξ 3 )+ξ 4 )+ξ 5 )+ξ 6 )+ξ 7 )+ξ 8 ) σ = ξ 1 σ σ + ξ i, i =2,...,8 1

2 Problem 2 Most recent machines use a binary base,β = 2, but the number of bits, t, may vary in a floating point system. Suppose you wanted to implement your own routines to determine the number of bits and therefore machine epsilon. The following algorithm is an attempt to determine t experimentally. x =1.5, u =1.0,t =0,α =1.0 while x>α u = u/2 x = α + u t = t +1 end 2.1. Assume that the floating point system has β = 2 and uses a hidden bit normalization. Does this algorithm find t? Does the method of rounding affect your answer? 2.2. Apply the algorithm to a machine that uses β = 2 in single precision and double precision using your code developed for the first part of the problem. Do your observations from the output of the code agree with the IEEE floating point standard for single and double precision floating point numbers information and with the information returned by the epsilon(x) function you implemented for the first part of the problem? 2

3 Programming Exercise Problem 3 An approach to organizing sequential approaches to summation of n numbers ξ i,0 i n 1 that easily facilitates the computation of a running error bound and the constant of unit roundoff u in the a priori bound based on the length of the longest path in the computational graph of the summation approach, i.e., n 1 in the standard recursive summation. We concentrate here on the running bound and summation. A somewhat imprecise form is Algorithm 1 (General Select-Sum-Insert Algorithm): E =0;u =unitroundoff; initialize the set L = {l i } with ξ i,0 i n 1 satisfying constraint 1 i =0 while the termination criteria are not met: if a pair (l, ˆl) satisfying constraint 2 exists then extract l and ˆl from L T i = l + ˆl update running error bound parameter E using T i insert T i into L satisfying constraint 3 else process L and update constraints based on failure to find pair (l, ˆl) end if i i +1 end while perform termination computations; return σ =Σ n 1 i=0 ξ i and running error bound End Algorithm 1 This description may be adapted for particular algorithms of course and the specific constraints involved may influence the choice and implmentation of the data structure for L and its manipulation during extraction, insertion and reorganization of the elements to preserve properties relevant to the constraints. These details are crucial to the efficiency of the implementation. For example, L may be organized as an ordered list to make it easy to find the smallest or largest elements in magnitude. The pair might be constrained to contain a positive and a negative number and L may be organized to facilitate finding such a pair quickly or determining that all remaining elements of the list have the same sign. The processing that results when a pair cannot be found might involve updating the constraints in order to indicate another phase of the algorithm has begun or to force a termination computation. 3

4 The termination criteria might be a simple single criterion such as L = 1 or L = 2, i.e., no pair or a single pair of elements remain. Algorithm 1 can be reduced in complexity if the contraints are simplified. Algorithm 2 is a simple version: Algorithm 2 ( Simple Select-Sum-Insert Algorithm): E =0;u =unitroundoff; initialize the set L = {l i } with ξ i,0 i n 1 i =0 while L 2 extract l and ˆl from L T i = l + ˆl E E + T i insert T i into L i i +1 end while extract (l, ˆl), the last two elements of L; returnσ = l + ˆl and ɛ =(E + σ ) u End Algorithm 2 Note that this is not the accumulation based algorithm that has been analyzed for stability in class: σ σ + ξ for i =0,...,n 1. In Algorithm 2, each pair consists of arbitrary elements of the current version of L. The accumulation based algorithm requires constraining that pair as seen in Algorithm 3: Algorithm 3 (Sequential Accumulation Algorithm): E =0;u =unitroundoff; initialize the set L = {l i } with ξ i,0 i n 1 T 0 =0;insertT 0 into L so that it is easily retrievable. i =0 while L 2 extract T i 1 and l from L where l is a different element than T i 1 T i = T i 1 + l E E + T i insert T i into L so that it is easily retrievable. i i +1 end while extract (T n 1,l), the last two elements of L; returnσ = T n 1 + l and ɛ =(E + σ ) u End Algorithm 3 The sum is accumulated by always taking T i 1 as one of the elements in the pair defining T i and l is assumed to be an element of L that is distinct from T i 1 (although they may 4

5 have the same value). This implies that L must be organized so that after computing T i it is inserted in a privileged position and is easily retrieved. This requirement is not as onerous as it sounds. In fact, it is easily done by either keeping T i separate from all other elements of L (as is done in simple code). More generally, however, it can be done by recognizing this as an example of stack-based code. That is, L is organized as a stack a data structure that only allows elements to removed in the reverse order of their insertion. A stack may be implemented in many ways depending on the situation. Algorithm 3 can be modified to accumulate the sum with terms in increasing magnitude order. Algorithm 4 shows this without expressing implementation details of L. Algorithm 4.0 (Sequential Accumulation Increasing Magnitude Order Algorithm): E =0;u =unitroundoff; initialize the set L = {l i } with ξ i,0 i n 1 T 0 =0;insertT 0 into L so that it is easily retrievable. i =0 while L 2 extract (T i 1,l)fromL where l ˆl for any ˆl Lwhere l and all ˆl are different elements than T i 1 T i = l + T i 1 E E + T i insert T i into L so that it is easily retrievable. i i +1 end while extract (T n 1,l), the last two elements of L; returnσ = T n 1 + l and ɛ =(E + σ ) u End Algorithm 4.0 There is, of course, a corresponding verision that uses decreasing magnitude order that will be referred to here as Algorithm 4.1 (Sequential Accumulation Decreasing Magnitude Order Algorithm). Clearly, the details are crucial to the efficient implementation of this form of summation. For any version of summation there must be exactly n 1 T i values produced. The particular ξ i contributing to this summation is dependent on the particular algorithm and implementation. These partial sums yield an error bound that can be used as a running error bound, i.e., one that depends on the specific data and order of operations to improve on the a priori error bound. For each addition we have a computed T i that satisfies ˆT i = l r + l s 1+δ i, δ i <u (1) 5

6 which can be combined to give the error in the computed version of σ =Σ n 1 i=0 ξ i of the form ˆσ = σ + n δ i ˆTi = σ + E n E n u n ˆT i (see, e.g., Higham s text). This clearly motivates the running bound and the magnitude ordering to reduce the error compared to the a priori bound that arises from the loose bound E n (n 1)u n ξ i + O(u 2 ) ˆT i n x j + O(u). j=1 This motivates an increasing magnitude order of the Select-Sum-Insert algorithm, given as Algorithm 5. It removes the stack-based accumulation requirement from Algorithms 3 and 4. Once T i is computed it is inserted into L and is treated the same as any of the other current elements. L is implmented in such a way that the two elements with the two smallest magnitudes can be retrieved. Clearly, this has implications for the insertion procedure. Algorithm 5.0(Select-Sum-Insert Increasing Magnitude Order Algorithm): E =0;u =unitroundoff; initialize the set L = {l i } with ξ i,0 i n 1 i =0 while L 2 extract (l, ˆl) froml where l ˆl l for any l L and with l, ˆl and all l distinct elements T i = l + ˆl E E + T i insert T i into L i i +1 end while extract (l, ˆl), the last two elements of L; returnσ = l + ˆl and ɛ =(E + σ ) u End Algorithm 5.0 6

7 As with Algorithm 4.0 there is a decreasing order version of Algorithm 5.0 that will be referred to here as Algorithm 5.1 (Select-Sum-Insert Dencreasing Magnitude Order Algorithm). For this programming problem you will implement the set of summation approaches listed below and systematically empirically explore their numerical behavior and the relationships between the a priori bound and running bound when applied to various sets of ξ i values. You must describe the details of your data structures and operations and their efficiency with respect to operations and space. This should be done relative to the constraints imposed by the particular algorithm. The implementations must be of the form presented above with the appropriate modifications for each algorithm and efficiency. You must implement a single and double precision version of these algorithms. You should do so in a way that makes it simple to choose the precision before compiling. In your experiments you may know the true sum σ true analytically. If not use the double precision version of the best behaved code as an approximation to σ true. You experiments will concentrate on the behavior of the single precision code. Codes to be Implemented: 3.1. Implement Algorithm 3 Sequential Accumulation Algorithm Implement Algorithm 4.0 and Implement Algorithms 5.0 and Implement the binary fan-in summation by expressing it as some version of Algorithm 1 that is appropriately adapted to be efficient call it Algorithm 6. Your algorithm should work for any n, i.e., not just powers of Implement the binary fan-in summation that assumes the ξ i have been ordered by increasing magnitude call it Algorithm 7.0 and a coresponding version that uses decreasing magnitude order call it Algorithm Implement a summation that adds all of the negative elements together to get S, adds all of the negative elements together to get S + and then computes σ = S +S + call it Algorithm 8. The two intermediate sums can be done using the accumulation summation or the binary fan-in but the algorithm must be put into the form above. Be sure to describe how you accomplish this in sufficient detail Implement a version of Algorithm 8.0 where the negative elements are initially ordered in terms of increasing magnitude and the positive elements are similarly initially ordered. The compute S and S + using the ideas of Algorithm 5 call it Algorithm 9.0. Note that this can be put into a single version of the Select- Sum-Insdert algorithm. It does not have to be and should not be implmented as two separate calls to Algorithm 5.0. Implement a corresponding decreasing magnitude order version call it Algorithm

8 Note it should be possible to implement the increasing and decreasing magnitude order codes as a single code with simple decisions to impose the order. Comments on Experiments: True error, running error and a priori error should be discussed relative to the properties of the data sets including magnitude profiles, signs, and the number of elements, e.g., n vs unit roundoff u. Include a small number of very large lists, e.g., n =10 8 so nu 1 or larger. You can design your own sets of numbers to probe the behavior of the different algorithms but include the sums and tests described below. Some Test Sums: S 1 = N ( 1) i 1 i, p > 0 p S 2 = N [( i i sin ) ] π i S 3 = N ( i i sin ) i S 4 = N a i where {a i } = {1, ω 1 M,...,ω N 1 M}, ω i for 1 i N 2 are random integers from [ 3, 3], N 2 w N 1 = w n, i.e., n=1 N 1 w i =0 and M>10 6 is a big number compared to 1. Finally, S 5 = N a i where the {a i } are as in S 4 except the ω i for 1 i N 2 are random values from the se { 3, 2.9,, 0.1, 0, 0.1,, 2.9, 3}. 8

9 3.8. Compute S 1 with p multiple values in the interval [0.3, 2]. Investigate the behavior of the true error, the a priori bound and the running bound at last step with respect to p. For the binary fan-in method, also include the behavior of the better priori bound derived in the earlier exercise. It is suggested to display the errors and bounds in one or more multicurve graphs or tables Compute S 2, S 3, S 4 and S 5, investigate the true error, running error bound, and a priori error bound as a function of the step k for the various methods ForS 2 and S 3, do you observe significantly different behaviors of some algorithms for these two sums? If so, explain those difference based on your knowledge of the series being summed Sums S 4 and S 5 are 1 in exact arithmetic (and 1 or very close in double precision) but they involve a wide range of numbers that indicate a significant condition number, i.e., ill-conditioning in single precision. However, as we have seen in class, different algorithms will induce different backward errors and therefore may or may not illustrate the loss of digits predicted by the worst case conditioning bound. Based on your observations of errors and bounds, explain the behavior of the algorithms for particular choices of weights {ω i } and value of M and why some get good results and the others do not. 9

10 Submission of Results Expected results comprise: A document describing your solutions as prescribed in the notes on writing up a programming solution posted on the class website. The source code, makefiles, and instructions on how to compile and execute your code including the Math Department machine used, if applicable. Code documentation should be included in each routine. All text files that do not contain code or makefiles must be PDF files. Do not send Microsoft word files of any type. These results should be submitted by 11:59 PM on the due date. Submission of results is to be done via FSU Dropbox at Drop the files off for Zhifeng Deng using his MyFSU zd16d@my.fsu.edu. (Note: do not use zdeng@math.fsu.edu to drop off the files) You should login to FSU Dropbox using your MyFSU login. If for some reason you cannot use FSU Dropbox please the files to Zhifeng at the address above. 10

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

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

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

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

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

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

Analysis of Algorithm Efficiency. Dr. Yingwu Zhu

Analysis of Algorithm Efficiency. Dr. Yingwu Zhu Analysis of Algorithm Efficiency Dr. Yingwu Zhu Measure Algorithm Efficiency Time efficiency How fast the algorithm runs; amount of time required to accomplish the task Our focus! Space efficiency Amount

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

Probabilistic Graphical Models Homework 2: Due February 24, 2014 at 4 pm

Probabilistic Graphical Models Homework 2: Due February 24, 2014 at 4 pm Probabilistic Graphical Models 10-708 Homework 2: Due February 24, 2014 at 4 pm Directions. This homework assignment covers the material presented in Lectures 4-8. You must complete all four problems to

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

1 Backward and Forward Error

1 Backward and Forward Error Math 515 Fall, 2008 Brief Notes on Conditioning, Stability and Finite Precision Arithmetic Most books on numerical analysis, numerical linear algebra, and matrix computations have a lot of material covering

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

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

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

Solutions. Problem 1: Suppose a polynomial in n of degree d has the form

Solutions. Problem 1: Suppose a polynomial in n of degree d has the form Assignment 1 1. Problem 3-1 on p. 57 2. Problem 3-2 on p. 58 3. Problem 4-5 on p. 86 4. Problem 6-1 on p. 142 5. Problem 7-4 on p. 162 6. Prove correctness (including halting) of SelectionSort (use loop

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

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

Module 1: Analyzing the Efficiency of Algorithms

Module 1: Analyzing the Efficiency of Algorithms Module 1: Analyzing the Efficiency of Algorithms Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu Based

More information

Fall 2017 November 10, Written Homework 5

Fall 2017 November 10, Written Homework 5 CS1800 Discrete Structures Profs. Aslam, Gold, & Pavlu Fall 2017 November 10, 2017 Assigned: Mon Nov 13 2017 Due: Wed Nov 29 2017 Instructions: Written Homework 5 The assignment has to be uploaded to blackboard

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

1 What is numerical analysis and scientific computing?

1 What is numerical analysis and scientific computing? Mathematical preliminaries 1 What is numerical analysis and scientific computing? Numerical analysis is the study of algorithms that use numerical approximation (as opposed to general symbolic manipulations)

More information

Register machines L2 18

Register machines L2 18 Register machines L2 18 Algorithms, informally L2 19 No precise definition of algorithm at the time Hilbert posed the Entscheidungsproblem, just examples. Common features of the examples: finite description

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

CSE373: Data Structures and Algorithms Lecture 2: Math Review; Algorithm Analysis. Hunter Zahn Summer 2016

CSE373: Data Structures and Algorithms Lecture 2: Math Review; Algorithm Analysis. Hunter Zahn Summer 2016 CSE373: Data Structures and Algorithms Lecture 2: Math Review; Algorithm Analysis Hunter Zahn Summer 2016 Today Finish discussing stacks and queues Review math essential to algorithm analysis Proof by

More information

Sample Project: Simulation of Turing Machines by Machines with only Two Tape Symbols

Sample Project: Simulation of Turing Machines by Machines with only Two Tape Symbols Sample Project: Simulation of Turing Machines by Machines with only Two Tape Symbols The purpose of this document is to illustrate what a completed project should look like. I have chosen a problem that

More information

Numerics and Error Analysis

Numerics and Error Analysis Numerics and Error Analysis CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Numerics and Error Analysis 1 / 30 A Puzzle What

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

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

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

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

CSE 331 Winter 2018 Homework 1

CSE 331 Winter 2018 Homework 1 Directions: - Due Wednesday, January 10 by 11 pm. - Turn in your work online using gradescope. You should turn in a single pdf file. You can have more than one answer per page, but please try to avoid

More information

Analysis of Algorithms [Reading: CLRS 2.2, 3] Laura Toma, csci2200, Bowdoin College

Analysis of Algorithms [Reading: CLRS 2.2, 3] Laura Toma, csci2200, Bowdoin College Analysis of Algorithms [Reading: CLRS 2.2, 3] Laura Toma, csci2200, Bowdoin College Why analysis? We want to predict how the algorithm will behave (e.g. running time) on arbitrary inputs, and how it will

More information

CS Data Structures and Algorithm Analysis

CS Data Structures and Algorithm Analysis CS 483 - Data Structures and Algorithm Analysis Lecture II: Chapter 2 R. Paul Wiegand George Mason University, Department of Computer Science February 1, 2006 Outline 1 Analysis Framework 2 Asymptotic

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

CHAPTER 10 Zeros of Functions

CHAPTER 10 Zeros of Functions CHAPTER 10 Zeros of Functions An important part of the maths syllabus in secondary school is equation solving. This is important for the simple reason that equations are important a wide range of problems

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

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

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

CS261: Problem Set #3

CS261: Problem Set #3 CS261: Problem Set #3 Due by 11:59 PM on Tuesday, February 23, 2016 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. (2) Submission instructions:

More information

Growth of Functions. As an example for an estimate of computation time, let us consider the sequential search algorithm.

Growth of Functions. As an example for an estimate of computation time, let us consider the sequential search algorithm. Function Growth of Functions Subjects to be Learned Contents big oh max function big omega big theta little oh little omega Introduction One of the important criteria in evaluating algorithms is the time

More information

Assignment 5 Bounding Complexities KEY

Assignment 5 Bounding Complexities KEY Assignment 5 Bounding Complexities KEY Print this sheet and fill in your answers. Please staple the sheets together. Turn in at the beginning of class on Friday, September 16. There are links in the examples

More information

One-Sided Difference Formula for the First Derivative

One-Sided Difference Formula for the First Derivative POLYTECHNIC UNIVERSITY Department of Computer and Information Science One-Sided Difference Formula for the First Derivative K. Ming Leung Abstract: Derive a one-sided formula for the first derive of a

More information

The PRIMES 2014 problem set

The PRIMES 2014 problem set Dear PRIMES applicant! The PRIMES 24 problem set This is the PRIMES 24 problem set. Please send us your solutions as part of your PRIMES application by December, 24. For complete rules, see http://web.mit.edu/primes/apply.shtml

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

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy,

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy, Outline Math 541 - Numerical Analysis Lecture Notes Zeros and Roots Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research

More information

Math Numerical Analysis

Math Numerical Analysis Math 541 - Numerical Analysis Lecture Notes Zeros and Roots Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center

More information

Lecture 2. Fundamentals of the Analysis of Algorithm Efficiency

Lecture 2. Fundamentals of the Analysis of Algorithm Efficiency Lecture 2 Fundamentals of the Analysis of Algorithm Efficiency 1 Lecture Contents 1. Analysis Framework 2. Asymptotic Notations and Basic Efficiency Classes 3. Mathematical Analysis of Nonrecursive Algorithms

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

Faithful Horner Algorithm

Faithful Horner Algorithm ICIAM 07, Zurich, Switzerland, 16 20 July 2007 Faithful Horner Algorithm Philippe Langlois, Nicolas Louvet Université de Perpignan, France http://webdali.univ-perp.fr Ph. Langlois (Université de Perpignan)

More information

Name: INSERT YOUR NAME HERE. Due to dropbox by 6pm PDT, Wednesday, December 14, 2011

Name: INSERT YOUR NAME HERE. Due to dropbox by 6pm PDT, Wednesday, December 14, 2011 AMath 584 Name: INSERT YOUR NAME HERE Take-home Final UWNetID: INSERT YOUR NETID Due to dropbox by 6pm PDT, Wednesday, December 14, 2011 The main part of the assignment (Problems 1 3) is worth 80 points.

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

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

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

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

Aditya Bhaskara CS 5968/6968, Lecture 1: Introduction and Review 12 January 2016

Aditya Bhaskara CS 5968/6968, Lecture 1: Introduction and Review 12 January 2016 Lecture 1: Introduction and Review We begin with a short introduction to the course, and logistics. We then survey some basics about approximation algorithms and probability. We also introduce some of

More information

CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3

CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3 CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3 This third problem set explores graphs, relations, functions, cardinalities, and the pigeonhole principle. This should be a great way to get a

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

CMPT 307 : Divide-and-Conqer (Study Guide) Should be read in conjunction with the text June 2, 2015

CMPT 307 : Divide-and-Conqer (Study Guide) Should be read in conjunction with the text June 2, 2015 CMPT 307 : Divide-and-Conqer (Study Guide) Should be read in conjunction with the text June 2, 2015 1 Introduction The divide-and-conquer strategy is a general paradigm for algorithm design. This strategy

More information

Topic Contents. Factoring Methods. Unit 3: Factoring Methods. Finding the square root of a number

Topic Contents. Factoring Methods. Unit 3: Factoring Methods. Finding the square root of a number Topic Contents Factoring Methods Unit 3 The smallest divisor of an integer The GCD of two numbers Generating prime numbers Computing prime factors of an integer Generating pseudo random numbers Raising

More information

Data Structures and Algorithms Chapter 2

Data Structures and Algorithms Chapter 2 1 Data Structures and Algorithms Chapter 2 Werner Nutt 2 Acknowledgments The course follows the book Introduction to Algorithms, by Cormen, Leiserson, Rivest and Stein, MIT Press [CLRST]. Many examples

More information

Lecture 5. September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico

Lecture 5. September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico Lecture 5 September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico 1 Review: Office hours at regularly scheduled times this week Tuesday: 9:30am-11am Wed: 2:30pm-4:00pm

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

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

AMBIGUITY PROBLEMS WITH POLAR COORDINATES

AMBIGUITY PROBLEMS WITH POLAR COORDINATES AMBIGUITY PROBLEMS WITH POLAR COORDINATES A given point in the plane can be represented by more than one pair of polar coordinates, and Section 9.7 of Thomas and Finney, Calculus, Ninth Edition, discusses

More information

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope)

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope) CS 188 Spring 2019 Introduction to Artificial Intelligence Written HW 6 Sol. Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope) Instructions for self-assessment: Take your original

More information

Reducing round-off errors in symmetric multistep methods

Reducing round-off errors in symmetric multistep methods Reducing round-off errors in symmetric multistep methods Paola Console a, Ernst Hairer a a Section de Mathématiques, Université de Genève, 2-4 rue du Lièvre, CH-1211 Genève 4, Switzerland. (Paola.Console@unige.ch,

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

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

Homework #1 Solution

Homework #1 Solution February 7, 4 Department of Electrical and Computer Engineering University of Wisconsin Madison ECE 734 VLSI Array Structures for Digital Signal Processing Homework # Solution Due: February 6, 4 in class.

More information

10-701/15-781, Machine Learning: Homework 4

10-701/15-781, Machine Learning: Homework 4 10-701/15-781, Machine Learning: Homewor 4 Aarti Singh Carnegie Mellon University ˆ The assignment is due at 10:30 am beginning of class on Mon, Nov 15, 2010. ˆ Separate you answers into five parts, one

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

MATH2071: LAB #5: Norms, Errors and Condition Numbers

MATH2071: LAB #5: Norms, Errors and Condition Numbers MATH2071: LAB #5: Norms, Errors and Condition Numbers 1 Introduction Introduction Exercise 1 Vector Norms Exercise 2 Matrix Norms Exercise 3 Compatible Matrix Norms Exercise 4 More on the Spectral Radius

More information

ISSN (PRINT): , (ONLINE): , VOLUME-4, ISSUE-10,

ISSN (PRINT): , (ONLINE): , VOLUME-4, ISSUE-10, A NOVEL DOMINO LOGIC DESIGN FOR EMBEDDED APPLICATION Dr.K.Sujatha Associate Professor, Department of Computer science and Engineering, Sri Krishna College of Engineering and Technology, Coimbatore, Tamilnadu,

More information

Problem Set 2. MAS 622J/1.126J: Pattern Recognition and Analysis. Due: 5:00 p.m. on September 30

Problem Set 2. MAS 622J/1.126J: Pattern Recognition and Analysis. Due: 5:00 p.m. on September 30 Problem Set 2 MAS 622J/1.126J: Pattern Recognition and Analysis Due: 5:00 p.m. on September 30 [Note: All instructions to plot data or write a program should be carried out using Matlab. In order to maintain

More information

PRIMES Math Problem Set

PRIMES Math Problem Set PRIMES Math Problem Set PRIMES 017 Due December 1, 01 Dear PRIMES applicant: This is the PRIMES 017 Math Problem Set. Please send us your solutions as part of your PRIMES application by December 1, 01.

More information

Intermediate Math Circles March 11, 2009 Sequences and Series

Intermediate Math Circles March 11, 2009 Sequences and Series 1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Intermediate Math Circles March 11, 009 Sequences and Series Tower of Hanoi The Tower of Hanoi is a game

More information

Ensembles. Léon Bottou COS 424 4/8/2010

Ensembles. Léon Bottou COS 424 4/8/2010 Ensembles Léon Bottou COS 424 4/8/2010 Readings T. G. Dietterich (2000) Ensemble Methods in Machine Learning. R. E. Schapire (2003): The Boosting Approach to Machine Learning. Sections 1,2,3,4,6. Léon

More information

Central Algorithmic Techniques. Iterative Algorithms

Central Algorithmic Techniques. Iterative Algorithms Central Algorithmic Techniques Iterative Algorithms Code Representation of an Algorithm class InsertionSortAlgorithm extends SortAlgorithm { void sort(int a[]) throws Exception { for (int i = 1; i < a.length;

More information

Math 391: Midterm 1.0 Spring 2016

Math 391: Midterm 1.0 Spring 2016 Math 391: Midterm 1.0 Spring 2016 James Skon skonjp@kenyon.edu Test date: October 5 Submission Instructions: Give all your assumptions. Show all your work. Be as complete as possible. Grading Problem 1

More information

Mathematical Background. Unsigned binary numbers. Powers of 2. Logs and exponents. Mathematical Background. Today, we will review:

Mathematical Background. Unsigned binary numbers. Powers of 2. Logs and exponents. Mathematical Background. Today, we will review: Mathematical Background Mathematical Background CSE 373 Data Structures Today, we will review: Logs and eponents Series Recursion Motivation for Algorithm Analysis 5 January 007 CSE 373 - Math Background

More information

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011 Math 31 Lesson Plan Day 2: Sets; Binary Operations Elizabeth Gillaspy September 23, 2011 Supplies needed: 30 worksheets. Scratch paper? Sign in sheet Goals for myself: Tell them what you re going to tell

More information

MATH 137 : Calculus 1 for Honours Mathematics. Online Assignment #2. Introduction to Sequences

MATH 137 : Calculus 1 for Honours Mathematics. Online Assignment #2. Introduction to Sequences 1 MATH 137 : Calculus 1 for Honours Mathematics Online Assignment #2 Introduction to Sequences Due by 9:00 pm on WEDNESDAY, September 19, 2018 Instructions: Weight: 2% This assignment covers the topics

More information

Homework 1 Submission

Homework 1 Submission Homework Submission Sample Solution; Due Date: Thursday, May 4, :59 pm Directions: Your solutions should be typed and submitted as a single pdf on Gradescope by the due date. L A TEX is preferred but not

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

IS 709/809: Computational Methods in IS Research Fall Exam Review

IS 709/809: Computational Methods in IS Research Fall Exam Review IS 709/809: Computational Methods in IS Research Fall 2017 Exam Review Nirmalya Roy Department of Information Systems University of Maryland Baltimore County www.umbc.edu Exam When: Tuesday (11/28) 7:10pm

More information

Computer Intensive Methods in Mathematical Statistics

Computer Intensive Methods in Mathematical Statistics Computer Intensive Methods in Mathematical Statistics Department of mathematics johawes@kth.se Lecture 7 Sequential Monte Carlo methods III 7 April 2017 Computer Intensive Methods (1) Plan of today s lecture

More information

1 Introduction to information theory

1 Introduction to information theory 1 Introduction to information theory 1.1 Introduction In this chapter we present some of the basic concepts of information theory. The situations we have in mind involve the exchange of information through

More information

Algorithm Analysis Divide and Conquer. Chung-Ang University, Jaesung Lee

Algorithm Analysis Divide and Conquer. Chung-Ang University, Jaesung Lee Algorithm Analysis Divide and Conquer Chung-Ang University, Jaesung Lee Introduction 2 Divide and Conquer Paradigm 3 Advantages of Divide and Conquer Solving Difficult Problems Algorithm Efficiency Parallelism

More information

DRAFT. Algebraic computation models. Chapter 14

DRAFT. Algebraic computation models. Chapter 14 Chapter 14 Algebraic computation models Somewhat rough We think of numerical algorithms root-finding, gaussian elimination etc. as operating over R or C, even though the underlying representation of the

More information

STA 4273H: Statistical Machine Learning

STA 4273H: Statistical Machine Learning STA 4273H: Statistical Machine Learning Russ Salakhutdinov Department of Statistics! rsalakhu@utstat.toronto.edu! http://www.utstat.utoronto.ca/~rsalakhu/ Sidney Smith Hall, Room 6002 Lecture 11 Project

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

CMPT 310 Artificial Intelligence Survey. Simon Fraser University Summer Instructor: Oliver Schulte

CMPT 310 Artificial Intelligence Survey. Simon Fraser University Summer Instructor: Oliver Schulte CMPT 310 Artificial Intelligence Survey Simon Fraser University Summer 2017 Instructor: Oliver Schulte Assignment 3: Chapters 13, 14, 18, 20. Probabilistic Reasoning and Learning Instructions: The university

More information

Project 1: Application of s = rθ and v = rω in Two Pulley Systems

Project 1: Application of s = rθ and v = rω in Two Pulley Systems Project 1: Application of s = rθ and v = rω in Two Pulley Systems Pulley systems provide an ideal environment for using the formulas s = rθ and v = rω. Most of these problems can be solved more quickly

More information

CSCE 222 Discrete Structures for Computing

CSCE 222 Discrete Structures for Computing CSCE 222 Discrete Structures for Computing Algorithms Dr. Philip C. Ritchey Introduction An algorithm is a finite sequence of precise instructions for performing a computation or for solving a problem.

More information

Machine Learning, Fall 2011: Homework 5

Machine Learning, Fall 2011: Homework 5 10-601 Machine Learning, Fall 2011: Homework 5 Machine Learning Department Carnegie Mellon University Due:???????????, 5pm Instructions There are???? questions on this assignment. The?????? question involves

More information

Week 4. (1) 0 f ij u ij.

Week 4. (1) 0 f ij u ij. Week 4 1 Network Flow Chapter 7 of the book is about optimisation problems on networks. Section 7.1 gives a quick introduction to the definitions of graph theory. In fact I hope these are already known

More information

MA/CSSE 473 Day 05. Factors and Primes Recursive division algorithm

MA/CSSE 473 Day 05. Factors and Primes Recursive division algorithm MA/CSSE 473 Day 05 actors and Primes Recursive division algorithm MA/CSSE 473 Day 05 HW 2 due tonight, 3 is due Monday Student Questions Asymptotic Analysis example: summation Review topics I don t plan

More information

What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency Asympt

What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency Asympt Lecture 3 The Analysis of Recursive Algorithm Efficiency What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency

More information

MATH 137 : Calculus 1 for Honours Mathematics Instructor: Barbara Forrest Self Check #1: Sequences and Convergence

MATH 137 : Calculus 1 for Honours Mathematics Instructor: Barbara Forrest Self Check #1: Sequences and Convergence 1 MATH 137 : Calculus 1 for Honours Mathematics Instructor: Barbara Forrest Self Check #1: Sequences and Convergence Recommended Due Date: complete by the end of WEEK 3 Weight: none - self graded INSTRUCTIONS:

More information

1 Closest Pair of Points on the Plane

1 Closest Pair of Points on the Plane CS 31: Algorithms (Spring 2019): Lecture 5 Date: 4th April, 2019 Topic: Divide and Conquer 3: Closest Pair of Points on a Plane Disclaimer: These notes have not gone through scrutiny and in all probability

More information