Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a homework assignment which is to write a Generating Function of the following problem:

"There are $n$ identical boxes , there are $3$ different rooms in which they can be put. Each room can hold a maximum of 24 boxes. how many ways are there to divide the $n$ boxes in the rooms (you do not have to use all the rooms)?"

I am kind of new to Generating Functions and I can't seem to figure this one out. Can someone please help me out? It would be greatly appreciated.

Thanks, Jason.

share|cite|improve this question
up vote 3 down vote accepted


We need only one variable (it can be tempting to have three, perhaps), and we pay attention to its exponent to represent how many boxes are in a room. That is to say, $x^4$ might represent 4 boxes.

I'm trying not to give it away - but suppose you get stuck. Then here is a spoiler (mouse over for more)


Suppose I had 2 rooms, each room could have up to 3 boxes, and I want to know how many ways I could place 3 boxes. Then I claim that $(1 + x + x^2 + x^3)(1 + x + x^2 + x^3)$ is the important equation. In each parenthesis, I have the possibilities in one room. The exponents refer to how many boxes are in that room. After the multiplication, I care about the coefficient of $x^3$, as that refers to how many ways 3 boxes can be stored.

share|cite|improve this answer
Thanks alot man :) – Jason Sep 5 '11 at 4:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.