Number of ways to pack K items into N bins each with capacity R

90 Views Asked by At

I am trying to figure the number ways you can pack K items into N bins where all bins have a uniform capacity of R.

For instance, lets say you have 3 items and 4 bins, where each bin has a capacity of 2.

One possible arrangement shown here

Does anyone know how to calculate this number of combinations? I am familiar with combinations with repetition but I'm not sure about the case where all bins have the same capacity R. I have seen some similar posts but couldn't find any with this problem setup.

1

There are 1 best solutions below

0
On

There would need to be a listing of patterns possible, multiplied by their permutations and placement choices, e.g. for $6$ distinct items in $5$ distinct bins with a maximum of $2$ in a bin,

  • possible patterns are $22200\;22110\;21111$
  • their permutations are $\large\frac{5!}{3!2!}\, \large\frac{5!}{2!2!1!} \;and\; \large\frac{5!}{1!4!}$
  • and placements are $\large\frac{6!}{2!2!2!}\,, \large\frac{6!}{2!2!}\;and\; \large\frac{6!}{2!}$
  • Final results $10\cdot90+30\cdot180+5\cdot360$

The computations, of course, can be merged, have been shown separately for clarity.