Search code examples
algorithmrecurrence

lower and upper bounds


i have the following recurrence relation:

T(n) = 2T(n/3) +5(n/6) + n

and can't quite figure out the right lower and upper bounds.
for the upper bound I did:

T(n) = 2T(n/3) +5T(n/3) +n = 7T(n/6) +n

which, according to the master theorem should be: nlog67

and for the lower bound i did:

T(n) = 2T(n/3) +5T(n/3) +n = 7T(n/3) +n

which, according to the master theorem should be: nlog37

however, when solving it that wat i got only partial score as "there are better bounds"
what an i doing wrong?


Solution

  • T(n)=2*T(n/3)+5*T(n/6)+n
    
    Let
    T(n)=c*n^k+o(n^k)
    
    Then
    c*n^k+o(n^k)=2*c*(n/3)^k+o((n/3)^k)+5*c*(n/6)^k+o((n/6)^k)+n  
    
    c/6^k*(6^k-2^(k+1)-5)=o(n^k)
    
    k=1.27635...
    

    So, T(n) ≃ c*n1.27635

    T(n) ∈ Θ(n1.27635)