I have 18 elements `(2a, 2b, 2c, 3d, 4e, 5f)`

that I need to distribute into 6 unordered groups of 3.

I want to now the number of unique combinations I can make with those rules.

I read various website but as of now I only find way to measure the combination of 18 *different* elements into 6 group of 3

$$x=(18!/15!)\times(15!/12!)\times(12!/9!)\times(9!/6!)\times(6!/3!)\times(3!/1!)$$

(or in Excel format)

```
=(FACT(18)/FACT(15))*(FACT(15)/FACT(12))*(FACT(12)/FACT(9))*(FACT(9)/FACT(6))*(FACT(6)/FACT(3))*(FACT(3)/FACT(1))
```

And I’m not even sure of what I did 😀

Thanks a lot for your help

— progress —

Following @Bulbasaur link advices, the Mathematical formula should be

$$

F_{\text{group1}}(u,v,w,x,y,z)=\sum_{\substack{i,j,k,l,m,n \,\ge \,0,\\ i+j+k+l+m+n=2}} u^iv^jw^kx^ly^mz^n

$$

$$

F_{\text{group2}}(u,v,w,x,y,z)=\sum_{\substack{i,j,k,l,m,n \,\ge \,0,\\ i+j+k+l+m+n=2}} u^iv^jw^kx^ly^mz^n

$$

$$

F_{\text{group3}}(u,v,w,x,y,z)=\sum_{\substack{i,j,k,l,m,n \,\ge \,0,\\ i+j+k+l+m+n=2}} u^iv^jw^kx^ly^mz^n

$$

$$

F_{\text{group4}}(u,v,w,x,y,z)=\sum_{\substack{i,j,k,l,m,n \,\ge \,0,\\ i+j+k+l+m+n=3}} u^iv^jw^kx^ly^mz^n

$$

$$

F_{\text{group5}}(u,v,w,x,y,z)=\sum_{\substack{i,j,k,l,m,n \,\ge \,0,\\ i+j+k+l+m+n=4}} u^iv^jw^kx^ly^mz^n

$$

$$

F_{\text{group6}}(u,v,w,x,y,z)=\sum_{\substack{i,j,k,l,m,n \,\ge \,0,\\ i+j+k+l+m+n=5}} u^iv^jw^kx^ly^mz^n

$$

$$

\text{# ways}=[u^3v^3w^3x^3y^3z^3](F_{\text{group1}}\times F_{\text{group2}}\times F_{\text{group3}}\times F_{\text{group4}}\times F_{\text{group5}}\times F_{\text{group6}})

$$

I now have two questions:

first, is this formula correct (and efficient)?

Second, how do I calculate it? (I’m a designer so I usually do this kind of thing in Excel 😀 )

Thanks for you help

## Best Answer

Answer:There are $15{,}628$ ways to distribute the objects into groups.Your problem is equivalent to counting the number of $6\times 6$ matrices whose rows all sum to $3$, and whose column sums are $\{2,2,2,3,4,5\}$,

exceptthat matrices are considered equivalent when they differ by a permutation of rows.Without the row-permutation condition, you can use method 2 in my other answer to find the number of matrices. In order to account for row permutations, you can use Burnside's lemma, averaging over $S_6$ the number of matrices which are fixed by each permutation. It turns out you can count the fixed points for a permutation with a similar generating function.

This is all too complicated to be done without a computer algebra system. Here is my Mathematica program which gives the answer at the beginning: Mathematica computation of number of matrices up to row permutation.