2

I have tried my best but I'm not able to find any pattern for the $n^2n^{1/2}$ part. This question must be solved iteratively and I get totally clueless after two iteration.s I've to find tight bound in big-O.

David Richerby
  • 81,689
  • 26
  • 141
  • 235

2 Answers2

1

Here is what happens when you expand the recurrence: $$ \begin{align*} T(n) &= n^{5/2} + 4(n/2)^{5/2} + 4^2(n/2^2)^{5/2} + 4^3(n/2^3)^{5/2} + \cdots \\ &= n^{5/2} \left(1 + \frac{4}{2^{5/2}} + \left(\frac{4}{2^{5/2}}\right)^2 + \left(\frac{4}{2^{5/2}}\right)^3 + \cdots \right). \end{align*} $$ Since $4/2^{5/2} = 1/\sqrt{2} < 1$, the large bracketed expression converges, and so the answer is $T(n) = \Theta(n^{5/2})$.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
1

\begin{equation} T(n) = 4T(\frac{n}{2}) + n^{\frac{5}{2}} = 4^2T(\frac{n}{2^2}) + 4(\frac{n}{2})^{\frac{5}{2}} + n^{\frac{5}{2}} \end{equation} On the $k^{th}$ iteration, we get \begin{equation} T(n) = 4^kT(\frac{n}{2^k}) + \sum\limits_{i=0}^{k-1} 4^i (\frac{n}{2^i})^{\frac{5}{2}} \end{equation} which terminantes at $k = \log_2 n$ The part $$4^kT(\frac{n}{2^k}) = O(4^{\log_2 n}) = O(n^2)$$ The sum part could be arranged as \begin{equation} \sum\limits_{i=0}^{k-1} 4^i (\frac{n}{2^i})^{\frac{5}{2}} = n^{\frac{5}{2}} \sum\limits_{i=0}^{k-1} 4^i (\frac{1}{2^i})^{\frac{5}{2}} = n^{\frac{5}{2}} \sum\limits_{i=0}^{k-1} \Big( \frac{4}{2^{\frac{5}{2}}} \Big)^{i} = n^{\frac{5}{2}} \frac{1- \big(\frac{4}{2^{\frac{5}{2}}}\big)^k}{1 - (\frac{4}{2^{\frac{5}{2}}})} \end{equation} where the last equality comes from realizing that we have a geometric series. Notice that \begin{equation} \frac{4}{2^{\frac{5}{2}}} = (\sqrt{2})^{-1} \end{equation} So \begin{equation} \sum\limits_{i=0}^{k-1} 4^i (\frac{n}{2^i})^{\frac{5}{2}} = n^{\frac{5}{2}} \frac{1 - (\sqrt{2})^{-k}}{1 - \frac{\sqrt{2}}{2}} \end{equation} But algorithm terminates at $k = \log_2 n$ so \begin{equation} \sum\limits_{i=0}^{k-1} 4^i (\frac{n}{2^i})^{\frac{5}{2}} = O( n^{\frac{5}{2}} \frac{1 - (\sqrt{2})^{-\log_2 n}}{1 - \frac{\sqrt{2}}{2}} ) = O\Big( \alpha n^{\frac{5}{2}} (1 - (\sqrt{2})^{-\log_2 n}) \Big) \end{equation} where $\alpha = \frac{1}{1- \frac{\sqrt{2}}{2}}$ But \begin{equation} (\sqrt{2})^{-\log_2 n} = \frac{1}{(\sqrt{2})^{\log_2 n}} = \frac{1}{2^{\log_2 \sqrt{n}}} = \frac{1}{\sqrt{n}} \end{equation} So \begin{equation} \sum\limits_{i=0}^{k-1} 4^i (\frac{n}{2^i})^{\frac{5}{2}} = O( n^{\frac{5}{2}} \frac{1 - (\sqrt{2})^{-\log_2 n}}{1 - \frac{\sqrt{2}}{2}} ) = O\Big( \alpha n^{\frac{5}{2}} (1 - \frac{1}{\sqrt{n}}) \Big) = O( n^{\frac{5}{2}}) \end{equation} So \begin{equation} T(n) = \underbrace{4^kT(\frac{n}{2^k})}_{O(n^2)} + \underbrace{\sum\limits_{i=0}^{k-1} 4^i (\frac{n}{2^i})^{\frac{5}{2}}}_{ O( n^{\frac{5}{2}})} = O( n^{\frac{5}{2}}) \end{equation}

Ahmad Bazzi
  • 228
  • 1
  • 7