The Sets O(g), Θ(g), Ω(g)

  • Let f and g be a functions from the non-negative integers into the positive real numbers
  • For some real constant c > 0 and some non-negative integer constant n0
    • O(g) is the set of functions f, such that:
      • f(n) c * g(n) for all nn0
    • Ω(g) is the set of functions f, such that:
      • f(n) c * g(n) for all nn0
    • Θ(g) = O(g) ∩ Ω(g)
      • Θ(g) is the asymptotic order of g or the order of g

Big-Oh Examples

f(n) ∈ O(g(n)) means that there are positive constants c and n0 such that f(n) ≤ c*g(n) for all values nn0

 
  • Is n ∈ O(n2)?
    • Yes, c = 1, n0 = 2 works fine
  • Is 10n ∈ O(n)?
    • Yes, c = 11, n0 = 2 works fine
  • Is n2 ∈ O(n)?
    • No; no matter what values for c and n0 we pick, n2 > c*n for big enough n

Given f ∈ O(h) and g ∉ O(h),
which of these are true?

  1. For all positive integers m, f(m) < g(m).
  2. For some positive integer m, f(m) < g(m).
  3. For some positive integer m0, and all positive integers m > m0, f(m) < g(m).
  4. 1 and 2
  5. 2 and 3
  6. 1 and 3