简体   繁体   中英

How to solve the recurrence of T(n) = 2 * T(n/3) + 3/2 * T(n/4) + 5 * T(n/2) + Theta(n^2), p = 2,574359

How to solve the recurrence of T(n) = 2 * T(n/3) + 3/2 * T(n/4) + 5 * T(n/2) + Theta(n^2), p = 2,574359 I don't understand how to solve so complex reccurrence.

You can find an upper-bound like the following:

T(n) <= (2 + 3/2 + 5) * T(n/2) + Theta(n^2) = 8.5 T(n/2) + Theta(n^2)

And using master theorem, you can say T(n) = O(n^{log(8.5)) ~ O(n^{3.09}) .

Also, you can use akra-bazzi theorem to find a tighter bound. First, we need to solve the following equation

2 * (1/3)^p + 3/2 (1/4)^p + 5 * (1/2)^p = 1

After solving, we know that p ~ 2.57 . Hence, by the theorem we find that:

T(n) = Theta(n^{2.57} (1 + int(x^2/x^{3.57} dx, 1, n) ) ) = 
       Theta(n^{2.57} (1 + int(1/x^{1.57} dx, 1, n) ) )

As int(1/x^{1.57} dx, 1, n) < 3 , we can say T(n) = Theta(n^{2.57}) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM