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.
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.
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.