errors scientific notation
play

Errors Scientific Notation In scientific notation , a number can be - PowerPoint PPT Presentation

Errors Scientific Notation In scientific notation , a number can be expressed in the form = 10 ! where is a coefficient in the range 1 < 10 and is the exponent. 1165.7 = 0.0004728 = Binary numbers We will


  1. Errors

  2. Scientific Notation In scientific notation , a number can be expressed in the form 𝑦 = Β± 𝑠 Γ— 10 ! where 𝑠 is a coefficient in the range 1 ≀ 𝑠 < 10 and 𝑛 is the exponent. 1165.7 = 0.0004728 =

  3. Binary numbers Β— We will soon be learning about how numbers are represented in the computer. Β— Before we introduce this new concept, make sure to revise binary number representation. You will need to know how to convert form binary numbers to decimal numbers and vice-versa. Β— To help you with the review, I added a PrairieLearn homework assignment, where you can get extra credit points (counting towards the β€œshort questions”).

  4. Error in Numerical Methods Β— Every result we compute in Numerical Methods contain errors! Β— We always have them… so our job? Reduce the impact of the errors Β— How can we model the error? Approximate result = True Value + Error 𝑦 = 𝑦 + βˆ†π‘¦ + Β— Absolute error: 𝑦 βˆ’ Μ‚ 𝑦 Β— Relative error: 1 23 1 !

  5. Β— Absolute errors can be misleading, depending on the magnitude of the true value 𝑦 . Β— For example, let’s assume an absolute error βˆ†π‘¦ = 0.1 q 𝑦 = 10 " β†’ . 𝑦 = 𝑦 + βˆ†π‘¦ = 10 " + 0.1 (accurate result) q 𝑦 = 10 #" β†’ . 𝑦 = 𝑦 + βˆ†π‘¦ = 10 #" + 0.1 (inaccurate result) Β— Relative error is independent of magnitude.

  6. You are tasked with measuring the height of a tree which is known to be exactly 170 ft tall. You later realized that your measurement tools are somewhat faulty, up to a relative error of 10%. What is the maximum measurement for the tree height (numbers rounded to 3 sig figs)? A) 153 ft B) 155 ft C) 187 ft D) 189 ft

  7. You are tasked with measuring the height of a tree and you get the measurement as 170 ft tall. You later realized that your measurement tools are somewhat faulty, up to a relative error of 10%. What is the minimum height of the tree (numbers rounded to 3 sig figs) ? A) 153 ft B) 155 ft C) 187 ft D) 189 ft

  8. Significant digits Significant figures of a number are digits that carry meaningful information. They are digits beginning to the leftmost nonzero digit and ending with the rightmost β€œcorrect” digit, including final zeros that are exact. The number 3.14159 has _____ significant digits. The number 0.00035 has _____ significant digits. The number 0.000350 has ______ significant digits.

  9. Suppose 𝑦 is the true value and % 𝑦 the approximation. The number of significant figures tells us about how many positions of π’š and ' π’š agree. Suppose the true value is 𝑦 = 3.141592653 And the approximation is 𝑦 = 3.14 1 We say that 1 𝑦 has ______ significant figures of 𝑦 Let’s try the same for: 2) 1 𝑦 = 3.14159 3) 1 𝑦 = 3.1415

  10. 𝑦 has 𝒐 significant figures of 𝑦 if 𝑦 βˆ’ . . 𝑦 has zeros in the first π‘œ decimal places counting from the leftmost nonzero (leading) digit of 𝑦 , followed by a digit from 0 to 4. 𝑦 = 3.141592653 𝑦 = 0.000002653 = 2.653Γ—10 !" ⟢ 1 𝑦 = 3.14159 ⟢ 𝑦 βˆ’ 1 1 𝑦 has 6 sf 6 zeros 𝑦 = 0.000092653 = 0.92653Γ—10 !# ⟢ 1 𝑦 = 3.1415 ⟢ 𝑦 βˆ’ 1 1 𝑦 has 4 sf 5 zeros 𝑦 = 0.000007347 = 0.7347Γ—10 !$ ⟢ 1 𝑦 = 3.1416 ⟢ 𝑦 βˆ’ 1 1 𝑦 has 5 sf 6 zeros

  11. 𝑦 has 𝒐 significant figures of 𝑦 if 𝑦 βˆ’ . . 𝑦 has zeros in the first π‘œ decimal places counting from the leftmost nonzero (leading) digit of 𝑦 , followed by a digit from 0 to 4. 𝑦 ≀ 5Γ—10 #7 . Note that the exact So far, we can observe that 𝑦 βˆ’ . number in this example can be written in the scientific notation form 𝑦 = π‘ŸΓ—10 8 . What happens when the exponent is not zero? We use the relative error definition instead! )Γ—'( "# '( ! !# $ !# $ % Γ—10 #* ≀ 5Γ—10 #* ! ! ) 𝑓 " = = %Γ—'( ! ≀ = %Γ—'( ! !

  12. Accurate to n significant digits means that you can trust a total of n digits. Accurate digits is a measure of relative error. π‘œ is the number of accurate significant digits ! !"#$% "! #&&'(" ≀ 5Γ—10 "# Relative error: 𝑓𝑠𝑠𝑝𝑠 = ! !"#$% In general, we will use the rule-of-thumb: 𝒇𝒔𝒔𝒑𝒔 = π’š π’‡π’šπ’ƒπ’…π’– βˆ’ π’š π’ƒπ’’π’’π’”π’‘π’š ≀ 𝟐𝟏 #𝒐A𝟐 π’š π’‡π’šπ’ƒπ’…π’– For example, if relative error is 10 !% then 1 𝑦 has at most 3 significant figures of 𝑦

  13. After rounding, the resulting number has 5 accurate digits. What is the tightest estimate of the upper bound on my relative error? A) 10 " B) 10 #" C) 10 C D) 10 #C

  14. Sources of Error Main source of errors in numerical computation: Β— Rounding error: occurs when digits in a decimal point (1/3 = 0.3333...) are lost (0.3333) due to a limit on the memory available for storing one numerical value. Β— Truncation error: occurs when discrete values are used to approximate a mathematical expression (eg. the approximation sin πœ„ β‰ˆ πœ„ for small angles πœ„ )

  15. Let’s first talk about plots…

  16. β€’ Power functions: 𝑧 = 𝑏 𝑦 $ log 𝑧 = log 𝑏 𝑦 $ = log 𝑏 + log 𝑦 $ = log 𝑏 + b log 𝑦 𝑧 = K K 𝑏 + 𝑐 Μ… 𝑦

  17. β€’ Exponential functions: 𝑧 = 𝑏 $% log 𝑧 = log 𝑏 $% = 𝑐 𝑦 log 𝑏 𝑧 = K K 𝑐 𝑦

  18. Big-O notation

  19. Complexity: Matrix-matrix multiplication For a matrix with dimensions π‘œ Γ— π‘œ , the computational complexity can be represented by a power function: 𝑒𝑗𝑛𝑓 = 𝑑 π‘œ D We could count the total number of operations to determine the value of the constants above, but instead, we will get an estimate using a numerical experiment where we perform several matrix-matrix multiplications for vary matrix sizes, and store the time to take to perform the operation.

  20. For a matrix with dimensions π‘œ Γ— π‘œ , the computational complexity can be represented by a power function: 𝑒𝑗𝑛𝑓 = 𝑑 π‘œ D What type of plot will result in a straight line? A) semilog-x B) semilog-y C)log-log

  21. Power functions are represented by straight lines in a log-log plot, where the coefficient 𝑏 is determined by the slope of the line. 𝑒𝑗𝑛𝑓 = 𝑑 π‘œ & Demo: Cost of Matrix-Matrix Multiplication

  22. Instead of predicting time using 𝑒𝑗𝑛𝑓 = 𝑑 π‘œ & , we can use the big-O notation to write 𝑒𝑗𝑛𝑓 = 𝑃(π‘œ & ) where 𝑏 can be obtained from the slope of the straight line. For a matrix-matrix multiplication, what is the value of 𝑏 ? Demo: Cost of Matrix-Matrix Multiplication

  23. As we mentioned previously, we can also get the complexity by counting the number of operations needed to perform the computation:

  24. Big-Oh notation Let 𝑔 and 𝑕 be two functions. Then 𝑔 𝑦 = 𝑃 𝑕 𝑦 as 𝑦 β†’ ∞ If an only if there is a positive constant M such that for all sufficiently large values of 𝑦 , the absolute value of 𝑔 𝑦 is at most multiplied by the absolute value of 𝑕 𝑦 . In other words, there exists a value 𝑁 and some 𝑦 8 such that: 𝑔 𝑦 ≀ 𝑁 𝑕 𝑦 βˆ€ 𝑦 β‰₯ 𝑦 *

  25. Example: Consider the function 𝑔 𝑦 = 2𝑦 + + 27𝑦 + 1000 When 𝑦 β†’ ∞ , the term 𝑦 + is the most significant, and hence, 𝑔 𝑦 = 𝑃(𝑦 + )

  26. Accuracy: approximating sine function The sine function can be expressed as an infinite series: 𝑔 𝑦 = sin 𝑦 = 𝑦 βˆ’ 𝑦 & 6 + 𝑦 ' 120 βˆ’ 𝑦 ( 5040 + β‹― (we will discuss these approximations later) Suppose we approximate 𝑔 𝑦 as P 𝑔(𝑦) = 𝑦 We can define the error as: 𝑔(𝑦) = βˆ’ 𝑦 & 6 + 𝑦 ' 120 βˆ’ 𝑦 ( 𝐹 = 𝑔 𝑦 βˆ’ P 5040 + β‹― Or we can use the Big-O notation to say: 𝑭 = 𝑷 π’š πŸ’

  27. Big-Oh notation (continue) Let 𝑔 and 𝑕 be two functions. Then 𝑔 𝑦 = 𝑃 𝑕 𝑦 as 𝑦 β†’ 𝑏 If an only if there exists a value 𝑁 and some πœ€ such that: 𝑔 𝑦 ≀ 𝑁 𝑕 𝑦 βˆ€π‘¦ π‘₯β„Žπ‘“π‘ π‘“ 0 < |𝑦 βˆ’ 𝑏| < πœ€

  28. Same example… Consider the function 𝑔 𝑦 = 2𝑦 + + 27𝑦 + 1000 When 𝑦 β†’ 0 , the constant 1000 is the dominant part of the function. Hence, 𝑔 𝑦 = 𝑃(1)

  29. Iclicker question Suppose that the truncation error of a numerical method is given by the following function: 𝐹 β„Ž = 5β„Ž + + 3β„Ž Which of the following functions are Oh-estimates of 𝐹 β„Ž as β„Ž β†’ 0 Mark the correct 1) answer: 2) A) 1 and 2 3) B) 2 and 3 4) C) 2 and 4 D) 3 and 4 E) NOTA

  30. Iclicker question Suppose that the complexity of a numerical method is given by the following function: 𝑑 π‘œ = 5π‘œ + + 3π‘œ Which of the following functions are Oh-estimates of 𝑑 π‘œ as π‘œ β†’ ∞ 1) O(5π‘œ P + 3π‘œ) Mark the correct 2) O(π‘œ P ) answer: 3) O(π‘œ Q ) A) 1,2,3 4) O(π‘œ) B) 1,2,3,4 C) 4 D) 3 E) NOTA

  31. Select the function that best represents the decay of the error as π‘œ increases A) 𝑓 !"# B) 𝑓 !# C) π‘œ !$ D) π‘œ !"

  32. Rates of convergence 𝑓𝑠𝑠𝑝𝑠~ 1 ' or 𝑃 1) Algebraic convergence: * ) π‘œ + or 𝑃 π‘œ + 𝑒𝑗𝑛𝑓~π‘œ + Algebraic growth: 𝛽: Algebraic index of convergence A sequence that grows or converges algebraically is a straight line in a log-log plot. Demo β€œExponential, Algebraic and Geometric convergence”

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend