-2

I need help with a home task with computer science. the problem is: compare the two complexity functions: $F(n) = n^{10\log n}$ and $G(n) = (\log n)^n$. Which is $O(\ )$ of the other? Which is $\Omega(\ )$ of the other?

David Richerby
  • 81,689
  • 26
  • 141
  • 235

3 Answers3

1

$F(n) = n^{10\log{n}}$ and $G(n) = (\log{n})^n$

The crux of the solution is to take $\log$ on both sides of both functions to get $$F'(n) = \log{F(n)} = 10\log^2{n}$$ $$G'(n) = \log{G(n)} = n\log\log{n}$$ $$\exists c,N \, s.t. \ \log^2n \le c*n\log\log n \ \ \forall n > N$$

I'll leave the proof of the above statement to you as an exercise. Thus we can now conclude that

$$\implies F'(n) = \mathcal{O}(G'(n))$$ $$\implies e^{F'(n)} = \mathcal{O}(e^{G'(n)}) $$ $$\implies F(n) = \mathcal{O}(G(n))$$

This is due to the fact that $\log(x)$ is a monotonically increasing function. This should be sufficient for you to proceed further for $\Omega$.

Banach Tarski
  • 1,198
  • 8
  • 20
  • can you show me your proof for that? I don't really like my solution using lapital... can you help me? – Itamar Silverstein Mar 15 '16 at 17:13
  • @ItamarSilverstein proof for which part? – Banach Tarski Mar 15 '16 at 17:14
  • for log(n)log(n)<= c n*log(log(n)) – Itamar Silverstein Mar 15 '16 at 17:20
  • At $n = 2, \log^2{n} = 1$ and $n = 2$. Now observe differentiate both functions and observe the rate of growth of both functions.

    For $f(n) = n, f'(n) = 1$ and for $g(n) = \log^2{n}, g'(n) = \frac{2\log n}{n}$

    $g'(n) \le f'(n) \ \forall n > 2$ Integrating on both sides we obtain $g(n) \le f(n) + c \implies \log^{n} \in \mathcal{O}(n) \implies \log^{n} \in \mathcal{O}{(n\log\log{n})}$

    – Banach Tarski Mar 15 '16 at 17:48
  • but the function is not f(n) = n. it is f(n) = log(n)log(n), and g(n) is nlog(log(n)). – Itamar Silverstein Mar 15 '16 at 17:58
  • I showed $\log^2{n} \in \mathcal{O}(n)$ and used the known fact that $\mathcal{O}(n) \in \mathcal{O}(n\log\log{n})$ to show that $\log^2 n$ is also in $\mathcal{O}(n\log\log{n})$ – Banach Tarski Mar 15 '16 at 18:01
  • I really wish you try this yourself now, it is not that hard. Hint: for $n > 2, 2\log n \le n$ – Banach Tarski Mar 15 '16 at 18:14
1

[Note: this probably should be a comment, but it's too long and I don't like comments that need to be split over multiple entries.]

You need to be a bit careful with these arguments, since it's not always the case that $$\log f(n)\in O(\log g(n))\Longrightarrow f(n)\in O(g(n))$$ Consider, for example, $f(n)=3^n, g(n)=2^n$. We obviously have $\log 3^n\in O(\log 2^n)$, since $n\log3\in O(n\log 2)$, but we can't conclude from that that $3^n\in O(2^n)$.

See here for a further discussion. By the way, in this particular case, Banach Tarski's answer was correct.

Rick Decker
  • 14,826
  • 5
  • 42
  • 54
0

You can also solve this problem by rewriting $n^{10 \log(n)} = e^{10 \log^2(n)}$.

Now, in $(\log(n))^n$, both the base and the exponent grow asymptotically faster.

This is not completely rigorous, but can at least help to give the idea for which function is the $O$ of which function.

wythagoras
  • 355
  • 3
  • 15