1 / 40

Chapter 1 Introductory Concepts and Calculus Review

Chapter 1 Introductory Concepts and Calculus Review. Introduction. The subjects The derivation of the algorithms The implementation of the algorithms Analyze the algorithms mathematically Accuracy, efficiency, and stability. 1.1 Basic Tools of Calculus. 1.1.1 Taylor ’ s Theorem.

Télécharger la présentation

Chapter 1 Introductory Concepts and Calculus Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 1 Introductory Concepts and Calculus Review

  2. Introduction • The subjects • The derivation of the algorithms • The implementation of the algorithms • Analyze the algorithms mathematically • Accuracy, efficiency, and stability

  3. 1.1 Basic Tools of Calculus 1.1.1 Taylor’s Theorem Integral mean value theorem

  4. Three particular expansions of Taylor’s Theorem where x0= ?

  5. Three particular expansions of Taylor’s Theorem where x0= 0 where x0= 0

  6. Example : ex Let x0= 0 If we want then Finally, n can be found! (here n = 9)

  7. Example : ex p9 (x) p2 (x) exp(x)

  8. Example : ex

  9. Example : ex • The result tells us • We can approximate the exponential function to within 10-6 accuracy using a specific polynomial, and this accuracy holds for all x in a specified interval.

  10. Example 1.1 • Let f (x) = (x+1)1/2, then the second-order Taylor polynomial (computed about x0= 0) is computed as follows: 2

  11. Example 1.2: sin • Function: • Accuracy:

  12. Example 1.3: arctan • Function: http://zh.wikipedia.org/wiki/File:Atan_acot_plot.svg

  13. Example 1.3: arctan • Function: and Let Error term

  14. Example 1.3 : arctan • Please determine the error in a ninth-degree Taylor approximation to the arctangent function. • Since 2n +1 = 9 implies that n = 4, we have

  15. Taylor’s Theorem Expansion Let x x + hand x0x

  16. 1.1.2 Mean Value and Extreme Value Theorems http://en.wikipedia.org/wiki/Mean_value_theorem

  17. 1.1.2 Mean Value and Extreme Value Theorems W

  18. M m 1.1.2 Mean Value and Extreme Value Theorems Critical point Critical point

  19. 1.1.2 Mean Value and Extreme Value Theorems The integral mean value theorem (a corollary of the intermediate value theorem) states that a function continuous on an interval takes on its average value somewhere in the interval. More exactly, if is continuous on , then there exists in such that .

  20. 1.1.2 Mean Value and Extreme Value Theorems

  21. 1.2 Error, Approximate Equality, and Asymptotic Order Notation 1.2.1 Error • A : a quantity(數量) we want to compute • Ah: an approximation(近似值) to that quantity • Relative error (相對誤差) is better. • These errors are both computational errors.

  22. 1.2.2 Notation: Approximate Equality • Approximate equality • It is an equivalence relation, and satisfy the following properties: • Transitive(遞移性): • Symmetric(對稱性): • Reflexive(反身性):

  23. 1.2.3 Notation: Asymptotic Order (Big O)

  24. Example 1.4 • Let • Simple calculus shows that • so that we have • Here

  25. 1.2.3 Notation: Asymptotic Order (Big O)

  26. Example 1.6

  27. 1.3 A Primer on Computer Arithmetic • Computer arithmetic is generally inexact. • While the errors are very small, they can accumulate and dominate the calculation. • Example: floating-point arithmetic • Reference: An Introduction to Computer Science, Chapter 3, Excess System (Excess_127 or Excess_1023) is the sign of the number, f is the fraction (0 <= f <= 1), is the base of the internal number system

  28. IEEE standards for floating-point representation (底數 尾數) (底數 尾數)

  29. Example Show the representation of the normalized number + 26 x 1.01000111001 Solution The sign ispositive. The Excess_127 representation of the exponent is 133. You add extra 0s on the right to make it 23 bits. The number in memory is stored as:01000010101000111001000000000000

  30. Errors • Rounding error v.s. chopping error • Rounding: 四捨五入 • Chopping: 無條件捨去 • Discussion: • Rounding is more accurate but chopping is faster. • The chopping error is indeed lager than the rounding error.

  31. Example • Rounding error • Chopping error

  32. Subtractive Cancellation • If a and b are accurate to 16 decimal digits. What about their difference c = a - b ? • Example: The result c is accurate to 12 digits. • This is because we were subtracting two nearly equal numbers.

  33. Example • Function : • We know that : • Taylor’s Theorem :

  34. ……

  35. 1.5 Simple Approximations • Error function: (probability theory) • It isnot possible to evaluate this integral by means of the fundamental theorem of calculus. • Use Taylor’s Theorem to approximate. where

  36. Substitution: Define So that we have Set where c depends on tand

  37. Apply the Integral Mean Value Theorem: The structured form: where

  38. Use the big O notation: • Use the approximate equality notation: • Simplify: if the values of xbetween 0 and 2 if k >=1 thus

  39. Fundamental Idea • When confronted with a computation that cannot be done exactly, we often replace that relevant function with something simpler that approximates it, and carry out the computation exactly on the simple approximation.

More Related