Download Asymptotic Notation - Lecture Notes | COP 3503 and more Study notes Computer Science in PDF only on Docsity! COP 3503 – CS II – CLASS NOTES - DAY #3 – Supplemental Asymptotic Notation Big Oh Notation Definition: Let p(n) and q(n) be two nonnegative functions. The function p(n) is asymptotically bigger [p(n) asymptotically dominates q(n)] than the function q(n) iff The function q(n) is asymptotically smaller than p(n) iff p(n) is asympotically bigger than q(n). Functions p(n) and q(n) are asymptotically equal iff neither is asymptotically bigger than the other. Example 1: Let p(n) = 3n2 + 2n + 6 and q(n) = 10n + 7. divide both functions by n2 (to reduce dominant term to a constant) which will produce: Thus, 3n2 + 2n + 6 is asymptotically bigger than 10n + 7. Similarly, 10n + 7 is asymptotically smaller than 3n2 + 2n + 6. Example 2: Let p(n) = 6n + 2 and q(n) = 12n + 6 Day #3 Supplemental Material - 1 0 )n(p )n(q lim n 2/112/6 n/612 n2/6 )nbydivide( 6n12 2n6 lim 23/6 n/26 n/612 )nbydivide( 2n6 6n12 lim n n 6n2n3 7n10 lim 2n 03/0 n/6n/23 n/7n/10 2 2 Try: Show that 8n4 + 9n2 is asymptotically bigger than 100n3 – 3. Also do the same for: 2n2 + 3n and 83n. 08/0 n/98 n/3n/100 n9n8 3n100 lim 2 4 24 3 n A similar technique will show the same is true for the functions 2n2 + 3n and 83n. Term Name 1 Constant Log N Logarithmic N Linear N log N N log N N2 Quadratic N3 Cubic 2N Exponential N! Factorial Asymptotic notation describes the behavior of the time or space complexity for large instance characteristics. When the instance characteristic is described by a single variable, say n, asymptotic notation describes the complexity using a single term, the asymptotically biggest term in the function (step count of algorithm steps). Notation: f(n) = O(g(n)) [read as f(n) is big-oh of g(n)] means that f(n) is asymptotically smaller than or equal to g(n). Meaning: g(n) establishes an upper bound on f(n). The asymptotic growth rate of the function f(n) is bounded from above by g(n). cg(n) m f(n) n g(n) is an upper bound on f(n) Day #3 Supplemental Material - 2