Computer Arithmetic - Numerical Analysis - Lecture Notes | MATH 541, Study notes of Mathematics

Material Type: Notes; Class: INTRO NUM ANALYS & COMPUT; Subject: Mathematics; University: San Diego State University; Term: Fall 2002;

Typology: Study notes

Pre 2010

Uploaded on 03/28/2010

koofers-user-xmj
koofers-user-xmj 🇺🇸

10 documents

1 / 63

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Calculus Review
Computer Arithmetic & Finite Precision
Algorithms
Solutions of Equations of One Variable
Numerical Analysis and Computing
Lecture Notes #02 Calculus Review; Computer Artihmetic
and Finite Precision; Algorithms and Convergence;
Solutions of Equations of One Variable
Peter Blomgren,
Department of Mathematics and Statistics
Dynamical Systems Group
Computational Sciences Research Center
San Diego State University
San Diego, CA 92182-7720
http://terminus.sdsu.edu/
Fall 2009
Peter Blomgren, h[email protected]iLecture Notes #02 (1/63)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f

Partial preview of the text

Download Computer Arithmetic - Numerical Analysis - Lecture Notes | MATH 541 and more Study notes Mathematics in PDF only on Docsity!

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Numerical Analysis and Computing

Lecture Notes #02 — Calculus Review; Computer Artihmetic and Finite Precision; Algorithms and Convergence; Solutions of Equations of One Variable

Peter Blomgren, 〈[email protected]

Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center San Diego State University San Diego, CA 92182- http://terminus.sdsu.edu/

Fall 2009 Peter Blomgren, 〈[email protected]〉 Lecture Notes #02 — (1/63)

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Outline

1 Calculus Review Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem (^2) Computer Arithmetic & Finite Precision Binary Representation, IEEE 754- Something’s Missing... Roundoff and Truncation, Errors, Digits Cancellation (^3) Algorithms Algorithms, Pseudo-Code Fundamental Concepts 4 Solutions of Equations of One Variable f (x) = 0, “Root Finding” The Bisection Method When do we stop?! *** Homework #1 ***

Peter Blomgren, 〈[email protected]〉 Lecture Notes #02 — (2/63)

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Background Material — A Crash Course in Calculus

Key concepts from Calculus

  • Limits
  • Continuity
  • Convergence
  • Differentiability
  • Rolle’s Theorem
  • Mean Value Theorem
  • Extreme Value Theorem
  • Intermediate Value Theorem
  • Taylor’s Theorem

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Limit / Continuity

Definition (Limit) A function f defined on a set X of real numbers X ⊂ R has the limit L at x 0 , written xlim→x 0 f^ (x) =^ L if given any real number ǫ > 0 (∀ǫ > 0), there exists a real number δ > 0 (∃δ > 0) such that |f (x) − L| < ǫ, whenever x ∈ X and 0 < |x − x 0 | < δ.

Definition (Continuity (at a point)) Let f be a function defined on a set X of real numbers, and x 0 ∈ X. Then f is continuous at x 0 if

xlim→x 0

f (x) = f (x 0 ).

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Examples: Jump Discontinuity

(^00) 0.2 0.4 0.6 0.8 1

1

2

The function

f (x) =

x + 12 sin(2πx) x < 0. 5 x + 12 sin(2πx) + 1 x > 0. 5

has a jump discontinuity at x 0 = 0.5.

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Examples: “Spike” Discontinuity

0 0.2 0.4 0.6 0.8 1

0

1

The function

f (x) =

1 x = 0. 5 0 x 6 = 0. 5

has a discontinuity at x 0 = 0.5.

The limit exists, but

lim x→ 0. 5

f (x) = 0 6 = 1

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Illustration: Convergence of a Complex Sequence

2 1 3 4

k>=N

N−

N−

A sequence in z = {zk }∞ k=1 converges to z 0 ∈ C (the black dot) if for any ǫ (the radius of the circle), there is a value N (which depends on ǫ) so that the “tail” of the sequence zt = {zk }∞ k=N is inside the circle.

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Differentiability

Theorem If f is a function defined on a set X of real numbers and x 0 ∈ X , the the following statements are equivalent: (a) f is continuous at x 0 (b) If {xn}∞ n=1 is any sequence in X converging to x 0 , then limn→∞ f (xn) = f (x 0 ).

Definition (Differentiability (at a point)) Let f be a function defined on an open interval containing x 0 (a < x 0 < b). f is differentiable at x 0 if

f ′(x 0 ) = (^) xlim→x 0 f^ (x x) −−^ fx^ (x^0 ) 0

exists.

If the limit exists, f ′(x 0 ) is the derivative at x 0.

Definition (Differentiability (in an interval)) If f ′(x 0 ) exists ∀x 0 ∈ X , then f is differentiable on X.

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Continuity / Rolle’s Theorem

Theorem (Differentiability ⇒ Continuity) If f is differentiable at x 0 , then f is continuous at x 0.

Theorem (Rolle’s Theorem Wiki-Link^ ) Suppose f ∈ C [a, b] and that f is differentiable on (a, b). If f (a) = f (b), then ∃c ∈ (a, b): f ′(c) = 0.

a c b

f’(c)=

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Mean Value Theorem

Theorem (Mean Value Theorem Wiki-Link^ ) If f ∈ C [a, b] and f is differentiable on (a, b), then ∃c ∈ (a, b): f ′(c) =

f (b) − f (a) b − a

a c b

f’(c)=[f(b)−f(a)] / [b−a]

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Intermediate Value Theorem

Theorem (Intermediate Value Theorem Wiki-Link^ ) if f ∈ C [a, b] and K is any number between f (a) and f (b), then there exists a number c in (a, b) for which f (c) = K.

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Taylor’s Theorem

Theorem (Taylor’s Theorem Wiki-Link^ ) Suppose f ∈ C n[a, b], f (n+1)∃ on [a, b], and x 0 ∈ [a, b]. Then ∀x ∈ (a, b), ∃ξ(x) ∈ (x 0 , x) with f (x) = Pn(x) + Rn(x) where

Pn(x) =

∑^ n

k=

f (k)(x 0 ) k!

(x−x 0 )k^ , Rn(x) =

f (n+1)(ξ(x)) (n + 1)!

(x−x 0 )(n+1).

Pn(x) is called the Taylor polynomial of degree n, and Rn(x) is the remainder term (truncation error).

This theorem is extremely important for numerical analysis; Taylor expansion is a fundamental step in the derivation of many of the algorithms we see in this class (and in Math 693ab).

Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Limits, Continuity, and Convergence Differentiability, Rolle’s, and the Mean Value Theorem Extreme Value, Intermediate Value, and Taylor’s Theorem

Taylor Expansions — Matlab

A Taylor polynomial of degree n requires all derivatives up to order n, and order n + 1 for the remainder. Derivatives may be [more] complicated expression [than the original function]. Matlab can compute derivatives for you:

Matlab: Symbolic Computations Try this!!!

syms x diff(sin(2x)) diff(sin(2x),3) taylor(exp(x),5) taylor(exp(x),5,1)

Calculus Review Computer Arithmetic & Finite PrecisionAlgorithms Solutions of Equations of One Variable

Binary Representation, IEEE 754- Something’s Missing...Roundoff and Truncation, Errors, Digits Cancellation

Computer Arithmetic and Finite Precision

Computer Arithmetic and Finite Precision

Peter Blomgren, 〈[email protected]〉 Computer Arithmetic & Finite Precision — (20/63)