I have made a Ruby program, which enumerates the possible multiset partitions, into a given number of disjoint sets (N), also called bins. The bins are indistinguishable. They can be sorted in any order, and have no distinctive markings. Furhermore every bins must hold at least 1 element.
My program uses simple backtracking to count all the possible cases, and a "trie" data structure to store the already found partitionings (to avoid cycles in a graph, and infinite cycles).
Now I would like to verify, that my program provides correct results. For example when I have 11 elements, and 7 - 2 - 2 elements are indistinguishable, they are marked as 1., 2., and 3., so I have have three types of elements, and alltogether 11 pieces of them (1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3), which should be sorted out into 4 disjoint set, or we can call it bins too. In this case my program provided these list: https://pastebin.com/UJFD8WPY
Which is 358 possible partitioning of the multiset, for those 11 not unique elements, which contains repeated elements too, to form a multiset.
In the case, when there are 15 elements: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 2, 2, then the possible partitionings were: 1931
For the set "1, 1, 2, 3, 3, 3, 3, 3, 3, 4, 5, 6" into 4 bins I got: 6946 possible partitioning.
How could I verify these results?
I encountered this problem when I wanted to sort images into rows, but in an optimal way: every image should show the same area. It is not possible of course, as image characteristics, like aspect ratios differ, but minimizing the variance of the areas is possible.
I think this problem is equivalent of integer factorization (called multiplicative partitions or "factorisatio numerorum" https://en.wikipedia.org/wiki/Multiplicative_partition ): the number of possible factorization of an integer to their prime components, which also can have their multiplicities of course, and the product consist of N coefficients. For example an integer of the form ppqqr can be decomposed into two factor products: p*(pqr), pp(qqr), etc.