Asymptotic Notations Proof

295 Views Asked by At

I'd like to know if my proof is right for this exercise.

Prove using the definitions (without using limits):

$15n+\frac{n}{\log_2n}+\sqrt{n} \in \Theta(n)$

Proof:

We are looking for constants $c_1, c_2, n_0>0$ such that for every $n \ge n_0$ :

$0\lt c_1n\le15n+\frac{n}{\log_2n}+\sqrt{n}\le c_2n$

For the left inequality we'll choose $c_1 = 1$ and it will work for every $n>1$.

For the right inequality:

$15n+\frac{n}{\log_2n}+\sqrt{n}\le c_2n \iff 15+\frac{1}{\log_2n}+\frac{1}{\sqrt{n}}\le c_2 \iff \frac{1}{\log_2n}+\frac{1}{\sqrt{n}}\le c_2 -15$

We'll choose $c_2=16$ and get:

$\frac{1}{\log_2n}+\frac{1}{\sqrt{n}}\le 1$

Which applies for every $n\ge4$.

Therefore, we'll choose $n_0 = 4$ and both inequalities are true for every $n\ge n_0$.

$\blacksquare$