The power series G(x), where
is the generating function for the infinite sequence g0, g1, g2, g3,…. (Notice that it is convenient here to start the sequence with a term with subscript 0.) Such power series can be manipulated algebraically, and it can be shown, for example, that
Hence, 1/(1−x) and 1/(1−x)2 are the generating functions for the sequences 1, 1, 1, 1,…and 1, 2, 3, 4,…, respectively.
The Fibonacci sequence F0, F1, F2,…is given by F0 = 1, F1 = 1, and Fn + 2 = Fn + 1+ Fn. It can be shown that the generating function for this sequence is 1/(1−x−x2).
The use of generating functions enables sequences to be handled concisely and algebraically. A difference equation for a sequence can lead to an equation for the corresponding generating function, and the use of partial fractions, for example, may then lead to a formula for the n‐th term of the sequence.
Probability and moment generating functions are very powerful tools in statistics.