Solve the recurrence: T(n)=2T(n/2)+n/logn

Saeedeh picture Saeedeh · Aug 25, 2012 · Viewed 28.6k times · Source

I can find the sum of each row (n/log n-i) and also I can draw its recursive tree but I can't calculate sum of its rows.

T(n)=2T(n/2)+n/logn

T(1) = 1

Answer

Danil Speransky picture Danil Speransky · Aug 25, 2012

Suppose n = 2^k;

We know for harmonic series (euler formula):

Sum[i = 1 to n](1/i) ~= log(n) [n -> infinity]

t(n) = 2t(n/2) + n/log(n)
     = 2(2t(n/4) + n/2/log(n/2)) + n/log(n)
     = 4t(n/4) + n/log(n/2) + n/log(n)
     = 4(2t(n/8) + n/4/log(n/4)) + n/log(n/2) + n/log(n)
     = 8t(n/8) + n/log(n/4) + n/log(n/2) + n/log(n)
     = 16t(n/16) + n/log(n/8) + n/log(n/4) + n/log(n/2) + n/log(n)
     = n * t(1) + n/log(2) + n/log(4) + ... + n/log(n/2) + n/log(n)
     = n(1 + Sum[i = 1 to log(n)](1/log(2^i)))
     = n(1 + Sum[i = 1 to log(n)](1/i))
     ~= n(1 + log(log(n)))
     = n + n*log(log(n)))
     ~= n*log(log(n)) [n -> infinity]