[GAP Forum] Permutation Notation
Alexander Konovalov
alexander.konovalov at gmail.com
Mon Jan 26 21:07:26 GMT 2009
On 26 Jan 2009, at 12:20, Bill Allombert wrote:
> On Mon, Jan 26, 2009 at 01:31:02AM -0800, Don King wrote:
>> Hello,
>> I am wondering if I can convert a cycle into a different notation.
>> gap> ConjugacyClasses(s10);
>> .....
>> (1,2,5,10)
>> ......
>>
>> For instance, above one represents a mapping 1->2, 2->5, 5->10, 10-
>> >1.
>> If I use a permutation notation for above one,
>>
>> 1 2 3 4 5 6 7 8 9 10
>> 2 5 3 4 10 6 7 8 9 1
>>
>> is it possible to print a permutation notation (or other similar
>> notation) rather than a cycle notation ?
>
> You can use
> Permuted([1..10],(1,2,5,10)^-1);
Hello,
there is also a function ListPerm(perm) which returns a list that
contains the images of the positive integers under the permutation
perm. That means that list[i] = i^perm, where i lies between 1 and the
largest point moved by perm (see LargestMovedPoint).
For example,
gap> ListPerm((1,2,5,10));
[ 2, 5, 3, 4, 10, 6, 7, 8, 9, 1 ]
gap> ListPerm((1,2,5,9));
[ 2, 5, 3, 4, 9, 6, 7, 8, 1 ]
Note that the length of the list is equal to the
LargestMovedPoint(perm), so dependently on your problem you might be
interested in adding the "tail"
to the resulting list or might be not.
Also, the bigger is input the more visible is that ListPerm is faster,
e.g.:
gap> s:=Random(SymmetricGroup(10000));;
gap> LargestMovedPoint(s);
10000
gap> for i in [1..10000] do ListPerm(s);od;time;
2317
gap> for i in [1..10000] do Permuted([1..10000],s^-1);od;time;
5022
Best wishes,
Alexander
More information about the Forum
mailing list