You are on page 1of 10

Akra-Bazzi:The New Master Theorem

Abhash Kumar Singh


August 31, 2010

Introduction
M. Akra and L. Bazzi recently proposed (in 1986) a new master theorem to
analyse the asymtotic behaviour of the mathematical recurrences that appear
in the analysis of the divide and conquer algorithms.It is the generalisation of
the well known Master Theorem.
Theorem 1 As per this theorem if

h(x) = θ(1) f or1 ≤ x ≤ x0
T (x) = (1)
h(x) = Σai T (bi x) + g(x) f orx > x0
where
1. x ≥ 1 is a real number.
1 1
2. x0 is a constant such that x0 ≥ and x0 ≥ ∀1 ≤ i ≤ k.
bi 1 − bi
3. ai > 0 is a constant for 1 ≤ i ≤ k.
4. bi ǫ(0, 1) is a constant.
5. k ≥ 1 is a constant.
6. g(x) is a nonnegative function satisfying polynomial growth condition and
Pk
p be a unique number for which i=1 ai bpi = 1.
Then   Z x 
g(u)
T (x) = θ xp 1 + du
1 up+1
We will now prove this theorem before checking it on some examples and
going for the variations.But first let’s see what the Polynomial Growth Condition
is.

Definition 1 Function g(x) satisfies polynomial growth condition if there exist


positive constants c1 , c2 such that ∀x > 1 and ∀1 ≤ i ≤ k and ∀u ∈ [bx , x] (bi as
defined in theorem 1) c1 g(x) ≤ g(u) ≤ c2 g(x).

1
The proof of the Theorem 1 makes use of the following lemma :
Lemma 1 If g(x) is a non-negative function that satisfies polynomial growth
condition.Then there are constants c3 and c4 such that

Z x
g(u)
c3 g(u) ≤ xp du ≤ c4 g(u)
bi x up+1

Proof of Lemma 1:
As per the polynomial growth condition we know that for all values of x greater
than x0

Z x
g(u)
c3 g(u) ≤ xp du ≤ c4 g(u)
bi x up+1

Let us deal with the lower bounds first.Therefore

g(u) ≤ c2 g(x)
x x Z x
1
Z Z
g(u) c2 g(x)
⇒ xp p+1
du ≤ x p
p+1
du ≤ c2 g(x)x p
p+1
du
bi x u bi x u bi x u
Z x  x
p g(u) p −p
⇒x p+1
du ≤ c2 g(x)x
bi x u up+1 bi x
Z x  
p g(u) p p p
⇒x du ≤ c2 g(x)x − p
bi x u
p+1 bi x p x
Z x  
g(u) 1
⇒ xp du ≤ pc 2 g(x) − 1
bi x u
p+1 bi p
Z x  
g(u) 1
⇒ xp du ≤ pc 2 g(x) − 1
bi x u
p+1 min(bi p )
Z x
g(u)
⇒ xp p+1
du ≤ pc4 g(x)
bi x u
where  
1
c4 = pc2 −1
min(bi p )
Similarly for the upper bound

c1 g(x) ≤ g(u)
x x
1
Z Z
p g(u)
∴x du ≥ c1 g(x) du
bi x up+1 bi x xp+1
x  x
p −p
Z
p g(u)
⇒x p+1
du ≥ c1 g(x)x
bi x u xp bi x
Z x  
p g(u) 1
⇒x p+1
du ≥ pc1 g(x) p − 1
bi x u bi

2
x  
1
Z
p g(u)
⇒x du ≥ pc1 g(x) −1
bi x u
p+1 max(bpi )
Z x
g(u)
⇒ xp p+1
du ≥ c3 g(x)
bi x u
where  
1
c3 = pc1 −1
max(bi p )
Z x
p g(u)
∴ c3 g(x) ≤ x du ≤ c4 g(x)
bi x up+1

Proof of Theorem 1
We need to show the existence of two positive constants c5 and c6 such that
 Z x   Z x 
p g(u) p g(u)
c5 x 1 + p+1
du ≤ T (x) ≤ c6 x 1 + p+1
1 u 1 u

