Time complexity of T(n) = 27T(n/3) + (n^3)log(n)

2.2k views Asked by At

I need some help with this recurrence. I tried it by myself and I got teta( (n^3)logn) but Wolfram Alpha says this:

recursion

I guess this is like an O( (n^3) log^2(n)). I can't use master theorem, so I solved it by recurrence. This is my solution, but I don't know what's wrong with it

manual solution

1

There are 1 answers

1
OmG On BEST ANSWER

You made a mistake in the last stage. Using these properties: log(x) + log(y) = log(xy) and log(x/y) = log(x) - log(y) and log(x^y) = y log(x)`, we have the following:

sum_{i=0}{k-1} log(m/3^i) = log(m^k / (1 * 3 * 3^2 * ... * 3^(k-1))) 
= log(m^k) - log(3^((k-1)k/2)) 
= k log(m) - (k-1)k/2 log(3) = c * k * (k-1) = Theta(log(m) * log(m))

Therefore, the time complexity is m^3 log^2(m).