Discrete Mathematics / Further counting, graphs and algorithms
Generating Functions
Store a whole sequence as the coefficients of one power series, then let algebra do the counting.
Contents 2 sections
By the end you can
- Write the generating function of a sequence
- Multiply generating functions to count combinations
- Solve a recurrence with a generating function
Helps to know: Recurrence Relations, The Binomial Theorem and Pascal’s Triangle
§1A clothesline for numbers
The sequence becomes . The all-ones sequence is ; multiplying two generating functions counts ways to split a total between two independent choices.
Example 1Change for 10 cents with 1¢, 2¢ and 5¢ coins
- Each coin type contributes a factor: .
Check yourself
- Q1The generating function of is…