Simple question about big O

29 Views Asked by At

If $f(n)=g(n)$, can we just say that $\mathcal{O}(f(n))=\mathcal{O}(g(n))$? ($f$ and $g$ are two $\log$ functions)

Is it definitely yes? if not please describe why.

1

There are 1 best solutions below

6
On

Of course we can. If $f(n)=g(n)$, then $f$ and $g$ are the exact same function, and it doesn't matter whether we use the name $f$ or $g$ to refer to it in any context we choose.