Math 56 Homework 1 Michael Downs. ne n 10 + ne n (1)

Size: px
Start display at page:

Download "Math 56 Homework 1 Michael Downs. ne n 10 + ne n (1)"

Transcription

1 . Problem (a) Yes. The following equation: ne n + ne n () holds for all n R but, since we re only concerned with the asymptotic behavior as n, let us only consider n >. Dividing both sides by n( + ne n ) we get e n + ne n n () From here we need only to observe that we can pick C = and any n R + such that e n + ne n C n () holds for all n > n. We conclude that (b) We are interested in the N such that and so e n +ne n = O(n ). 6 N log N N (4) 6 log N N (5) We first note that this holds for < N because log is negative or zero for these values. We would expect the RHS to become larger than the LHS for large N because N grows exponentially relative to log N. I use the following code to create a matlab plot: f i g u r e ; hold on ; h = e z p l o t ( ˆ6 l o g ( x ), [ 5]) ; s e t (h, Color, r ) ; 5 e z p l o t ( x, [ 5]) ; t i t l e ( ˆ6 l o g ( x ) vs x ) ; 7 legend ( ˆ6 l o g ( x ), x ) ;

2 x 7 6 log(x) vs x 5 6 log(x) x x x 7 and so the N for which (5) holds is between.5 7 and 7. Using a solver we see that 6 log N = N when N So 6 N log N outperforms N for N I start by writing a matlab script to find the average maximum eigenvalue λ max of matrices with dimension n with random entries from the standard normal distribution for n from to using steps of with trials per step (so trials at, trials at, at, etc. I take the average result of the trials as the value at dimension n). Some sample values are tabulated below: n λ max We observe that λ max grows slowly relative to n. A log-log plot of λ max vs n reveals a linear relationship:

3 log log plot of λ max vs n λ max n We then have the relationship: log λ max = a + b log n (6) Using linear regression we obtain a.94 and b.5 For positive n, we can rewrite this equation: log λ max = a + b log n log λ max = log c + log n b log λ max = log cn b λ max = cn b Solving log c =.94 we get c = e which gives us the experimental relationship λ max (n).4679n.55. Finally, I check this fitted equation s accuracy by plotting it against the experimental data:

4 Comparison to determine accuracy 9 Experimental data Fitted regression x Thus we can be satisfied that λ max (n).4679n.55. Code used to make the plots: % s c r i p t to e x p l o r e the r e l a t i o n s h i p between the maximum e i g e n v a l u e o f a % symmetric matrix o f dimension n with random e n t r i e s from the standard % normal d i s t r i b u t i o n. In s t e p s o f, the s c r i p t i t e r a t e s from to % using t r i a l s f o r each i t e r a t i o n to determine the average maximum 5 % e i g e n v a l u e. We then p l o t the data. 7 e i g s = z e r o s (, ) ; % dummy matrix to hold the e i g e n v a l u e s x = : : ; % the x v a l u e s in the p l o t 9 y = z e r o s (, ) ; % the y v a l u e s in the p l o t f o r n = : : f o r i = : ; A = randn ( n ) ; 5 A = A + A ; e i g s (, i ) = max( e i g (A) ) ; 7 end y (, n/) = mean( e i g s ) ; 9 end % code to get the i n i t i a l l o g p l o t l o g l o g ( x, y ) ; t i t l e ( log l o g p l o t o f \ lambda {max} vs n ) ; x l a b e l ( n ) ; 5 y l a b e l ( \ lambda {max} ) ; 7 % g e t t i n g the c o n s t a n t s p=p o l y f i t ( l o g ( x ), l o g ( y ), ) ; 9 b=p ( ) ; 4

5 a=exp ( p ( ) ) ; syms x ; S = a ( xˆb ) ; 5 % and then the comparison p l o t f i g u r e ; 7 hold on ; h = p l o t ( x, y ) ; 9 h = e z p l o t (S, [ ] ) ; hold o f f ; 4 t i t l e ( Comparison to determine accuracy ) ; 4 s e t ( h, c o l o r, r, l i n e s t y l e, ) ; legend ( Experimental data, F i t t e d r e g r e s s i o n ) ;. Looking up what the series converges to: y = k= k 4 = π4 9. (a) I first write this script in matlab to produce a plot and get the equation for the line. 4 6 % s c r i p t to p l o t the e r r o r o f the truncated n term s e r i e s o f /kˆ4 vs n format long g ; % more accuracy syms k ; % the lower and upper bounds, r e s p e c t i v e l y. assume s t e p s o f 8 lb = ; ub = ; x = lb : ub ; y = z e r o s (, ub ) ; % dummy matrix to hold the y v a l u e s f o r p l o t t i n g l a t e r 4 f o r i = lb : ub y (, i ) = abs (symsum( kˆ 4, lb, i ) pi ˆ4/9) ; 6 end 8 l o g l o g ( x, y ) ; t i t l e ( log l o g p l o t o f \ e p s i l o n n vs n ) ; x l a b e l ( n ) ; y l a b e l ( \ e p s i l o n n ) ; p = p o l y f i t ( l o g ( x ), l o g ( y ), ) ; 4 b = p ( ) ; a = exp ( p ( ) ) ; A log-log plot of ɛ n vs n reveals a linear relationship with a downward slope: 5

