3

So I've started university again after taking a break and my first assignment in algorithms is to prove whether $f(n)$ is in Big O / Big Omega of $g(n)$. These are the limit rules I have:

$$\lim\limits_{n\to\infty} \frac{f(n)}{g(n)} < \infty \Longrightarrow f \in O(g) \\ \lim\limits_{n\to\infty} \frac{f(n)}{g(n)} = 0 \Longrightarrow f \in o(g) \\ \lim\limits_{n\to\infty} \frac{f(n)}{g(n)} > 0 \Longrightarrow f \in \Omega(g) \\ \lim\limits_{n\to\infty} \frac{f(n)}{g(n)} = \infty \Longrightarrow f \in ω(g)$$

My question is: What is the difference between Big O and Big Omega in terms of limits? Isn't every value bigger than $0$ also smaller than infinity?

Also the following problem: $$\lim\limits_{n\to\infty} \frac{n+\pi}{n-e^{2021}} \text{ with l'Hopital} = \frac{1}{1} = 1$$ So it would be $>0$, so Big Omega, but if I do l'Hopital again, it comes down to zero, meaning small $o$...? Am I missing something here? My brain is still hazy from the long break, so maybe I'm confusing simple things here ;)

Sebastiano
  • 7,649

3 Answers3

3

The Big Omega notation

The definition of the Big Omega $\Omega$ notation may cause confusion. Quoting Wikipedia:

Unfortunately, there are two widespread and incompatible definitions of the statement $$f(x)=\Omega(g(x))\quad (x\rightarrow a),$$ where $a$ is some real number, $∞$, or $−∞$, where $f$ and $g$ are real functions defined in a neighbourhood of $a$, and where $g$ is positive in this neighbourhood. The first one (chronologically) is used in analytic number theory, and the other one in computational complexity theory. When the two subjects meet, this situation is bound to generate confusion.

The Hardy–Littlewood definition

In 1914 Godfrey Harold Hardy and John Edensor Littlewood introduced the new symbol $\Omega$, which is defined as follows

$$f(x)=\Omega(g(x))\ (x\rightarrow\infty)\;\iff\;\limsup_{x \to \infty} \left|\frac{f(x)}{g(x)}\right|> 0$$

The Knuth definition

In 1976 Donald Knuth published a paper to justify his use of the $\Omega$-symbol to describe a stronger property. Knuth wrote: "For all the applications I have seen so far in computer science, a stronger requirement ... is much more appropriate". He defined $f(x)=\Omega(g(x))\Leftrightarrow g(x)=O(f(x))$, in other words $$f(x)=\Omega(g(x))\ (x\rightarrow\infty)\;\iff\;\liminf_{x \to \infty} \left|\frac{f(x)}{g(x)}\right|> 0.$$

Difference between the Big O notation and the Big Omega notation

Since you stated that this exercise is an assignment in algorithms we will use the Knuth definition of $\Omega$. Let's look at the definitions again:

$$f=O(g) \iff \limsup_{x \to \infty} \left|\frac{f(x)}{g(x)}\right| < \infty, \qquad f=\Omega(g)\;\iff\;\liminf_{x \to \infty} \left|\frac{f(x)}{g(x)}\right|> 0$$

We have three major differences here.

  1. Big $O$ is defined as a limit superior, whereas Big $\Omega$ is defined as a limit inferior.

  2. The limit in the Big $O$ definition can be equal to zero, whereas the limit in the $\Omega$ definition has to be strictly greater than zero.

  3. The limit in the $\Omega$ notation is allowed to go to $+\infty$.

So if $f= O(g)$, $|f|$ is asymptotically bounded above by $g$ and if $f=\Omega(g)$, $\lvert f\rvert$ is asymptotically bounded below by $g$.

If we look at the definition with quantifiers, we can also see how these definitions differ, $$ \begin{align} f&=O(g) \iff \exists\ c > 0\ \exists\ x_0 > 0\ \forall\ x > x_0: |f(x)| \le c\cdot|g(x)|,\\ \qquad f&=\Omega(g) \iff \exists\ c > 0\ \exists\ x_0 > 0\ \forall\ x > x_0: c\cdot \lvert g(x)\rvert\le|f(x)|. \end{align} $$

The limit and l'hopital

Let's look at the limit first. By l'hopital the solution is indeed $1$,

$$\lim\limits_{n\to\infty} \frac{n+\pi}{n-e^{2021}}= \lim\limits_{n\to\infty} \frac{\frac{\mathrm{d}}{\mathrm{d}n}(n+\pi)}{\frac{\mathrm{d}}{\mathrm{d}n}(n-e^{2021})} = \frac{1}{1} = 1.$$

One important condition which has to be satisfied if applying l'hopitals rule on $\lim_{x\to c}f(x)/g(x)$ is that $\lim_{x\to c}f'(x)/g'(x)$ must exist. From this it follows that you cannot apply l'hopital on $1/1$, since $\frac{\mathrm{d}}{\mathrm{d}n}(1)/\frac{\mathrm{d}}{\mathrm{d}n}(1)=0/0$ does not exist.

Now we can safely state that

$$n+\pi=\Omega(n-e^{2021})$$

and that

$$n+\pi \neq o(n-e^{2021}).$$

Here $\neq$ is being used loosely. Remark: By definition, if a function is in $\Omega$ it cannot be in $o$.

We may also say that $n+\pi = O(n-e^{2021})$ and the sharper statement $n+\pi \sim n-e^{2021}$, which is equivalent to the limit you evaluated earlier.

T.D
  • 742
vitamin d
  • 5,783
  • Possible typo? In quantifiered definition of $\Omega$ should be existence with $x_0$ and forall with $x$. – zkutch May 02 '21 at 13:08
  • No it's correct. This is the unfortunate confusion with the Hardy-Littlewood and the Knuth definition. You are taking about the latter one, whereas I wrote that $\Omega$ is used in the Hardy-Littlewood definition. Furthermore the Knuth $\Omega$ is defined as a limit inferior and the Hardy-Littlewood $\Omega$ is defined as a limit superior. – vitamin d May 02 '21 at 13:15
  • Do you mean case when Hardy-Littlewood define $\Omega$ as negation of little-$o$ in their paper on 225 page? If yes, then, I think, OP hardly means it, as wrote about first assignment in algorithms, though, anyway, it's good dig in history. – zkutch May 02 '21 at 13:33
  • @zkutch Thanks I overread that it was an assignment in algorithms. I saw the limit $(n+\pi)/(n+e^{2021})$ and this was an indicator for me that it is a problem from number theory/analysis and not from algorithms because of the choice of the constants. – vitamin d May 02 '21 at 13:38
  • By wikipedia, it uses def_1: $\exists k>0,\forall n_{0},\exists n>n_{0}\colon |f(n)|\geq k,g(n)$ for the Hardy-Littlewood definition. If someone has questions about why it is equivalent with def_2: $\limsup _{n\to \infty }{\frac {\left|f(n)\right|}{g(n)}}>0$, I share my thoughts here. Please point out errors if any. Thanks beforehand. ($\limsup$ calculation) – An5Drama Jan 05 '24 at 10:43
  • Here wikipedia assumes $g(x)>0,x\to \infty$. 1. def_1->def_2: since the main body is $\exists n>n_{0},\frac{|f(n)|}{|g(n)|}\ge k$, so it can't ensure $\forall n>n_{0} \ldots$, then not $\liminf$. But $\sup \frac{|f(n)|}{|g(n)|}$ is greater than or equal to all possible $\frac{|f(n)|}{|g(n)|}$, so $\sup \frac{|f(n)|}{|g(n)|}\ge \frac{|f(n)|}{|g(n)|}\ge k>0$. Then take the limit by the above calculation link. – An5Drama Jan 05 '24 at 10:49
  • Take the nearest possible value of $\frac{|f(n)|}{|g(n)|}$ where $n$ meets the requirement $\forall n_{0},\exists n>n_{0}$ (i.e. $n$ can be seen almost as $\infty$), let it be $m$. Then $m>0$ by the sup definition. Then we can let $k=m>0$.
  • – An5Drama Jan 05 '24 at 11:01