0

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. – Brian M. Scott Oct 04 '15 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. – LeoTietz Oct 12 '15 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? – smörkex Dec 11 '16 at 20:11

1 Answers1

0

X1 + X2 + X3 ...... + Xk= n (Where Xi is number of objects in the ith bin ) We need to find the number of non negative integral solutions of this equation . Which is (n+k-1)C(k-1)

Tejus
  • 620
  • Sorry if this sounds dumb, but could you provide an example for how to use this (maybe using the example in my post)? – LeoTietz Oct 04 '15 at 15:50
  • Yeah sure . Say you are given 10 identical balls and you have to put them in 3 identical bins . So you can apply (n+k-1)C(k-1) where n= 10 k=3 so we'll get 12C2 – Tejus Oct 04 '15 at 15:54
  • How would it work for my example? (7 objects, 2 bins of size 7 and 3)? – LeoTietz Oct 04 '15 at 15:58