6 log log plot of ε n vs n 4 5 ε n n Therefore, we can expect a relationship between ɛ n and n of the form: log ɛ n = log(a) + b log n (7) with a > and b <. Performing linear regression on the data we get log a.9 so a = e.9.74 and the slope b.9689 (which is close enough to ). Linearity in a log-log plot is indicative of algebraic convergence. (b) Not too useful. It tells us that the error converges to zero rapidly but it s difficult to interperet other meaningful data, such as the rate of convergence, from the plot. With a log-log plot, the slope of the line is the rate of convergence. It s not as clear if both axes are linear. (c) We have that ɛ n = k>n k 4 and so ɛ n n k 4 dk = implies that n = O(ɛ n ). n so ɛ n = O(n ) which (d) The order does matter due to the nature of floating point precision. If we start the sum at the beginning and sum n terms, we re starting with the largest terms so the smaller terms later on in the series might not change the answer (they ll get absorbed). If we start n terms out and sum backwards to the first term, we start by summing several smaller terms which eventually become larger and give an actual contribution once we reach the large terms. So summing in reverse would be more accurate. Terms after n = 4 will be ignored because they re smaller than 6 and matlab only stores 6 digits of relative accuracy. I explore this hypothesis in matlab using the following script: % t e s t i n g a sum in r e v e r s e format long g ; forw = ; % the forward sum 6

7 5 rev = ; % the r e v e r s e sum n = ; % the terms 7 f o r i = : n 9 forw = forw + / i ˆ 4 ; end f o r i = : n rev = rev + /(( n+) i ) ˆ 4 ; end 5 f p r i n t f ( Forward : %d Error : %d\n, forw, abs ( pi ˆ4/9 forw ) ) ; 7 f p r i n t f ( Reverse : %d Error : %d\n, rev, abs ( pi ˆ4/9 rev ) ) ; For small n, the error starts off the same. As I increase n, first the forward sum becomes more accurate, then the reverse some becomes more accurate for really large n. >> HWQPD Output for n = Forward:.8e+ Error:.8667e-7 Reverse:.8e+ Error:.8667e-7 >> HWQPD Output for n = Forward:.8e+ Error:.8e- Reverse:.8e+ Error:.8e- >> HWQPD Output for n = Forward:.8e+ Error: e- Reverse:.8e+ Error:.669e- >> HWQPD Output for n = Forward:.8e+ Error: e- Reverse:.8e+ Error: >> HWQPD Output for n = Forward:.8e+ Error: e- Reverse:.8e+ Error:.446e-6 >> HWQPD Output for n = Forward:.8e+ Error: e- Reverse:.8e+ Error:.446e-6 I conclude that the order does not matter for small n but we get better precision using the reverse sum for large n. 4. Code below: 7

8 % f i n d s an approximate root o f f ( x ) by b i s e c t i o n. given two p o i n t s % a < c with f ( a ) and f ( c ) o p p o s i t e sign, t h i s w i l l keep g e t t i n g the % midpoint o f a and c, s e e i n g how c l o s e the f u n c t i o n i s to zero with that % value, and then r e p e a t i n g the p r o c e s s u n t i l i t i s within the t o l e r a n c e 5 f u n c t i o n root = b i s e c t i o n ( f, a, c, t o l, n ) 7 n = n + ; % the method breaks down i f f ( a ) and f ( c ) have the same s i g n so we 9 % should stop i f that s the case i f s i g n ( f ( a ) ) == s i g n ( f ( c ) ) f p r i n t f ( e r r o r, same s i g n s ) ; r eturn ; end 5 root = ( a+c ) / ; % the midpoint between a and c zero = f ( root ) ; % the e v a l u a t i o n o f the midpoint. should become c l o s e 7 % to zero 9 % stop and r eturn an answer i f we re c l o s e enough to zero i f abs ( zero ) <= t o l n r eturn ; end 5 % o t h e r w i s e perform a r e c u r s i o n to get a more a c curate answer % we must be c a r e f u l to c o n s i d e r the s i g n change that occurs at the 7 % root i f f ( c ) > 9 i f zero > root = b i s e c t i o n ( f, a, root, t o l, n ) ; e l s e i f zero < root = b i s e c t i o n ( f, root, c, t o l, n ) ; end e l s e i f f ( c ) < 5 i f zero > root = b i s e c t i o n ( f, root, c, t o l, n ) ; 7 e l s e i f zero < root = b i s e c t i o n ( f, a, root, t o l, n ) ; 9 end end 4 end (a) Code below: % t e s t s c r i p t f o r the b i s e c t i o n f u n c t i o n f x ) s i n ( x ) ; 5 7 b i s e c t i o n ( f,, 4,., ) % t h i s f i n d s the c o r r e c t root, pi. 8

