Unusual Asymptotics Question

58 Views Asked by At

I want to prove the following$$n - 2\sqrt{n} = \Theta(n)$$

Is it correct to say $$n -1 \leq n \leq n +1 => f(n)=n=\Theta(n)$$ $$\sqrt{n}\leq|-2\sqrt{n}| = 2\sqrt{n}\leq3\sqrt{n} =>g(n)=-2\sqrt{n}=O\sqrt{n}$$

So:     $n - 2\sqrt{n} = max(O(n),O(\sqrt{n}))=O(n)$
And:  $n - 2\sqrt{n} = max(\Omega(n),\Omega(\sqrt{n}))=\Omega(n)$
So:     $n - 2\sqrt{n} = \Theta{n}$




Edit: I am not interested in the solution to this problem , but whether my methodology for solving the problem is correct or not.

2

There are 2 best solutions below

2
On

I think it's easier to just show that $f(n) \geq \frac{n}{2} \ \forall n > n_0$ and you've shown that $f(n) \leq 2n$, hence the result.

0
On

What you have certainly illustrates the intuition, but mechanically, I'd approach it a little differently. Let $f(n) = n - 2\sqrt{n}$.

Now $f(n) < n = 1 \cdot n$, and so $f(n) \in O(n)$.

For the lower bound, seeking to establish $\frac12n < f(n)$ works:

\begin{align} \frac12n < n-2\sqrt{n} &\Leftrightarrow \frac12n + 2\sqrt{n} < n \\ &\Leftrightarrow 2\sqrt{n} < \frac12n \\ &\Leftrightarrow 4\sqrt{n} < n \\ &\Leftrightarrow 4 < \sqrt{n} \\ &\Leftrightarrow 16 < n. \end{align}

Thus, past $16$, $f(n)$ is bounded below by $\frac12n$, and so $f(n) \in \Omega(n)$.

Thus, $f(n) \in \Theta(n)$.