This proof is by induction on the interval Ij The base case when j = 0 follows
from the fact that T (x) = Θ(1) when xǫ[1, x0 ]. Thus we can assign any value
to c5 and c6 depending on the value of T(x). The inductive step is argued as
follows :
k
T (x) = σi=1 ai T (bi x) + g(x)
k Z bi x !
X
p g(u)
⇒ T (x) ≥ ai C5 (bi x) 1 + du + g(x).... (by induction)
i=1 1 up+1
k  Z x Z x 
X
p g(u) g(u)
⇒ T (x) ≥ ai C5 (bi x) 1 + − du
i=1 1 up+1 bi x up+1
X p Z x 
g(u) c4
⇒ T (x) ≥ C5 xp ai b i 1 + p+1
du − g(x) ...(by lemma 1)
1 u xp
 Z x  k
p g(u) X
⇒ T (x) ≥ C5 x 1 + p+1
+ g(x) − C5 C 4 g(x) ...(as ai C5 (bi x)p = 1)
1 u i=1
 Z x 
g(u)
⇒ T (x) ≥ C5 xp 1 + p+1
1 u
1
provided that C5 ≤ C4 .Thus there exists C5 . Now let us focus on the existence
of C6

The base case has been taken care of during the proof of existence of C5 .Now
the inductive step.
k
X
T (x) = ai T (bi x)p + g(x)
i=1
k
!
Z bi x
X
p g(u)
⇒ T (x) ≤ C6 ai (bi x) 1+ + g(x)
i=1 1 up+1

3
k  Z x Z x 
X
p g(u) g(u)
⇒ T (x) ≤ C6 ai (bi x) 1 + − du + g(x)
i=1 1 up+1 bi x up+1
k  Z x 
g(u) C3 g(x)
ai bpi 1 +
X
⇒ T (x) ≤ C6 xp p+1
− + g(x)...(by lemma 1)
i=1 1 u xp
k  Z x 
g(u)
ai bpi
X
p
⇒ T (x) = C6 x 1+ − C3 C6 g(x) + g(x)
i=1 1 up+1
 x 
1
Z
g(u)
⇒ T (x) ≤ C6 xp 1 + du provided that C6 ≥
1 up+1 C3
∴ It can be concluded that
  Z x 
g(u)
T (x) = θ xp 1 + du
1 up+1

Examples
Now let us take some examples to verify the correctness of this theorem

Example 1
 
1 x 1
T (x) = T +θ
2 2 x
As per CS-345 Master theorem
 
log2 x
T (x) = θ
x

Now as per Akra-Bazzi theorem


1 1 1
a1 = , b1 = , g(u) =
2 2 u
∴ a1 (b1 )p = 1
⇒ p = −1
  Z x 
g(u)
∴ T (x) = θ x−1 1 + du
1 u
−1+1
  Z x 
−1 du
=θ x 1+
1 u
 
1 log x
=θ +
x x
 
log x

x

4
Example 2
x x
T (x) = 2T + 3T
+ θ(x log x)
4 6
CS-345 Master theorem can’t be applied here because it is not in the form
x
T (x) = aT + f (n)
b
So, let’s solve it by recursion:
x x
T (x) = 2T + 3T
+ θ(x log x)
4 6
h  x i h  x i
= 2 2T + 3 3T + θ(x log x)(4 + 9 + 1)
16 18

= θ(x log x)(log x)


= (x log x log x)
Now as per Akra Bazzi theorem
1 1
a1 = 2, a2 = 3, b1 = , b2 = , g(u) = u log u
4 6
 p  p
X p 1 1
∴ ai b i = 2 +3 =1
4 6
⇒p=1
  x 
