Presentation is loading. Please wait.

Presentation is loading. Please wait.

Big Omega, Theta Defn: T(N) = (g(N)) if there are positive constants c and n0 such that T(N)  c g(N) for all N  n0 . Lingo: “T(N) grows no slower than.

Similar presentations


Presentation on theme: "Big Omega, Theta Defn: T(N) = (g(N)) if there are positive constants c and n0 such that T(N)  c g(N) for all N  n0 . Lingo: “T(N) grows no slower than."— Presentation transcript:

1 Big Omega, Theta Defn: T(N) = (g(N)) if there are positive constants c and n0 such that T(N)  c g(N) for all N  n0 . Lingo: “T(N) grows no slower than g(N).” Defn: T(N) = (h(N)) if and only if T(N) = O(h(N)) and T(N) = (h(N)). Big-Oh, Omega, and Theta establish a relative order among all functions of N. Oct 8, 2001 CSE 373, Autumn 2001

2 Intuition, little-Oh Defn: T(N) = o(p(N)) if T(N) = O(p(N)) and T(N)  (p(N)). notation intuition O (Big-Oh)  (Big-Omega)  (Theta) = o (little-Oh) < Oct 8, 2001 CSE 373, Autumn 2001

3 More about Asymptotics
Fact: If f(N) = O(g(N)), then g(N) = (f(N)). Proof: Suppose f(N) = O(g(N)). Then there exist constants c and n0 such that f(N)  c g(N) for all N  n0. Then g(N)  f(N) for all N  n0, and so g(N) = (f(N)). Oct 8, 2001 CSE 373, Autumn 2001

4 More terminology Suppose T(N) = O(f(N)).
f(N) is an upper bound on T(N). T(N) grows no faster than f(N). Suppose T(N) = (g(N)). g(N) is a lower bound on T(N). T(N) grows at least as fast as g(N). If T(N) = o(h(N)), then we say that T(N) grows strictly slower than h(N). Oct 8, 2001 CSE 373, Autumn 2001

5 Style If f(N) = 5N, then f(N) = O(N5) f(N) = O(N3)
f(N) = O(N)  preferred f(N) = O(N log N) Ignore constant factors and low order terms. T(N) = O(N), not T(N) = O(5N). T(N) = O(N3), not T(N) = O(N3 + N2 + N log N). Bad style: f(N)  O(g(N)). Wrong: f(N)  O(g(N)). Oct 8, 2001 CSE 373, Autumn 2001

6 Facts about Big-Oh If T1(N) = O(f(N)) and T2(N) = O(g(N)), then
T1(N) + T2(N) = O(f(N) + g(N)). T1(N) * T2(N) = O(f(N) * g(N)). If T(N) is a polynomial of degree k, then T(N) = (Nk). log k N = O(N), for any constant k. Oct 8, 2001 CSE 373, Autumn 2001

7 Techniques Algebra ex. f(N) = N / log N, g(N) = log N.
same as asking which grows faster, N or log 2 N. Evaluate . limit is Big-Oh relation f(N) = o(g(N)) c  0 f(N) = (g(N)) g(N) = o(f(N)) no limit no relation Oct 8, 2001 CSE 373, Autumn 2001

8 Techniques, cont’d L’Hôpital’s rule: If and , then .
example: f(N) = N, g(N) = log N. Use L’Hôpital’s rule. f’(N) = 1, g’(N) = 1/N.  g(N) = o(f(N)). Oct 8, 2001 CSE 373, Autumn 2001


Download ppt "Big Omega, Theta Defn: T(N) = (g(N)) if there are positive constants c and n0 such that T(N)  c g(N) for all N  n0 . Lingo: “T(N) grows no slower than."

Similar presentations


Ads by Google