Search code examples
algorithmbig-ocomputer-sciencecomplexity-theory

Is ϴ(n)/n = ϴ(1)?


I came across the following equation:

enter image description here

So is ϴ(n)/n (or ϴ(n)/(n+1)) = ϴ(1)? If yes then please help me understand the reason for that with an example.


Solution

  • ϴ(n) would represent algorithms of complexities such as n, 2n, 3n, 4n, etc. You can think of ϴ(n) as representing something like kn, where k is a positive real number.

    kn/n is of course k which you can likewise think of as what ϴ(1) represents.

    kn/(n+1) converges on k as n->∞. You can use L'Hopital's to confirm this.

    If you're new to Big-Theta and Big-O it helps to read ϴ(n) as "on the order of n"; likewise, ϴ(n2), "on the order of n-squared"; and so on.

    Edit: Note, the tone of my answer is intentionally informal. The accurate conceptualization is to think about ϴ(n) in terms of bounding functions. See Paul Hankins comments below. While in day-to-day use I maintain the understanding above is helpful, I suggest you heed his advice and concern.

    To ensure that at least some of his notes are represented here as well, I add that the formal definition of an O complexity is as follows:

    A function f(x) can be said to be O(g(x)) if there exists |f(x)| <= Mg(x) ∀ x >= x0 where M is a positive real number.

    ϴ(g(x)) also satisfies |f(x)| >= Mg(x) ∀ x >= x0 where M is a positive real number.

    Hopefully, this isn't too much of a leap from the example above. You can now pose the question: is a function bounded by Max divided by x bounded by Mb(1)?