How to solve T(n) = 3T(n/4) + c

447 Views Asked by At

I found the pattern to this problem being the following... $$3^k T\left(\frac{n}{4^k}\right) + 3^{k-1}c + 3^{k-2}c + \cdots + c$$ I feel like this is wrong but if you can cancel common factors it would be much easier in this case you cannot. I factored out the c and got this... $$c(3^{k-1} + 3^{k-2} + \cdots + 1)$$ So is this a geometric series? Also this condition is applied to this problem "assume $T(n) = 1$ for $n \le 10$". Does this mean I need to apply this until $T(10)$? I solve for $k$ with $\frac{n}{4^k} = 1$ and get $\log_4 n$. I plug it into my expression and get this $$3^{\log_4 n} + c(3^{\log_4 n-1} + 3^{\log_4 n-2} + \cdots + 1)$$ I'm having trouble finding the $\theta()$ run time from this point. Any suggestions? My guess for a simplified series is the following... $$3^{\log_4 n} + \sum_{i=0}^{\log_4 n-1} c \cdot 3^i$$ Is that correct?