How many ways can $N$ labelled balls be placed in $M$ unlabelled boxes, provided each box must have at least $P$ balls inside?

Naturally $N > M \times P$.

Any closed form solutions would be great!

The motivation behind this question is that I want to brute force sample each of the possible configurations for particular values of $N$, $M$ and $P$. However, given that the quantity may be fairly large I want to check how many there are before trying!




For $P=1$ the answer is given by the Stirling numbers of the second kind.

For general $P$, you have the $P-$associated Stirling numbers of the second kind


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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