Generating functions for counting the number of $n$ ounces of candy, although some are half-ounce candies

60 Views Asked by At

A small candy shop offers three types of half-ounce candies, four types of one-ounce candies, two types of two-ounce candies, and one type of four ounce candy. Write an expression for the generating function in which the coefficient of $x^n$ is the number of $n$ ounces of candy, where $n$ is an integer, that can be purchased.

I'm unsure how to deal with the half-ounce candies. I'm thinking that I take the coefficient of $\frac{x^{2n}}{(2n)!}$ instead of the coefficient of $\frac{x^n}{n!}$. Therefore the result would be $$\frac{1}{(1-x)^3(1-x^2)^4(1-x^4)^2(1-x^8)}$$ Any advice would be helpful!

1

There are 1 best solutions below

0
On

The only problem with that is that the problem statement seems to insist that the coefficient of $x^n$ be the number of ways that $n$ ounces of candy can be purchased. So I suspect the (ordinary, as Donald suggests in comments) generating function would be $$\frac{1}{(1-\sqrt x)^3(1-x)^4(1-x^2)^2(1-x^4)}$$ I've never done that before with a non-integer power, but I can't think of a reason it wouldn't work like normal.