# Number of ways to put $n$ indistinguishable objects into $k$ distinguishable various-size bins

Similar questions have been asked before, however in this case each of the bins may each have a different capacity. Example: There are $2$ possibilities to put $7$ objects into two bins of the size $5$ and $3$, respectively. Is there a formula that will result in the amount of ways this can be done given the number of objects and the bin sizes?

PS: I've already come up with a way on how to brute force this by simply checking all possible combinations and counting the valid ones. I was just wondering if there was an easier way to approach this.

• My answer to this question gives a complete solution to a concrete numerical problem in which the sizes are all the same. My answer to this question shows what modifications are necessary when the sizes are not all the same. Oct 4, 2015 at 17:42
• Too bad there's no way to upvote a comment, you pointed me on the right track and I managed to solve the problem. Oct 12, 2015 at 13:32
• @LeoTietz I have the same problem - did you find a closed formula solution for the general problem? If so do you mind sharing it? Dec 11, 2016 at 20:11