Silvester
Silvester

Reputation: 3159

Can I use master's theorem for this recurrence relation?

I solved my homework problem, I used recursion tree.

But solution says that this recurrence relation can be solved by master's theorem!

T(N) = 49T(N/25) + n^(3/2)log(n)

I solved n^(3/2) log^2(n)

But solution said n^(3/2) log(n)

I don't know why this case can use master's theorem and it is correct.

Upvotes: 0

Views: 6336

Answers (1)

nevsan
nevsan

Reputation: 1445

We can see that a=49 and b=25. Note that log_b(a) ~ 1.2 and that 3/2 = 1.5. Hence, log_b(a) < 3/2. Thus, we can see that f(n) = n^{3/2}log(n) = Omega(n^{log_b(a) + epsilon}) for some epsilon, so that Case 3 of the master theorem applies. Thus, the run time is

T(n) = Theta(f(n)) = n^{3/2}log(n)

Note: You also have to check that

af(n/b) <= cf(n)

for some constant c. Of course

49 (n/25)^{3/2} log(n/25) <= c n^{3/2}log(n)

which can be checked by dividing both sides by n^{3/2} and then subtracting c log(n) from both sides which gives

(49/25^{3/2} - c) log n - 49/25^{3/2} log(25) <= 0

This is certainly true at least for c > 49/25^{3/2} (no need to make this tight).

Upvotes: 3

Related Questions