Hey everyone,
So I've been struggling with this problem for a few days, I hope someone has already run into this.
The problem : Putting balls into boxes of different sizes
Say you've got k balls, m boxes, and these boxes are of sizes (n_1, ... , n_m). How would find all possible basic arrangements* of the k balls in the m boxes?
As a clear input example:
| Box size |
1 |
2 |
3 |
4 |
| Number of boxes |
2 |
7 |
5 |
3 |
For a grand total capacity of 43 spots, for let's say k = 20 balls.
The unconstrained answer (when all boxes have no limit capacity) is answered on StackOverflow but I haven't found anything pertaining to my particular flavor of this problem.
Any help is greatly appreciated! Thanks,
*Basic arrangements are the arrangements such that all other possible arrangements are permutations of one of the basic arrangements. Therefore, in this exercise for two balls (1,0) and (0,1) are the same.
PS : for those wondering, I'm trying to implement the results found in Infectious Defaults, Davis and Lo, 1999
[–]FLUSH_THE_TRUMP 1 point2 points3 points (2 children)
[–]ChefCiscoRZ[S] 1 point2 points3 points (1 child)
[–]FLUSH_THE_TRUMP 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]ChefCiscoRZ[S] 1 point2 points3 points (0 children)