I've been working on problems involving sorting objects into three groups of four items each for a programming project. I'm fairly confident that the number of distinct ways to sort 12 objects into three groups of four unordered objects can be calculated in the form:
Given that the order of my groups doesn't matter, I can divide this product by $3!$, giving 5775 combinations.
If I were instead selecting from 18 objects, I presume that the answer would be calculated very similarly, as follows:
Divided again by $3!$, I come up with 107,207,100.
Now my issue is that I may have a set of >12 objects, for which I again select 12 of those objects into three groups of four, but some of the objects in the set are guaranteed to be selected into these groups, while others are not.
For example, I could have 18 objects, for which 10 of these objects are guaranteed to be selected, while the other 2 will be selected at random from the remaining 8.
I think the total number of combinations can be calculated by multiplying the number of combinations of sorting 12 objects into three groups of four by $C(8,2)$, thus: 5775 x 28 = 161,700.
But what I'm having particular trouble with is the following: how many possible combinations of a single group are there? That is, for my example case: how many ways are there to pick 4 unordered objects from a set of 18 possible objects, but there can be no more than 2 objects from a subset of 8? And then, once the first group is selected, how do I calculate the remaining combinations? Presumably, the number of combinations for the second and third groups differs depending on how many items from the subset have already been selected.