What is the time complexity of the function $5^{\log_3(n)}+n^{1.5}\sum_{j=0}^{log_3n-1}\left(\frac{5}{3^{1.5}}\right)^j$?

47 Views Asked by At

I need to find the $\Theta$ complexity of this function: $$5^{\log_3(n)}+n^{1.5}\sum_{j=0}^{log_3n-1}\left(\frac{5}{3^{1.5}}\right)^j$$

It shouldn't be too hard, and I already have simplified it, the problem is, the result should be $\Theta\left(n^{1.5}\right)$.

P.S how do you write mathematical expressions on this site??

Thanks!

1

There are 1 best solutions below

6
On BEST ANSWER

It's correct, on the following grounds: $$5^{\log_3(n)}=\left(e^{\log(5)}\right)^{\log_3(n)}=\left(e^{\log(n)}\right)^{\frac{\log(5)}{\log(3)}}=n^{\frac{\log(5)}{\log(3)}}\in\mathcal{O}\left(n^{1.5}\right)$$ and $$\frac{5}{3^{1.5}}<1\quad\Rightarrow\quad\sum_{j=0}^{\text{anything}}\left(\frac{5}{3^{1.5}}\right)^j\leq\frac{1}{1-\frac{5}{3^{1.5}}}\in\mathcal{O}(1)$$