How to count lists with identical elements in different orders as one class?

set = Tuples[{DD, Dd, Dd, dd}, 2]
Counts[set, {{DD, Dd}, {Dd, DD}}]

We treat two lists like {DD, Dd} and {Dd, DD} as the same category or identical, since they contain the same elements in different orders.

Under this rule, they count as 2.

Following the same rule, how can we make {DD, Dd} in a set count as 4? The counting rule for other lists remains consistent.

I’m not quite sure what you mean, but you might want to compare the functionality of Counts with the functionality of GroupBy. For example:

GroupBy[set, Sort, Length]
(* <|{DD, DD} -> 1, {Dd, DD} -> 4, {dd, DD} -> 2, {Dd, Dd} -> 4, {dd, Dd} -> 4, {dd, dd} -> 1|> *)

Maybe you can do something with that.

Thank you, that’s exactly the result I wanted to achieve.