9 9 b i s e c t i o n ( f,, pi,., ) % t h e r e should be no r o o t s in t h i s i n t e r v a l but i t g i v e s the root which gives the output >> HWQ4PA n = ans =.46 n = 5 ans = e-5 (b) Since the error is approximately halved each iteration (we succesively take midpoints until we re close enough to the answer), one would expect the error to exhibit exponential convergence: ɛ n = O( n ). Consider ɛ n = 5. The amount of iterations n required to achieve accuracy to fifteen digits would depend on the starting interval c a but let us assume something reasonable such as c a =. We have that: 5 = n 5 log = n log 5 log = n log n which shows that we would expect around 5 iterations to achieve ɛ n = 5. The trial for finding the root of sin between and 4 took approximately 48 iterations, which is close to the predicted number. Trying to find digits of accuracy is not possible, however, as matlab is not capable of that level of precision. My code 9

10 resulted in a stack overflow due to infinite recursion because the evaluation of the root was never under the tolerance. (c) An advantage of bisection over newton s method is that it does not rely on the function s derivative. This avoids having to find the derivative in the first place and it avoids problems if the derivative is zero or near zero at the root. Also, newton s method does not converge for some functions. 5. Problem 5 (a) i. + i 4 ii. 5 iii. ( + i) iv. 5 (b) Code below: f u n c t i o n m = complot ( f ) [X,Y] = meshgrid ( :. :, :. : ) ; Z = abs ( f (X + i Y) ) ; 4 s u r f (X,Y, Z) end Plotting complex values: >> complot(@(x) x); (c) Below is a plot of the function f(z) = /( + z ) in the complex plane. absolute value of f(z) blows up to infinity near the poles z = ±i. The

11 + x.^)); We can also take a look at how the angles/phases behave near the poles by modifying complot.m: f u n c t i o n m = complot ( f ) [X,Y] = meshgrid ( :. :, :. : ) ; Z = angle ( f (X + i Y) ) ; s u r f (X,Y, Z) 5 end >> complot(@(x)./( + x.^)); >> colorbar

12 4 4 X:. Y: Z: The phase approaches a constant depending on the direction of approach. At each pole, the phase is zero. Approaching the pole from the left or right results in either negative or positive π. There appears to be a discontinuity but we must remember that π = π when talking about angles and the program has to output a single angle so it restricts angles to ( π, π]. (d) Since is closer to. than it is to ±i, we can expect the taylor series to converge. Applying the theorem from class we have that ɛ n = O (.7 n). 6. As from class, F = {± m β t β e,, ±, NAN}. We can represent real numbers in the interval [ n, n+ ] with the approximation m β t β e where β =, t = 5, e = n, and β t m β t. Thus the spacing in the interval [ n, n+ ] is 5 n. The spacing is some decimal less than until n = 5 at which point the spacing in the interval [ 5, 5 ] is. We still hit all the integers in this interval and every interval for n 5, however. The first interval where we start to skip integers is the interval [ 5, 54 ] when n = 5. The spacing in this interval is, so 5 + is the smallest integer that is not in F. In conclusion: The smallest positive integer that does not belong to F is n = β t + with β = and t = 5 which is Confirming in matlab: >> fprintf( %f %f \n, ^5, ^5 + ) This code should serve as an identity function because it takes the square root of a number 6 times and then squares it 6 times. In practice, however, roots are often irrational or very long decimals and cannot be expressed precisely by a floating-point system. For most numbers expressible in matlab, after taking the root about 6 times, we end up with a number very close to such that the difference between that number and would be less than 5 at which point the number just becomes. For very large numbers, the returned result is less than the original due to lost precision.

