 # Multiple-Size Divide-and-Conquer Recurrences

This short note reports a master theorem on tight asymptotic solutions to divide-and-conquer recurrences with more than one recursive term: for example, T(n) = 1/4 T(n/16) + 1/3 T(3n/5) + 4 T(n/100) + 10 T(n/300) + n^2.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

This note reports a tight asymptotic solution to the following recurrence on all positive integers :

 T(n)=c⋅nα⋅logβn+k∑i=1ai⋅T(⌈bi⋅n⌉) for n≥n0, (1) 0

where

• ,

• is a positive integer,

• and for ,

• .

Since , for all and . Thus, the term on the left-hand side of (1) is defined on -terms with smaller , and (2) properly specifies the initial values of .

A special case of this recurrence, namely, , is discussed in [2, 5] and standard textbooks on algorithms and is used extensively to analyze divide-and-conquer strategies [1, 4]. A specific recurrence with is used to analyze a divide-and-conquer algorithm for selecting a key with a given rank [1, 3, 4].

Let . The characteristic equation of the general recurrence is the equation . Our solution to the general recurrence is summarized in the following theorem.

###### Theorem 1

If is the solution to the characteristic equation of the general recurrence, then

 T(n)=⎧⎪ ⎪⎨⎪ ⎪⎩Θ(nr)if r>α;Θ(nαlog1+βn)if r=α;Θ(nαlogβn)if r<α.

The key ingredient of our proof for this theorem is the notion of a characteristic equation. With this new notion, our proof is essentially the same as that of the case with [1, 2, 4, 5]. This note concentrates on elaborating the characteristic equation’s role in our proof by detailing an upper bound proof for a certain case. Once this example is understood, it is straightforward to reconstruct a general proof for Theorem 1. Consequently, we omit the general proof for the sake of brevity and clarity.

## 2 An Example

This section discusses the general recurrence with . To further focus our attention on the characteristic equation’s role, we assume that , is a positive integer, and . Then, according to Theorem 1, . We will only prove . The lower bound proof is similar.

Let . It suffices to show that there exist some positive constants such that . These constants and some others are chosen as follows. Without loss of generality, we assume .

 f3 = cg(α)−1; f2 = any positive constant; f1 = f2+f3+1; m0 = max{n0,1b1,⎛⎜ ⎜⎝f1⋅2r⋅1b1f2⋅(g(r−12)−1)⎞⎟ ⎟⎠2}; M = maxn

Note that since for all , is a decreasing function. Then since and , and . Thus, the above constants are all positive. We next consider the following new recurrence:

 R(n)=c⋅nα+a1⋅R(⌈b1⋅n⌉)+a2⋅R(⌈b2⋅n⌉)+a3⋅R(⌈b3⋅n⌉) for n≥m0, R(n)=1 for n

It can be shown by induction that for all . Thus, to prove , it suffices to show for all .

Base Case: for all . This follows from the choice of .

Given some , we need to show .

Induction Hypothesis: for all integers where .

Induction Step:

 R(n) ≤ c⋅nα+a1⋅S(⌈b1⋅n⌉)+a2⋅S(⌈b2⋅n⌉)+a3⋅S(⌈b3⋅n⌉) (4) ≤ c⋅nα+f1⋅g(r)⋅(n+1b1)r−f2⋅g(r−12)⋅nr−12−f3⋅g(α)⋅nα (5) ≤ c⋅nα+f1⋅g(r)⋅nr+f1⋅2r⋅nr−1⋅1b1−f2⋅g(r−12)⋅nr−12−f3⋅g(α)⋅nα (6)

In this above derivation,

• (4) follows from (2), the inequality , the base step and the induction hypothesis;

• (5) follows from the fact that ;

• (6) follows from the fact that because is a positive integer and .

To finish the induction step, note that the right-hand side of (6) is at most as desired for the following reasons.

• By the choice of ,

• Since ,

## Acknowledgments

The author found the result in this note in 1986 while teaching a course on algorithms. Since then, he has been teaching it in his classes. He wishes to thank Don Rose for helpful discussions.

## References

•  A. V. Aho, J. E. Hopcroft, and J. D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading, MA, 1974.
•  J. L. Bentley, D. Haken, and J. B. Saxe. A general method for solving divide-and-conquer recurrences. SIGACT News, 12(3):36–44, 1980.
•  M. Blum, R. W. Floyd, V. Pratt, R. L. Rivest, and R. E. Tarjan. Time bounds for selection. Journal of Computer and System Sciences, 7(4):448–461, 1973.
•  T. H. Cormen, C. L. Leiserson, and R. L. Rivest. Introduction to Algorithms. MIT Press, Cambridge, MA, 1991.
•  G. S. Lueker. Some techniques for solving recurrences. ACM Computing Surveys, 12(4):419–436, 1980.