21 - 11/17/10 20:56:10 21 CS 61B: Lecture 21 Friday,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
11/17/10 20:56:10 1 21 CS 61B: Lecture 21 Friday, October 15, 2010 ASYMPTOTIC ANALYSIS (continued): More Formalism ================================================ |-----------------------------------------------------------------------------| | Omega(f(n)) is the set of all functions T(n) that satisfy: | | | | There exist positive constants d and N such that, for all n >= N, | | T(n) >= d f(n) | |-----------------------------------------------------------------------------| ^^^^^^^^^^ Compare with the definition of Big-Oh: T(n) <= c f(n). ^^^^^^^^^^^ Omega is the reverse of Big-Oh. If T(n) is in O(f(n)), f(n) is in Omega(T(n)). 2n is in Omega(n) BECAUSE n is in O(2n). n^2 is in Omega(n) BECAUSE n is in O(n^2). n^2 is in Omega(3 n^2 + n log n) BECAUSE 3 n^2 + n log n is in O(n^2). Big-Omega gives us a LOWER BOUND on a function, just as Big-Oh gives us an UPPER BOUND. Big-Oh says, "Your algorithm is at least this good." Big-Omega says, "Your algorithm is at least this bad." Recall that Big-Oh notation can be misleading because, for instance, n is in O(n^8). If we know both a lower bound and an upper bound for a function, and they’re both the same bound asymptotically (i.e. they differ only by a constant factor), we can use Big-Theta notation to precisely specify the function’s asymptotic behavior. |-----------------------------------------------------------------------------| | Theta(f(n)) is the set of all functions that are in both of | | | | O(f(n)) and Omega(f(n)). | |-----------------------------------------------------------------------------| But how can a function be sandwiched between f(n) and f(n)? Easy: we choose different constants (c and d) for the upper bound and lower bound. For instance, here is a function T(n) in Theta(n): c f(n) = 10 n ^ / | / T(n) | / ** | / * * | / *** * ** | / * * * | *** / * * * | ** ** / * * * |* ** * * * * / * * ** * | / ** *** ˜˜˜ | / ˜˜˜˜˜ | / ˜˜˜˜˜ | / ˜˜˜˜˜ | / ˜˜˜˜˜ d f(n) = 2 n | / ˜˜˜˜˜ |/ ˜˜˜˜˜ O˜˜------------------------------> n
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

21 - 11/17/10 20:56:10 21 CS 61B: Lecture 21 Friday,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online