# Fun lecture on geometric series (Part 1): Generating functions

Every once in a while, I’ll give a “fun lecture” to my students. The rules of a “fun lecture” are that I talk about some advanced applications of classroom topics, but I won’t hold them responsible for these ideas on homework and on exams. In other words, they can just enjoy the lecture without being responsible for its content.

This series of posts describes a 50-minute fun lecture — on the topic of generating functions — that I’ve given to my Precalculus students after they’ve learned about partial fractions and geometric series.

To launch the topic: In the 1949 cartoon “Hare Do,” Bugs Bunny comes across the following sign when trying to buy candy (well, actually, a carrot) from a vending machine. The picture below can be seen at the 2:40 mark of this video: http://www.ulozto.net/live/xSG8zto/bugs-bunny-hare-do-1949-avi Notice that the price of candy from vending machines have increased somewhat since 1949. (Elsewhere in the cartoon, the price of a ticket to the movies was listed as 55 cents for adults, 20 cents for children, and 10 cents for rabbits.)

I wasn’t alive in 1949, but I vividly remember seeing this essentially mathematical problem while watching cartoons after school in the late 1970s. Now that I’m a little older — and can freeze-frame the above sign — I can see that the animators actually missed one way of expressing 20 cents. More on that later. Definition. The generating function of a sequence is defined to be an infinite series whose coefficients match the sequence.

Example #1. Consider the (boring) sequence $1, 1, 1, 1, \dots$. The generating function for this sequence is $f(x) = 1 + 1x + 1x^2 + 1x^3 + \dots$

If $-1 < x < 1$, then $f(x) = \displaystyle \frac{1}{1-x}$, using the formula for an infinite geometric series.

Example #2. For the slightly less boring sequence of $1, -1, 1, -1, \dots$, the generating function is $f(x) = 1 - x + x^2 - x^3 + \dots$,

which (if $-1 < x < 1$) is $f(x) = \displaystyle \frac{1}{1+x}$.

Example #3. Suppose $a_n = \displaystyle {10 \choose n}$ if $0 \le n \le 10$ and $a_n = 0$ for $n>10$. Then the generating function is $f(x) = \displaystyle \sum_{n=0}^{10} {10 \choose n} x^n = (x+1)^{10}$.

It turns out that the above problem from the Bugs Bunny cartoon can be viewed as a generating function. Let $a_n$ denote the number of ways that $n$ cents can be formed using pennies, nickels, dimes, and quarters? The Bugs Bunny cartoon is related to the value of $a_{20}$. What about one dollar? Two dollars? I’ll provide the answer in tomorrow’s post. FYI, previous posts on an infinite geometric series:

https://meangreenmath.com/2013/09/16/formula-for-an-infinite-geometric-series-part-9

https://meangreenmath.com/2013/09/17/formula-for-an-infinite-geometric-series-part-10

https://meangreenmath.com/2013/09/18/formula-for-an-infinite-geometric-series-part-11