Which function grows faster $f(n)=n^3$ or $g(n)=5^{\lg n}$ ?
Asked
Active
Viewed 62 times
0
-
What is $lgn$ ? – Haris Gušić Mar 13 '19 at 14:49
-
Well, since $5^{\lg n} = n^{\lg 5}$ you need to know what the base of your $\lg$ is. If it is base-10 you get a vastly different behavior than if it is base-$e$ or base-2. – hmakholm left over Monica Mar 13 '19 at 14:50
-
How can I solve it if it's base-2? – Cookie cutter Mar 13 '19 at 14:51
3 Answers
1
Attempt:
Set $2^a=5$, then $2 <a<3$ (Why?)
$5^{\lg_2 n} = 2^{a\lg_2 n}= 2^{\ lg_2 (n^a)}= n^a.$
Now compare $n^{1/2}$ with $n^a$.
Peter Szilas
- 20,344
- 2
- 17
- 28
0
Note that $g(n)=5^{\log_2 n}=2^{\log_2 n \cdot \log_2 5}=n^{\log_2 5}$. Since $\log_2 5>\frac 12$ you have that $g$ is "faster" than $f$ or, better, that $f\gg g$ as $n\rightarrow +\infty$, i.e. $\frac fg \rightarrow +\infty$ as $n\rightarrow +\infty$.
Alessio Del Vigna
- 1,767
0
Just write
- $5^{\log_2 n} = 2^{\log_2 5 \cdot \log_2 n} = n^{\log_2 5} > n^2 > n^{\frac{1}{2}}$
So, you have $$\frac{n^{\frac{1}{2}}}{5^{\log_2 n}} < \frac{n^{\frac{1}{2}}}{n^{2}} = \frac{1}{n^{\frac{3}{2}}} \stackrel{n \to \infty}{\longrightarrow} 0$$
which means that $5^{\log_2 n}$ grows faster than $n^{\frac{1}{2}}$ for $n \to \infty$.
trancelocation
- 32,243