13 x = realmax ( double ) ; f p r i n t f ( b e f o r e : x = %d\n, x ) ; 5 f o r i =:6 x = s q r t ( x ) ; 7 end 9 f o r i =:6 x = x ˆ ; end f p r i n t f ( a f t e r : x = %d\n, x ) ; >> HWQ7 before: x = after: x = >> HWQ7 before: x = after: x = >> HWQ7 before: x =.e+ after: x = >> HWQ7 before: x =.e+ after: x = >> HWQ7 before: x =.e+ after: x =.545e+ >> HWQ7 before: x =.79769e+8 after: x =.8445e+

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

Chapter 3: Root Finding. September 26, 2005

Chapter 3: Root Finding. September 26, 2005 Chapter 3: Root Finding September 26, 2005 Outline 1 Root Finding 2 3.1 The Bisection Method 3 3.2 Newton s Method: Derivation and Examples 4 3.3 How To Stop Newton s Method 5 3.4 Application: Division

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

Homework 2. Matthew Jin. April 10, 2014

Homework 2. Matthew Jin. April 10, 2014 Homework Matthew Jin April 10, 014 1a) The relative error is given by ŷ y y, where ŷ represents the observed output value, and y represents the theoretical output value. In this case, the observed output

More information

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane. Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane c Sateesh R. Mane 2018 3 Lecture 3 3.1 General remarks March 4, 2018 This

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

NUMERICAL METHODS FOR SOLVING EQUATIONS

NUMERICAL METHODS FOR SOLVING EQUATIONS Mathematics Revision Guides Numerical Methods for Solving Equations Page of M.K. HOME TUITION Mathematics Revision Guides Level: AS / A Level AQA : C3 Edecel: C3 OCR: C3 NUMERICAL METHODS FOR SOLVING EQUATIONS

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

Unit 2: Solving Scalar Equations. Notes prepared by: Amos Ron, Yunpeng Li, Mark Cowlishaw, Steve Wright Instructor: Steve Wright

Unit 2: Solving Scalar Equations. Notes prepared by: Amos Ron, Yunpeng Li, Mark Cowlishaw, Steve Wright Instructor: Steve Wright cs416: introduction to scientific computing 01/9/07 Unit : Solving Scalar Equations Notes prepared by: Amos Ron, Yunpeng Li, Mark Cowlishaw, Steve Wright Instructor: Steve Wright 1 Introduction We now

More information

ter. on Can we get a still better result? Yes, by making the rectangles still smaller. As we make the rectangles smaller and smaller, the

ter. on Can we get a still better result? Yes, by making the rectangles still smaller. As we make the rectangles smaller and smaller, the Area and Tangent Problem Calculus is motivated by two main problems. The first is the area problem. It is a well known result that the area of a rectangle with length l and width w is given by A = wl.

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

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

The answer in each case is the error in evaluating the taylor series for ln(1 x) for x = which is 6.9.

The answer in each case is the error in evaluating the taylor series for ln(1 x) for x = which is 6.9. Brad Nelson Math 26 Homework #2 /23/2. a MATLAB outputs: >> a=(+3.4e-6)-.e-6;a- ans = 4.449e-6 >> a=+(3.4e-6-.e-6);a- ans = 2.224e-6 And the exact answer for both operations is 2.3e-6. The reason why way

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

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

Lecture 10: Powers of Matrices, Difference Equations

Lecture 10: Powers of Matrices, Difference Equations Lecture 10: Powers of Matrices, Difference Equations Difference Equations A difference equation, also sometimes called a recurrence equation is an equation that defines a sequence recursively, i.e. each

More information

3.1 Introduction. Solve non-linear real equation f(x) = 0 for real root or zero x. E.g. x x 1.5 =0, tan x x =0.

3.1 Introduction. Solve non-linear real equation f(x) = 0 for real root or zero x. E.g. x x 1.5 =0, tan x x =0. 3.1 Introduction Solve non-linear real equation f(x) = 0 for real root or zero x. E.g. x 3 +1.5x 1.5 =0, tan x x =0. Practical existence test for roots: by intermediate value theorem, f C[a, b] & f(a)f(b)

More information

Lab 2: Static Response, Cantilevered Beam

Lab 2: Static Response, Cantilevered Beam Contents 1 Lab 2: Static Response, Cantilevered Beam 3 1.1 Objectives.......................................... 3 1.2 Scalars, Vectors and Matrices (Allen Downey)...................... 3 1.2.1 Attribution.....................................

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality Math 336-Modern Algebra Lecture 08 9/26/4. Cardinality I started talking about cardinality last time, and you did some stuff with it in the Homework, so let s continue. I said that two sets have the same

More information

Nonlinear Equations. Chapter The Bisection Method

