1
$\begingroup$

I know the definition of big $\mathcal O$ is:

$g(n) = \mathcal O(f(n))$ if and only if for some constants $c$ and $n_0$, $|g(n)| \leq c\cdot|f(n)|$ for all $n\ge n_0$

All I want to know is why this alternative definition is wrong:

$g(n) = \mathcal O(f(n))$ if and only if $|g(n)/f(n)|$ is bounded from above as $n → ∞$,

I guess it is because $f(n)$ may approach $0$ and division by $0$ is not defined, but I would like to see an example (I couldn't find any one). Please tell me if I'm on the right path.

I hope you can help me.

  • 0
    So what happens in the two definitions if $f$ generates the sequence $1,16,9,4,0,0,0,0\ldots$ and $g$ the sequence $1,4,3,2,0,0,0,0\ldots$ ?2017-01-30
  • 1
    Your second definition is correct if $f(n)\neq 0$ for all $n\ge n_0$ for some $n_0$, otherwise it is not correct2017-01-30
  • 0
    The first definition should have $\leq$, not $<$, otherwise the sequence $0,1,0,1,0,1,\ldots$ is not $O(\cdots)$ of itself.2017-01-30
  • 0
    Thanks you all for your answers, I think I understand what is the problem with the second definition, just wanted to find a good example where it fails2017-01-30

0 Answers 0