2

Based on the definition of the upper asymptotic bound, we have that :

$$|n| < K |-2n| $$

for $ K = 1$ for example and as $ n $ goes to $+\infty$, so the definition would lead us to say that $-2n$ is an asymptotic upper bound of $n$; Which doesn't make sense since $-2n$ is obviously smaller than $n$.

IliassA
  • 57

3 Answers3

1

What counts is the $\color{red}{magnitude}$ of a general term, as $n\to \infty$, $$ O(-2n)=O(|-2n|)=O(2n)=O(n), $$ we are considering absolute values here.

Olivier Oloa
  • 120,989
1

By definition

$$ \frac{f(n)}{n}\to k\in \mathbb{R}\implies f(n)=O(n)$$

thus $$O(n)=O(-2n) \quad n\to+\infty$$

user
  • 154,566
0

What matters here is not the sign but the "size". That's why the definition uses the absolute value. In that sense $-2n$ is larger than $n$.

Dan
  • 382