Nonlinear Equations. Chapter The Bisection Method Chapter 6 Nonlinear Equations Given a nonlinear function f(), a value r such that f(r) = 0, is called a root or a zero of f() For eample, for f() = e 016064, Fig?? gives the set of points satisfying y

More information

Binomial Coefficient Identities/Complements

Binomial Coefficient Identities/Complements Binomial Coefficient Identities/Complements CSE21 Fall 2017, Day 4 Oct 6, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ permutation P(n,r) = n(n-1) (n-2) (n-r+1) = Terminology

More information

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

What Every Programmer Should Know About Floating-Point Arithmetic DRAFT. Last updated: November 3, Abstract What Every Programmer Should Know About Floating-Point Arithmetic Last updated: November 3, 2014 Abstract The article provides simple answers to the common recurring questions of novice programmers about

More information

Numerical Methods. Root Finding

Numerical Methods. Root Finding Numerical Methods Solving Non Linear 1-Dimensional Equations Root Finding Given a real valued function f of one variable (say ), the idea is to find an such that: f() 0 1 Root Finding Eamples Find real

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

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic 11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic Bezout s Lemma Let's look at the values of 4x + 6y when x and y are integers. If x is -6 and y is 4 we

More information

Math221: HW# 7 solutions

Math221: HW# 7 solutions Math22: HW# 7 solutions Andy Royston November 7, 25.3.3 let x = e u. Then ln x = u, x2 = e 2u, and dx = e 2u du. Furthermore, when x =, u, and when x =, u =. Hence x 2 ln x) 3 dx = e 2u u 3 e u du) = e

More information

AP Calculus Chapter 9: Infinite Series

AP Calculus Chapter 9: Infinite Series AP Calculus Chapter 9: Infinite Series 9. Sequences a, a 2, a 3, a 4, a 5,... Sequence: A function whose domain is the set of positive integers n = 2 3 4 a n = a a 2 a 3 a 4 terms of the sequence Begin

More information

Another Proof By Contradiction: 2 is Irrational

Another Proof By Contradiction: 2 is Irrational Another Proof By Contradiction: 2 is Irrational Theorem: 2 is irrational. Proof: By contradiction. Suppose 2 is rational. Then 2 = a/b for some a, b N +. We can assume that a/b is in lowest terms. Therefore,

More information

Computer Problems for Taylor Series and Series Convergence

Computer Problems for Taylor Series and Series Convergence Computer Problems for Taylor Series and Series Convergence The two problems below are a set; the first should be done without a computer and the second is a computer-based follow up. 1. The drawing below

More information

Limits and Continuity

Limits and Continuity Chapter Limits and Continuity. Limits of Sequences.. The Concept of Limit and Its Properties A sequence { } is an ordered infinite list x,x,...,,... The n-th term of the sequence is, and n is the index

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

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

Intro to Scientific Computing: How long does it take to find a needle in a haystack?

Intro to Scientific Computing: How long does it take to find a needle in a haystack? Intro to Scientific Computing: How long does it take to find a needle in a haystack? Dr. David M. Goulet Intro Binary Sorting Suppose that you have a detector that can tell you if a needle is in a haystack,

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

Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes

Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes Infinite

More information

Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes

Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes Sec 2.2: Infinite Limits / Vertical Asymptotes Sec 2.6: Limits At Infinity / Horizontal Asymptotes Infinite

More information

Math 308 Week 8 Solutions

Math 308 Week 8 Solutions Math 38 Week 8 Solutions There is a solution manual to Chapter 4 online: www.pearsoncustom.com/tamu math/. This online solutions manual contains solutions to some of the suggested problems. Here are solutions

More information

Solution Methods. Richard Lusby. Department of Management Engineering Technical University of Denmark

