How would you prove that constant is a subset of logarithmic?

  • Level: Undergrad 
  • Thread starter Thread starter aaa59
  • Start date Start date
  • Tags Tags
    Constant Logarithmic
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 4K views
aaa59
Messages
8
Reaction score
0
O(1) is constant
O(log n to the base 2) is logarithmic
O(n) linear

how would you prove that constant is a subset of logartihmic?
 
Physics news on Phys.org
I should have been clearer.

given "Big-Oh" sets
O(1): constant
O(log2(n)): logarithmic
O(n): linear
O(nlog2(n)): n log n
O(n^2): quadratic
O(n^3): cubic
O(n^m), m>1: polynomial of order m
O(c^n), c>1: exponential
O(n!): factorial

Prove
Constant is a subset of logarithmic
logarithmic is a subset of linear
n log n is a subset of polynomial
exponential is a subset of factorial

Thank you
 
aaa59 said:
I should have been clearer.

given "Big-Oh" sets
O(1): constant
O(log2(n)): logarithmic
O(n): linear
O(nlog2(n)): n log n
O(n^2): quadratic
O(n^3): cubic
O(n^m), m>1: polynomial of order m
O(c^n), c>1: exponential
O(n!): factorial

Prove
Constant is a subset of logarithmic
logarithmic is a subset of linear
n log n is a subset of polynomial
exponential is a subset of factorial

Thank you
Most follow fairly easily from the definition of Big-Oh. For instance let f be an arbitrary function in O(1). We now wish to show that f is in [tex]O(\log_n(n))[/tex]. Because of the definition of O(1) there exist some [tex]x_0[/tex] and M such that [tex]f(x) \leq M[/tex] for all [tex]x > x_0[/tex]. Now let [tex]x_1 = \max(x_0,n)[/tex] then [tex]f(x) \leq M \leq M\log_n(x)[/tex] for all [tex]x > x_1[/tex] so [tex]f(x) = O(\log_n(n))[/tex]. Here we took advantage of the fact that the logarithm is increasing and [tex]\log_n(x) \geq 1[/tex] when [tex]x \geq n[/tex].

If you have problems with any specific steps you should post the specific problem you're having.