The repertoire method
The repertoire method offers an elegant technique for finding closed-form solutions to recurrence relations and series sums. Introduced in Chapter 1 of Concrete Mathematics (Graham et al. 1989), it tends to puzzle newcomers at first glance. Yet throughout the book—especially Chapters 1 and 2—this method proves remarkably powerful for tackling diverse sums and recurrences. I’ll be honest: the technique takes some effort to master. In this note, I attempt to demystify the repertoire method and show how to apply it effectively.
Definition
At its core, the repertoire method seeks coefficients for a linear combination of related recurrences. It shines brightest with linear recurrences—those whose solutions can be expressed as sums of coefficients multiplied by functions of
Concrete Mathematics doesn’t spell out the method explicitly—the authors conjure up recurrence sets and extract coefficients almost magically, leaving readers wondering how they arrived at them. Fortunately, Sedgewick’s Analysis of Algorithms (Sedgewick and Flajolet 1996) offers clearer guidance with systematic examples. I’ve distilled the approach from (Sedgewick and Flajolet 1996) into a three-step recipe:
- Relax the recurrence by adding an extra function term.
- Substitute known functions into the recurrence to derive identities similar to the recurrence.
- Take linear combinations of such identities to derive an equation identical to the recurrence.
Admittedly abstract at first glance! Let’s ground it with an example. Consider a recurrence of the form
For deeper insight, I highly recommend Markus Scheuer’s excellent answer on Math StackExchange. For practice, Concrete Mathematics (Graham et al. 1989) (Chapters 1, 2, and 6) provides a wealth of exercises that build intuition. Additionally, Section 2.5 of (Sedgewick and Flajolet 1996) surveys various closed-form techniques, with the repertoire method among them—the worked examples there are particularly instructive.
Nothing beats working through examples to truly internalize this technique.
Examples
Closed-form of sums
We can readily convert a series sum into a linear recurrence. Let’s begin with a simple example involving
This sum can be seen as:
Next, we build a table of
| 1 | 0 |
| n | 1 |
How do we populate the
The solution is
Let’s tackle another example—this time an exercise from Concrete Mathematics (Graham et al. 1989):
The solution is
Linear Recurrences
Drawing from the table we built earlier, we can construct a linear combination for this recurrence:
Solving yields
Exercise 1.16 (Graham et al. 1989)
Helpful Resources
After extensive searching, I’ve collected some resources that genuinely helped me grasp the method:
- Wakatta’s post
- Math StackExchange answer—this one is particularly illuminating
- Pindancing’s post
References
- Graham, Ronald L., Donald E. Knuth, and Oren Patashnik. 1989. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley.
- Sedgewick, Robert, and Philippe Flajolet. 1996. An Introduction to the Analysis of Algorithms. Pearson Education India.