Is $(\log n)^{\log \log n}$ polynomial-time?

1.2k Views Asked by At

Is the following running time polynomial?

$$O((\log n)^{\log \log n})$$

How do I compare it with $O(n^k)$, where $k$ is a constant?

Definition: If an Algorithm running time $T(n)$ is polynomial time, then we can find a constant $C,k$, that $T(n)<Cn^k$.

Example: $2^{\sqrt{\log n}} <2^{\log n}<2^{k\log n}=2^{\log n^k}=n^k$, then $O(2^{\sqrt{\log n}})$ is polynomial time.

2

There are 2 best solutions below

2
On BEST ANSWER

$$(\log n) ^ {\log\log n} = e ^ {(\log \log n) ^ 2} = n ^ {\frac{(\log \log n) ^ 2}{\log n}} < n$$

for almost all $n$

0
On

$\log (\log n^{\log\log n}) = (\log\log n)^2$ and $\log n^k =k\log n$ (where k>0). On the other hand, $$\lim_{n\rightarrow \infty} \frac{(\log\log n)^2}{k\log n} = \lim_{x\rightarrow \infty} \frac{\log^2 x}{kx} = 0,$$ using the L'Hospital rule twice. So $O(\log n^{\log\log n})<O(n^k)$, for any $k>0$.