For instance, for N=2, the answer is 6 (e.g. aabb, abab abba baab baba bbaa). For N=3, the answer is 1680. I'm looking for the proper formula. Thanks
Asked
Active
Viewed 41 times
1 Answers
1
The answer is $$\frac{(n^2)!}{(n!)^n}$$ This is the number of ways to divide a set of $n^2$ elements into $n$ subsets. It's the number of permutations of $n^2$ different elements, divided by the number of ways to permute the identical elements without changing the permutation.
Matt Samuel
- 58,164