Calculate big-$\Theta$ for $T(x) = \log(x2x!)$

422 Views Asked by At

$T(x) = \log(x2x!)$

use the property of log, $\log(x2x!)$ is equivalent to $\log(2x) + \log(x!)$

My approach is to prove big-$O$ and big-$\Omega$ for $T(x)$,then big-$\Theta$ just follows.

If I want to calculate big-$O$ and big-$\Omega$ for $T(x)$, can I treat $\log(2x)$ as a constant and ignore it since it's growth rate is so slow compare to $\log(x!)$?

2

There are 2 best solutions below

0
On

This is where Stirling's Approximation comes in handy. The result is that $$ \log(2x \cdot x!) = \Theta\left(x \log x + \log 2 + \log x\right) = \Theta\left(x \log x\right) $$

0
On

You may simply write $$ \log(x!) = \log(x)+ \log(x-1)+ \cdots+ \log(1) < x\log(x). $$

Then, $$ \log(2x)+ \log(x!) < (x+2) \log(x), $$

which is $O(x \log(x))$ as $x \to \infty$.