Solution Methods. Richard Lusby. Department of Management Engineering Technical University of Denmark Solution Methods Richard Lusby Department of Management Engineering Technical University of Denmark Lecture Overview (jg Unconstrained Several Variables Quadratic Programming Separable Programming SUMT

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

Numerical Methods Lecture 3

Numerical Methods Lecture 3 Numerical Methods Lecture 3 Nonlinear Equations by Pavel Ludvík Introduction Definition (Root or zero of a function) A root (or a zero) of a function f is a solution of an equation f (x) = 0. We learn

More information

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES No. of Printed Pages : 5 BCS-054 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 058b9 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES Time : 3 hours Maximum Marks

More information

Math 200 University of Connecticut

Math 200 University of Connecticut IRRATIONALITY OF π AND e KEITH CONRAD Math 2 University of Connecticut Date: Aug. 3, 25. Contents. Introduction 2. Irrationality of π 2 3. Irrationality of e 3 4. General Ideas 4 5. Irrationality of rational

More information

εx 2 + x 1 = 0. (2) Suppose we try a regular perturbation expansion on it. Setting ε = 0 gives x 1 = 0,

εx 2 + x 1 = 0. (2) Suppose we try a regular perturbation expansion on it. Setting ε = 0 gives x 1 = 0, 4 Rescaling In this section we ll look at one of the reasons that our ε = 0 system might not have enough solutions, and introduce a tool that is fundamental to all perturbation systems. We ll start with

More information

1 Question related to polynomials

1 Question related to polynomials 07-08 MATH00J Lecture 6: Taylor Series Charles Li Warning: Skip the material involving the estimation of error term Reference: APEX Calculus This lecture introduced Taylor Polynomial and Taylor Series

More information

One-to-one functions and onto functions

One-to-one functions and onto functions MA 3362 Lecture 7 - One-to-one and Onto Wednesday, October 22, 2008. Objectives: Formalize definitions of one-to-one and onto One-to-one functions and onto functions At the level of set theory, there are

More information

MT804 Analysis Homework II

MT804 Analysis Homework II MT804 Analysis Homework II Eudoxus October 6, 2008 p. 135 4.5.1, 4.5.2 p. 136 4.5.3 part a only) p. 140 4.6.1 Exercise 4.5.1 Use the Intermediate Value Theorem to prove that every polynomial of with real

More information

Number of solutions of a system

Number of solutions of a system Roberto s Notes on Linear Algebra Chapter 3: Linear systems and matrices Section 7 Number of solutions of a system What you need to know already: How to solve a linear system by using Gauss- Jordan elimination.

More information

Math 471 (Numerical methods) Chapter 3 (second half). System of equations

Math 471 (Numerical methods) Chapter 3 (second half). System of equations Math 47 (Numerical methods) Chapter 3 (second half). System of equations Overlap 3.5 3.8 of Bradie 3.5 LU factorization w/o pivoting. Motivation: ( ) A I Gaussian Elimination (U L ) where U is upper triangular

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

Exact and Approximate Numbers:

Exact and Approximate Numbers: Eact and Approimate Numbers: The numbers that arise in technical applications are better described as eact numbers because there is not the sort of uncertainty in their values that was described above.

More information

Math 473: Practice Problems for Test 1, Fall 2011, SOLUTIONS

Math 473: Practice Problems for Test 1, Fall 2011, SOLUTIONS Math 473: Practice Problems for Test 1, Fall 011, SOLUTIONS Show your work: 1. (a) Compute the Taylor polynomials P n (x) for f(x) = sin x and x 0 = 0. Solution: Compute f(x) = sin x, f (x) = cos x, f

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

BEKG 2452 NUMERICAL METHODS Solution of Nonlinear Equations

BEKG 2452 NUMERICAL METHODS Solution of Nonlinear Equations BEKG 2452 NUMERICAL METHODS Solution of Nonlinear Equations Ser Lee Loh a, Wei Sen Loi a a Fakulti Kejuruteraan Elektrik Universiti Teknikal Malaysia Melaka Lesson Outcome Upon completion of this lesson,

More information

MA094 Part 2 - Beginning Algebra Summary

MA094 Part 2 - Beginning Algebra Summary MA094 Part - Beginning Algebra Summary Page of 8/8/0 Big Picture Algebra is Solving Equations with Variables* Variable Variables Linear Equations x 0 MA090 Solution: Point 0 Linear Inequalities x < 0 page

More information

Part 2 - Beginning Algebra Summary

Part 2 - Beginning Algebra Summary Part - Beginning Algebra Summary Page 1 of 4 1/1/01 1. Numbers... 1.1. Number Lines... 1.. Interval Notation.... Inequalities... 4.1. Linear with 1 Variable... 4. Linear Equations... 5.1. The Cartesian

More information

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for 1 Algorithms Notes for 2016-10-31 There are several flavors of symmetric eigenvalue solvers for which there is no equivalent (stable) nonsymmetric solver. We discuss four algorithmic ideas: the workhorse

More information

Root Finding Convergence Analysis

Root Finding Convergence Analysis Root Finding Convergence Analysis Justin Ross & Matthew Kwitowski November 5, 2012 There are many different ways to calculate the root of a function. Some methods are direct and can be done by simply solving

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

Mathematics Revision Guide. Algebra. Grade C B

Mathematics Revision Guide. Algebra. Grade C B Mathematics Revision Guide Algebra Grade C B 1 y 5 x y 4 = y 9 Add powers a 3 a 4.. (1) y 10 y 7 = y 3 (y 5 ) 3 = y 15 Subtract powers Multiply powers x 4 x 9...(1) (q 3 ) 4...(1) Keep numbers without

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 2 Solutions of Equations of One Variable

