Finding lambda of Master Theorem

631 Views Asked by At

Suppose I have a case like

T(n)=2T(n/4)+log(n). a=2, b=4, f(n)=log(n)

That should be case 1 because n^(1/2)>log(n). There is also a lambda in case 1. f(n)=O(n^((1/2)-lambda). Is this correct? And how can I find this lambda?

2

There are 2 best solutions below

1
On

The constant lambda is important: its purpose is to avoid considering the bizarre cases that lie between Case 1 and Case 2. Since big-O is an upper bound only and not a lower bound, smaller choices of lambda are "better" in the sense that they cover more functions. Since lambda must be positive, however, there is no "best" choice of lambda. Lambda = 10^-3 should get you through enough examples to see why most treatments of the Master Theorem do not make a production out of choosing lambda.

0
On

f(n)=logn

Epsilon can be 1/4 since

n(logba-epsilon)=n(log42-1/4)=n(1/2-1/4)=n(1/4).

f(n)=O(n(1/4)).

So by case 1 of the master theorem T(n)=Θ(nlogba)=Θ(n(1/2)).