Determine whether each of the functions $2^{n+1}$ and $2^{2n}$ is $O(2^n)$.

2.2k Views Asked by At

Determine whether each of the functions $2^{n+1}$ and $2^{2n}$ is $O(2^n)$.

Since $2^n$ < $2^{n+1}$, you can say $2^{n+1}$ is not $O(2^{n})$

Since $2^n$ is < $2^{2n}$, you can say $2^{2n}$ is not $O(2^{n})$

Edit: more information:

Since $2^{n+1}$ < $3^{n+1}$ = (n+1) log 3 = O (n log3).

Since $2^{2n}$ < $3^{2n}$ = O (2n log3) = O (n log3).

2

There are 2 best solutions below

4
On BEST ANSWER

You are missing the fact that there must be some constant. The definition is that $f(x)$ is $O(g(x))$ iff there exists some $c$ such that for sufficient large $x$, $|f(x)|\leq c|g(x)|$.
So, a hint for the first one is $2^{n+1}=2*2^n$,
for the second one you might want to check $x^2$ versus $x$. Does $x^2$ belong to $O(x)$?

Hope it helps.

0
On

We know that $f(x) \in \mathcal{O}(g(x))$ if there exist constants $C$, and $k$ so that $$ |f(x)| \le C |g(x)|$$ whenever $n > k$. I will omit the absolute value as it should be clear that $2^\text{r} \ge 0$.

(i) Now, $$2^{n+1} = 2 \cdot 2^n $$

so we can take $C = 2, k=1$ to see that $2^{n+1} \in \mathcal{O}(2^n).$

(ii) Assume that $2^{2n} \in \mathcal{O}(2^n)$. Then, there exists $C$, $k$ so that $$ 2^{2n} = 2^{n+n} =2^n2^n \le C \cdot 2^n \Rightarrow C \ge 2^n.$$ This is a contradiction as $C$ must be a constant and cannot depend on $n$. Hence, $2^{2n} \not\in \mathcal{O}(2^n).$