Chapter 2 Solutions of Equations of One Variable Chapter 2 Solutions of Equations of One Variable 2.1 Bisection Method In this chapter we consider one of the most basic problems of numerical approximation, the root-finding problem. This process involves

More information

Advanced Mathematics Unit 2 Limits and Continuity

Advanced Mathematics Unit 2 Limits and Continuity Advanced Mathematics 3208 Unit 2 Limits and Continuity NEED TO KNOW Expanding Expanding Expand the following: A) (a + b) 2 B) (a + b) 3 C) (a + b)4 Pascals Triangle: D) (x + 2) 4 E) (2x -3) 5 Random Factoring

More information

Advanced Mathematics Unit 2 Limits and Continuity

Advanced Mathematics Unit 2 Limits and Continuity Advanced Mathematics 3208 Unit 2 Limits and Continuity NEED TO KNOW Expanding Expanding Expand the following: A) (a + b) 2 B) (a + b) 3 C) (a + b)4 Pascals Triangle: D) (x + 2) 4 E) (2x -3) 5 Random Factoring

More information

LIMITS AND DERIVATIVES

LIMITS AND DERIVATIVES 2 LIMITS AND DERIVATIVES LIMITS AND DERIVATIVES 2.2 The Limit of a Function In this section, we will learn: About limits in general and about numerical and graphical methods for computing them. THE LIMIT

More information

Assessment Report. Level 2, Mathematics

Assessment Report. Level 2, Mathematics Assessment Report Level 2, 2006 Mathematics Manipulate algebraic expressions and solve equations (90284) Draw straightforward non-linear graphs (90285) Find and use straightforward derivatives and integrals

More information

THE REAL NUMBERS Chapter #4

THE REAL NUMBERS Chapter #4 FOUNDATIONS OF ANALYSIS FALL 2008 TRUE/FALSE QUESTIONS THE REAL NUMBERS Chapter #4 (1) Every element in a field has a multiplicative inverse. (2) In a field the additive inverse of 1 is 0. (3) In a field

More information

Lesson 28: Euler-Maclaurin Series and Fourier Series

Lesson 28: Euler-Maclaurin Series and Fourier Series Lesson 28: Euler-Maclaurin Series and Fourier Series restart; Sum of a slowly convergent series The Euler-Maclaurin formula says that an anti-difference for the function, i.e. a function such that, is

More information

Zeros of Functions. Chapter 10

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

More information

Computational project: Modelling a simple quadrupole mass spectrometer

Computational project: Modelling a simple quadrupole mass spectrometer Computational project: Modelling a simple quadrupole mass spectrometer Martin Duy Tat a, Anders Hagen Jarmund a a Norges Teknisk-Naturvitenskapelige Universitet, Trondheim, Norway. Abstract In this project

More information

Grade 8 Chapter 7: Rational and Irrational Numbers

Grade 8 Chapter 7: Rational and Irrational Numbers Grade 8 Chapter 7: Rational and Irrational Numbers In this chapter we first review the real line model for numbers, as discussed in Chapter 2 of seventh grade, by recalling how the integers and then the

More information

Sequences and infinite series

Sequences and infinite series Sequences and infinite series D. DeTurck University of Pennsylvania March 29, 208 D. DeTurck Math 04 002 208A: Sequence and series / 54 Sequences The lists of numbers you generate using a numerical method

More information

Numerical Methods I Solving Nonlinear Equations

Numerical Methods I Solving Nonlinear Equations Numerical Methods I Solving Nonlinear Equations Aleksandar Donev Courant Institute, NYU 1 donev@courant.nyu.edu 1 MATH-GA 2011.003 / CSCI-GA 2945.003, Fall 2014 October 16th, 2014 A. Donev (Courant Institute)

More information

3. Infinite Series. The Sum of a Series. A series is an infinite sum of numbers:

3. Infinite Series. The Sum of a Series. A series is an infinite sum of numbers: 3. Infinite Series A series is an infinite sum of numbers: The individual numbers are called the terms of the series. In the above series, the first term is, the second term is, and so on. The th term

More information

Practice Calculus Test without Trig

Practice Calculus Test without Trig Practice Calculus Test without Trig The problems here are similar to those on the practice test Slight changes have been made 1 What is the domain of the function f (x) = 3x 1? Express the answer in interval

More information

Modeling Prey and Predator Populations

Modeling Prey and Predator Populations Modeling Prey and Predator Populations Alison Pool and Lydia Silva December 15, 2006 Abstract In this document, we will explore the modeling of two populations based on their relation to one another. Specifically

