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

How to distribute $k$ distinct items into $p$ distinct groups with each groups receiving $a (=k-n)$ prizes at most ?

This is my attempt to generalize the constraints of my earlier question and based on the discussion/comments in this answer.

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

You want a list of $p$ sets of sets of size at most $a$.

The exponential generating function for sets of size at most $a$ is $$ 1+\frac{z}{1!}+\dots + \frac{z^a}{a!}$$

So, finally, you want to extract the coefficient of $\frac{z^k}{k!}$ from

$$ \left(1+\frac{z}{1!}+\dots+\frac{z^a}{a!}\right)^p.$$

share|cite|improve this answer
Suppose that $p=k=3$ and $a=1$. Your formula yields $[z^3]\big((1+z)^3\big)=1$, but the correct answer is clearly $3!=6$, since the items are distinct. – Brian M. Scott Nov 8 '11 at 0:48
Thanks, I am regarding exponential generating functions, and should have made that clear at the coefficient extraction stage. – Phira Nov 8 '11 at 7:24

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.