# Counting the permuted forms of a list with repeated members under a permutation group

DeleteDuplicates[Permute[{g, g, g, g, g, e, r}, AlternatingGroup[7]]]


How to count number of lists automatically?

-
Would you explain more? –  David Carraher May 7 at 21:59
There is nothing built-in to count restricted permutations of this type. –  rasher May 7 at 23:48

Let's define your function and my proposal:

f1[l_, gr_] := Length@DeleteDuplicates@Permute[l, gr@Length@l]
f2[l_, gr_] := GroupOrder@gr@Length@l /
GroupOrder@GroupSetwiseStabilizer[gr@Length@l, {l}, Permute]


f2 isn't always faster than f1,but can calculate things where f1 fails due to memory constraints. For example:

Timing@f1[{a, a, a, a, a, a, a, a, b, b, c, c}, AlternatingGroup]


Permute::nomem: The current computation was aborted because there was insufficient memory available to complete the computation.

While:

Timing@f2[{a, a, a, a, a, a, a, a, b, b, c, c}, AlternatingGroup]
(*
{2.265625, 2970}
*)

-
I think ... Length@DeleteDuplicates[Permute[{g, g, g, g, g, e, r}, AlternatingGroup[7]]] is fine to get it. –  santosh May 8 at 14:28
@santosh Sorry.What do you mean? –  belisarius May 8 at 14:37
I just want to count the number of permutations. –  santosh May 8 at 14:41
@santosh f1 (your way) and f2 (my function) both count that. But f2 works for a larger set of lists (and larger lists). Also, it's faster in many cases. –  belisarius May 8 at 14:44
ok thanks...I got it. –  santosh May 8 at 14:47