More information

What is proof? Lesson 1

What is proof? Lesson 1 What is proof? Lesson The topic for this Math Explorer Club is mathematical proof. In this post we will go over what was covered in the first session. The word proof is a normal English word that you might

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

Homework 2 - Solutions MA/CS 375, Fall 2005

Homework 2 - Solutions MA/CS 375, Fall 2005 Homework 2 - Solutions MA/CS 375, Fall 2005 1. Use the bisection method, Newton s method, and the Matlab R function fzero to compute a positive real number x satisfying: sinh x = cos x. For each of the

More information

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /8:00-9:30

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /8:00-9:30 ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION 2007-10-23/8:00-9:30 The examination is out of 67 marks. Instructions: No aides. Write your name and student ID number on each booklet.

More information

Review for Chapter 2 Test

Review for Chapter 2 Test Review for Chapter 2 Test This test will cover Chapter (sections 2.1-2.7) Know how to do the following: Use a graph of a function to find the limit (as well as left and right hand limits) Use a calculator

More information

Today s class. Numerical differentiation Roots of equation Bracketing methods. Numerical Methods, Fall 2011 Lecture 4. Prof. Jinbo Bi CSE, UConn

Today s class. Numerical differentiation Roots of equation Bracketing methods. Numerical Methods, Fall 2011 Lecture 4. Prof. Jinbo Bi CSE, UConn Today s class Numerical differentiation Roots of equation Bracketing methods 1 Numerical Differentiation Finite divided difference First forward difference First backward difference Lecture 3 2 Numerical

More information

Numerical Methods in Informatics

Numerical Methods in Informatics Numerical Methods in Informatics Lecture 2, 30.09.2016: Nonlinear Equations in One Variable http://www.math.uzh.ch/binf4232 Tulin Kaman Institute of Mathematics, University of Zurich E-mail: tulin.kaman@math.uzh.ch

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

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

Skill 6 Exponential and Logarithmic Functions

Skill 6 Exponential and Logarithmic Functions Skill 6 Exponential and Logarithmic Functions Skill 6a: Graphs of Exponential Functions Skill 6b: Solving Exponential Equations (not requiring logarithms) Skill 6c: Definition of Logarithms Skill 6d: Graphs

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

1) Get physics under control! Magnitude of force of gravity.! Notice from symmetry is 1-D problem.!

1) Get physics under control! Magnitude of force of gravity.! Notice from symmetry is 1-D problem.! 1) Get physics under control! Magnitude of force of gravity.! Notice from symmetry is 1-D problem.! g = GM e r 2, r R e g = GM( r)r, r R e 2) Get MATLAB under control! g is a vector! in this case we will

More information

4.2 Floating-Point Numbers

4.2 Floating-Point Numbers 101 Approximation 4.2 Floating-Point Numbers 4.2 Floating-Point Numbers The number 3.1416 in scientific notation is 0.31416 10 1 or (as computer output) -0.31416E01..31416 10 1 exponent sign mantissa base

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

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

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark DM559 Linear and Integer Programming LU Factorization Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark [Based on slides by Lieven Vandenberghe, UCLA] Outline

More information

Complex Numbers. Visualize complex functions to estimate their zeros and poles.

Complex Numbers. Visualize complex functions to estimate their zeros and poles. Lab 1 Complex Numbers Lab Objective: Visualize complex functions to estimate their zeros and poles. Polar Representation of Complex Numbers Any complex number z = x + iy can be written in polar coordinates

More information

LINEAR SYSTEMS (11) Intensive Computation

LINEAR SYSTEMS (11) Intensive Computation LINEAR SYSTEMS () Intensive Computation 27-8 prof. Annalisa Massini Viviana Arrigoni EXACT METHODS:. GAUSSIAN ELIMINATION. 2. CHOLESKY DECOMPOSITION. ITERATIVE METHODS:. JACOBI. 2. GAUSS-SEIDEL 2 CHOLESKY

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

Continuum Limit and Fourier Series

Continuum Limit and Fourier Series Chapter 6 Continuum Limit and Fourier Series Continuous is in the eye of the beholder Most systems that we think of as continuous are actually made up of discrete pieces In this chapter, we show that a

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 4: Constructing the Integers, Rationals and Reals

Lecture 4: Constructing the Integers, Rationals and Reals Math/CS 20: Intro. to Math Professor: Padraic Bartlett Lecture 4: Constructing the Integers, Rationals and Reals Week 5 UCSB 204 The Integers Normally, using the natural numbers, you can easily define

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

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