Big Oh vis-a-vis symmetric relation

723 Views Asked by At

I have recently started algorithms. Please clarify following

$f(n)=\mathcal O(g(n))$ iff $\exists n_0,c : f(n)\leq g(n) \forall n \geq n_0$

If $f \leq g$ means either $f<g$ or$ f = g$. If $f=g$ then $g \leq f$ holds right? But then symmetric relation, as is written in my textbook, does not hold. Why?

In case of reflexive relation $f \leq f$ meanns either $f<f$ or $f=f$(here 2nd case is true and so we are taking reflexivity holds in case of Big O notation right)

1

There are 1 best solutions below

0
On BEST ANSWER

If $f=g$, then $f \le g$ and $g \le f$ both hold, correct.

However, $f \le g$ is not symmetric, because you have to make the presumption of equality to even get both to hold. Sometimes the inequality is strict and that case must be accounted for as well. For instance, for $x$ sufficiently large, $x^2 \le x^3$, but we certainly wouldn't say the reverse holds. However, for symmetry to hold, whenever $f \le g$ holds, $g \le f$ must also hold.

And yes, $\le$ is a reflexive relation. This is because $f=f$ for all $f$, and thus $f \le f$ in turn.