Generating Functions · Generating Functions
Lesson 10
Let \[\mathcal{N}(x)=1+2x+3x^{2}+4x^{3}+\dotsb=\sum_{n=0}^{\infty}(n+1)x^{n} \ .\] Then

This equality can be given a physical interpretation: \(a_{n}=n+1\) is the number of ways to choose \(n\) candies when two types of candies are available (say, chocolate and caramel). What is the generating function of the sequence \(\{a_{n}\}\)? If there were only one type of candy, it would be \(1+x+x^{2}+\dotsb=\frac{1}{1-x}\): there is one way to choose no chocolate candies, one way to choose one chocolate candy, one way to choose two chocolate candies, and so on. The generating function for two types is simply the product of the generating functions!