u log u
Z
∴ T (x) = θ x 1 +
1 u2
= θ(x(1 + (log x)2 )
= θ(x log x log x)
Thus in both the examples results obtained by Akra-Bazzi is same as obtained
by any other method.

5
Variations
We have analysed a great deal of recurrences in the previous sections.But re-
currences in real life differ in small ways.
k
X
e.g. T (x) ≤ ai T (⌈x⌉) + g(x)
i=1

In general the inclusion of floors and ceilings doesn’t affect the recursion signif-
icantly.In this section we shall see a general class of variations (including floors
and ceilings).We will show that variations don’t affect the solution of recurrences
upto a constant factor.So we need to prove the following theorem:
Theorem 2 As per this theorem if

t(x) = θ(1) f or1 ≤ x ≤ x0
T (x) = (2)
t(x) = Σai T (bi x + hi (x)) + g(x) f orx > x0
where
1. x > 1 is a real number ; x0 ≥ b1i and x0 ≥ 1−b 1
i
for all 1 ≤ i ≤ k; ai > 0
for 1 < i < k; bi ǫ(0, 1) is a constant;k ≥ 1is a constant.
2. there exists some constant ǫ > 0 for which
x
|hi (x)| ≤ 1+ǫ ∀iǫ[1, k]
log x
whenever x ≥ x0
3. there exist positive constants c1 and c2 such that for all uǫ[bi x + hi (x), x]
c1 g(x) ≤ g(u) ≤ c2 g(x)

4. x0 is chosen to be a large enough constant so that for any i ≤ k and any


x ≥ x0
(a)
 
 p
1 1 1
1− 1 +  ≥ 1 +
bi log1+ǫ x
 ǫ/2
ǫ/2 x log x
log bi x + log1+ǫ x

(b)
 
 p
1 1 1
1+ 1 −  ≤ 1 −
bi log1+ǫ x
 ǫ/2
ǫ/2 x log x
log bi x + log1+ǫ x

(c)  
1 1
1+ ≤1
2 logǫ/2
(d)  
1
2 1− ≥1
logǫ/2 x

6
Before going into prove of Theorem 2 we need to prove the following lemma
Lemma 2 There are positive constants c3 , c4 such that for 1 ≤ i ≤ k and all
x≥1 Z x
p g(u)
c3 g(x) ≤ x p+1
du ≤ c4 g(x)
bi x+hi (x) u

Proof of Lemma 2
we know that for uǫ[bi x + hi (x), x] c1 g(x) ≤ g(u) ≤ c2 g(x)

Let’s consider the lower bounds first


Z x Z x
g(u) 1
xp p+1
du ≤ xp
c 2 g(x) p+1
du
bi x+hi (x) u bi x+hi (x) u

x x
1
Z Z
g(u)
⇒ xp du ≤ xp c2 g(x) du
bi x+hi (x) up+1 bi x up+1
x  x
−p
Z
g(u)
⇒ xp p+1
du ≤ x p
c 2 g(x)
bi x+hi (x) u up bi x
Z x  
g(u) 1
⇒ xp p+1
du ≤ pc 2 g(x) − 1
bi x+hi (x) u min(bi )p
Z x  
g(u) 1
⇒ xp p+1
du ≤ c 4 g(x) where c 4 = pc 2 g(x) − 1
bi x+hi (x) u min(bi )p

Now for the upper-bound


Z x Z x
g(u) 1
xp p+1
≥ xp
c 1 g(x) p+1
du
bi x+hi (x) u bi x+hi (x) u
Z x  
g(u) p p
xp p+1
≥ xp
c 1 g(x) −
bi x+hi (x) u ((bi x) + hi (x))p xp
 
Z x
g(u) 1
xp p+1
≥ pc1 g(x)   p − 1
bi x+hi (x) u b + hi (x)
i x

as because
x
|hi (x)| ≤ i+ǫ
log x
∴ for sufficiently large x > x0 hix(x)
x
log1+ǫ x 1
lim = lim 1+ǫ = lim 1+ǫ
x→∞ x x→∞ x log x x→∞ log x

7
log x for x → ∞ tends to ∞
h1 x
∴ →0
x
x  
1
Z
g(u)
∴ xp du ≥ pc 1 g(x) − 1
bi x+hi (x) up+1 bpi
Z x
g(u)
⇒ xp du ≥ c3 g(x)
bi x+hi (x) up+1
Hence lemma 2 is proved.

Proof of Theorem 2
Here we begin by showing that there is a positive constant c5 such that for all
x > x0   Z x 
p 1 g(u)
T (x) ≥ c5 x 1 + 1+ p+1
du
logǫ/2 x 1 u

The proof is by induction on the interval Ij containing x.The base case j = 0


follows from the fact that T (x) = θ(1) when x ∈ [1, x0 ] (c5 has to be chosen
sufficiently small).Now the inductive step :
k
X
T (x) = ai T (bi x + hi (x)) + g(x)
i=1

k
!
X
p 1
⇒ T (x) ≥ ai c5 (bi x+hi (x)) 1+ +g(x) (by induction)
i=1 logǫ/2 (bi x + hi (x))
 
k  p  Z x 
X 1 1 g(u)
⇒ T (x) ≥ ai c5 xp 1 − 1 +  1+ −
bi log1+ǫ x p+1
 
i=1 logǫ/2 bi x + log1+ǫ
x 1 u
x

(by the bounds of h(x))


k   x 
1
Z
X
p g(u) c4 g(x)
⇒ T (x) ≥ ai c5 x 1 + 1+ p+1
du − + g(x)
i=1 logǫ/2 x 1 u xp

(by constraint 4(a) and lemma 2 )


  Z x   
p 1 g(u) 1
⇒ T (x) = c5 x 1 + 1+ p+1
du +g(x)−c5 c4 1 + g(x)
logǫ/2 x 1 u logǫ/2 x
  Z x 
p 1 g(u)
⇒ T (x) ≥ c5 x 1 + 1+ p+1
du
logǫ/2 x 1 u

provided c5 c4 ≤ 21 ...(by contraint 4(c))

8
Now let’s do the lower bound. Here we show by induction the existence of a
positive constant c6 such that for all x > x0
  Z x 
p 1 g(u)
T (x) ≤ c6 x 1 − 1+ p+1
du
logǫ/2 x 1 u

The base case is when T (x) = θ(1) and when x ∈ [1, x0 ] we can choose c6
accordingly.The inductive step is as:
k
X
T (x) = ai T (bi x + hi (x)) + g(x)
i=1

k
! !
bi x+hi (x)
1
Z
X
p g(u)
⇒ T (x) ≤ ai c6 (bi x+hi (x)) 1− 1+ (by induction) du +g(x)
i=1 logǫ/2 (bi x + hi (x)) 1 up+1
 
k  p Z x Z x !
X p p 1 1 g(u)
⇒ T (x) ≤ ai b i c6 x 1 + 1 −  1 + − +g(x)
bi log1+ǫ x p+1

i=1 logǫ/2 bi x + log1+ǫ
x 1 u bi x+hi (x)
x
 Z x 
 g(u) c3
⇒ T (x) ≤ c6 xp 1 − logǫ/2 x 1+ p+1
du − p g(x) + g(x)
1 u x
(by constraint 4(b) and lemma 2)
  Z x   
1 g(u) 1
⇒ T (x) ≤ c6 xp 1 − 1 + p+1
du +g(x)−c c
3 6 1 − g(x)
logǫ/2 x 1 u logǫ/2 x
  Z x 
p 1 g(u)
⇒ T (x) ≤ c6 x 1 − 1+ p+1
du
logǫ/2 x 1 u

provided c6 c3 ≥ 2 by constraint 4(d) on x0 .


Now we have shown that
  x 
1
Z
g(u)
T (x) ≥ c5 xp 1 + 1+ du
logǫ/2 x 1 up+1
and   x 
1
Z
p g(u)
T (x) ≤ c6 x 1− 1+ du
logǫ/2 x 1 up+1
As per constraints 4(c) and 4(d) maximum value of
 
1
1+
logǫ/2 x
is 2 and minimum value of  
1
1−
logǫ/2 x
is 12 .  Z x 
g(u)
T (x) ≥ 2c5 xp 1 + du
1 up+1
and  Z x 
c6 p g(u)
T (x) ≤ x 1+ p+1
du
2 1 u

9
Let 2c5 = c7 and c26 = c8 Therefore
 Z x   Z x 
p g(u) p g(u)
c7 x 1 + p+1
du ≤ T (x) ≤ c8 x 1 + p+1
du
1 u 1 u
  Z x 
g(u)
∴ T (x) = θ xp 1 + p+1
du
1 u

Hence we have proved the Akra-Bazzi theorem.The Theorem 2 is also known


as strong form of Akra-Bazzi Theorem .

References
1. Notes on Better Master Theorems for Divide-and-Conquer Recurrences
by Tom Leighton
2. http://www.algorithmsblog.com
3. http://en.wikipedia.org

10

You might also like