Big O Notation logarithms

322 Views Asked by At

I'm having trouble with these two Big O notation proofs

(b) $(n + \log_2 n)^5 = \Theta(n^5).$

(b) $(\log_2 n)^5 = O(\log_2 n^5).$

For the first one, I'm having trouble finding a $c$ value to make $f(n) \le cg(n)$, can $c$ be any number?

For the second one, I think that it is false, as $f(n)$ will always be bigger than $g(n)$

1

There are 1 best solutions below

4
On BEST ANSWER

For the first one, notice that

$$\frac{(n + \log_2 n)^5}{n} = \left(1 + \frac{\log_2 n}{n}\right)^5$$

It is necessary to show that this fraction is bounded above and below. The lower bound is easy, since the term in parentheses is at least $1$. The upper bound can be done with the knowledge that $\log_2 n = O(n)$.


For the second one your result is correct but your argument is not. After all, $2n = O(n)$ even though $2n$ is always larger than $n$. The inequality must hold up to a constant, only. To argue correctly, notice that $$\log_2(n^5) = 5 \log_2(n)$$ Now if you know how to show that $x^5 \ne O(x)$, you'll be off to a pretty good start.