GAP:OrderStatistics

From Groupprops
Revision as of 23:10, 16 June 2010 by Vipul (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Definition

The definition takes one argument, which is a group, and returns a list.

Method

Code

OrderStatistics := function(G)
        local L,D;
        L := List(Set(G),Order);
        D := DivisorsInt(Order(G));
        return(List(D,x->Length(Filtered(L,y->x=y))));
end;;

Here is a slight variant, the paired version, that pairs each divisor with the number of elements of that order:

OrderStatisticsPaired := function(G)
        local L,D;
        L := List(Set(G),Order);
        D := DivisorsInt(Order(G));
        return(List(D,x->[x,Length(Filtered(L,y->x=y))]));
end;;