Big Oh and Big Omega clarification

88 Views Asked by At

Can I get an explanation of:

Can g(n) be Big O of $n^{2}$ and also the Big O of $n^{3}$? (at the same time)

Can g(n) be Big Omega of $\Omega (n)$ and also be the Big O of $n$?

1

There are 1 best solutions below

2
On BEST ANSWER

For your first question: if $g(n)=O(n^2)$, then $g(n)=O(n^{2+k})$ for all $k>0$. Indeed, $g(n)=O(n^2)$ means that $$ \limsup_{n\to\infty}\frac{|g(n)|}{n^2}<\infty, $$ and we also have $$ \frac{|g(n)|}{n^{2+k}}\leq\frac{|g(n)|}{n^2} $$ if $k>0$.

The answer to your second question is yes. After all, it is possible that $g(n)=n$.