5

The recurrence relation

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

(where lg is logarithm to base 2) can be solved using the master theorem but I am not very sure about the answer. I have found my answer but am not mentioning it here in order to prevent information cascades. Please help me find the big O and Ω for above.

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
Programmer
  • 6,565
  • 25
  • 78
  • 125
  • I think it's better you *do* post your own thoughts, now it just looks like you've just posed your homework verbatim without doing anything yourself. Btw, what's `nlglgn` supposed to be? – Bart Kiers Jan 24 '11 at 13:27
  • 3
    And what @Bart mentions means "post not only the result, but also your reasoning". Don't be afraid to err, as that is much better than laziness, and also don't care about influencing others, as a lot of people here are champions influencing their bosses, and know that trade. – Dr. belisarius Jan 24 '11 at 13:45
  • 1
    At a guess, nlglgn is supposed to be n * log (log(n)) – borrible Jan 24 '11 at 13:51
  • @borrible, yes, you're most probably correct, but it doesn't hurt if the OP expresses him/herself more clearly. – Bart Kiers Jan 24 '11 at 14:06
  • Hi, Sorry for the ambiguity. lg n means the base is 2. Moreover, I got the following: big O (n^2) and omega is nlog(base10)n . – Programmer Jan 24 '11 at 14:11
  • Reasoning: nlglgn <= n2. Thus the k in master's theorem is 2 . a is 2 and b is 2. As a – Programmer Jan 24 '11 at 14:12
  • Do you guys need more information for this. If not , kindly vote up the question so that others pay more attention to it. – Programmer Jan 24 '11 at 15:14
  • You can edit your own post and work on answer there. You have just made some observations. State them in prose and work on from there. If there are things where you think it is something but know you are shaky grounds, say so. Copy the master theorem from the page you linked. What is your `a`, your `b` and your `f(x)` ? – I GIVE CRAP ANSWERS Jan 24 '11 at 17:13

1 Answers1

3

None of the 3 cases in the master theorem apply for

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

(With arbitrary base, it doesn't really matter)

Case 1: f(n)=n log(log n) is 'bigger' than nlog2 2=n1

Case 2: f(n) does not fit n logk(n)

Case 3: f(n) is smaller than n1+e

U(n)=2 U(n/2) + n log n
L(n)=2 L(n/2) + n

You can show that: U(n) >= T(n) and L(n) <= T(n). So U gives a upper bound, and L a lower bound for T.

Applying the master theorem for U(n), gives

Case 2: f(n)=n log n=Θ(n1 log1 n) thus U(n)=Θ(n log2 n)

Applying the master theorem for L(n), gives

Case 2: f(n)=n =Θ(n1 log0 n) thus L(n)=Θ(n log n)

Because L(n)<=T(n)<=U(n) it follows that T(n)=O(n log2 n) and T(n)=Ω(n log n)

Also, note that O(log2n)=O((log n)/log 2)=O((log n) * c)=O(log n).

Ishtar
  • 11,542
  • 1
  • 25
  • 31