What is the relative time complexity for f(n) = loglog(n), g(n) = log(n)

398 Views Asked by At

I know the answer is f(n) is Big O of g(n). enter image description here

This is the graph for f(n) and g(n). Here when C is 1, this is the case and f(n) is upper bounded by g(n).

When I'm giving 0.1 as the C value, as shown below, we see that for sufficiently large values of n, f(n) is actually lower bounded by g(n).

enter image description here

Does this mean f(n) is actually big theta(g(n)) or am I missing something?

1

There are 1 best solutions below

0
On BEST ANSWER

in the equivalent definition, $f(n)$ is $\theta(g(n))$ iff $lim_{x\to \infty} \frac {f(n)}{g(n)}=c, c\in \Bbb R\setminus \{0\}$. but, according to L'Hôpital's rule, $lim_{x\to \infty} \frac {\log\log(x)}{0.1\log(x)}=lim_{x\to \infty} \frac {\frac {1}{xlogx}}{\frac {1}{10x}} = lim_{x\to \infty} \frac{10x}{x\log(x)}= lim_{x\to \infty} \frac {10}{log(x)}=0$, and therfore, even if its looks like $f(n)$ lower bounded by $g(n)$, at the very very end (much greater values that we checked in those graphs) $f(n)$ is upper bounded by $g(n)$.