Permutations with repeats in groups

Hi guys, need help with the following question
Permutation formula with repeats is as follows

The number of different permutations of n objects, where there are n1 indistinguishable objects of style 1, n2 indistinguishable objects of style 2, ..., and nk indistinguishable objects of style k is:


So for example, if i wanna order the letters of the CCSS they would be

My questions is, given there are identical items and i want to arrange n items in groups of k, how can i genaralize a formula.
For example, i want to order arrange CCSS in groups of 2 (where order matters)
I know, the answer will be 4 (CC-CS-SC-SS) constructing all the outcomes, but is there a way to generalize these?



TS Contributor
I would try it like this: 1. assume all elements are different - then the total number of groups of k elements will be the combination of n by ks n!/(n-k)!k! Substract from this the number of groups of k that you can build from the r identical elements minus one.

In the case where you have CCSS the calculation would go like - total number of pairs, assuming the Cs and thenS-s are all distinct is 6. I can build 2 pairs of Cs (C1C2 and C2C1 ) and two pairs of Ss in the same way, so the total number of pairs with indistinguishable Cs and Ss is 6-(2-1)-(2-1)=4.

I hope I got it right.