0
$\begingroup$

Say I have a function f(n) = 4n + log n, I know this would be in Θ (n), because with a large input, n or (4n) is much more significant than log n. It grows much slower. My question is that if I am not sure which side of the polynomial is more significant ( 4n or log n), how would I approach such a problem. You may use the same example or any other example to show me how.

Note: You may assume f(x) can be expressed in term of big Θ. Thanks a lot for the your effort, guys! I really appreciate your help.

Thanks again.

  • 0
    Not sure to understand your question. Could you please rephrase it ?2017-02-25

2 Answers 2

2

Among $4n$ and $\log(n)$, the most significant term is clearly $4n$, and that's because :

$$\lim_{n\to\infty}\frac{\log(n)}{n}=0$$

Indeed, if you factor the whole expression by $4n$, you get :

$$4n+\log(n)=4n\left(1+\frac{\log(n)}{4n}\right)$$

and the parenthesis has limit $1$ as $n\to\infty$.

  • 0
    Should not the denumerator be 4n ?2017-02-25
  • 0
    @Rain: ooooooops !2017-02-25
  • 0
    I just have one inquiry, if you were to write the Limt notation in this equation after factorization, how would you write it? Lim n→∞ (1+log(n) /4n)? leaving the 4n alone ?2017-02-25
  • 0
    of course yes, because $\lim_{n\to\infty}\left(4n+\log(n)\right)=+\infty$2017-02-25
1

It is useful to memorize some common terms. Specifically, we have $$ \Theta(1) < \Theta(\log \log n) < \Theta(\log n) < \Theta((\log n)^{c_1}) < \Theta(n^{c_2}) < \Theta(n) < \Theta(n\log n) < \Theta(n^2) < \Theta((c_3)^n) < \Theta(n!) $$ where $c_1 > 1, 0 < c_2 < 1$ and $c_3 > 1$ are constants.