Can I prove that 2n+1 = O(2n)?

2.9k Views Asked by At

Is 2n+1 = O(2n)? In other words, 2n+1 <= c * 2n for any c and all n > n0?

I have plugged in numbers but none that worked. Obviously It is also (n) but I am trying to prove the above. Much appreciated.

2

There are 2 best solutions below

0
On BEST ANSWER

For $n \geq 1$, $$2n+1 \leq 3n = \frac{3}{2}\cdot 2n.$$ Take $c=\frac{3}{2}$ and $n_0=1$.


Also, for the record: writing things like $O(2n)$ is "morally wrong." The whole point of the $O(\cdot)$ notation and its cousins ($\Omega(\cdot)$, $\Theta(\cdot)$, and so on) is to hide the constants to be able to focus on the asymptotic growth.

0
On

$$ \lim_{n \rightarrow \infty} \frac{2n + 1}{2n} ~=~ 1 ~ \rightarrow ~ 2n + 1 \in \Theta(2n)$$