[GAP Forum] Fwd: a question
Robert Heffernan
bob.heffernan at gmail.com
Mon Mar 14 10:26:42 GMT 2011
>> From: Zahra Gharib <zahra_gharib_7 at yahoo.com>
>> I want a program in gap which given a group and compute its commutativity degree (that is, the probability that two elements of a finite group commute.)
If G is a finite group, then the probability that two elements
selected at random (with replacement) is k/g where k is the number of
conjugacy classes in G and g is the order of G.
So, you could use something like
gap> Pr := G -> NrConjugacyClasses(G) / Order(G);
and then, for example:
gap> Pr := G -> NrConjugacyClasses(G) / Order(G);;
gap> Pr(SymmetricGroup(3));
1/2
Regards,
Bob Heffernan
More information about the Forum
mailing list