[GAP Forum] Re: Cycle type of a permutation in GAP.

Greg Gamble greg.gamble at math.rwth-aachen.de
Wed May 31 18:09:42 BST 2006


Dear Forum,

On Wed, May 31, 2006 at 04:01:09PM +0100, John McDermott wrote:
> Dear Fernando,
> 
> You sent your message below to an incorrect address - it was received  
> by moderators of the Forum mailing list. I have copied this reply to  
> the GAP Forum (forum at gap-system.org).
> 
> Best wishes,
> John.
> 
> On 31 May 2006, at 15:50, Fernando Fantino wrote:
> 
> >Is there a GAP command that tests whether two permutations have the  
> >same =
> >cycle type structure?
> >
> >i.e. if x=(123) (45)(789)
> >
> >" command? " (x) = ( 3 , 2 , 2 ).
> >
> >Thanks. Fernando

To find the command for the cycle structure, he could try:

gap> ?CycleStructure
Help: several entries match this topic - type ?2 to get match [2]

[1] Reference: CycleStructurePerm
[2] Reference: CycleStructureClass
gap> ?1

> CycleStructurePerm( <perm> )                                           A

is  the  cycle structure (i.e. the numbers of cycles of different lengths)
of  <perm>.  This  is  encoded  in  a  list <l> in the following form: The
<i>-th  entry  of  <l>  contains  the number of cycles of <perm> of length
<i+1>.  If  <perm>  contains  no  cycles  of length <i+1> it is not bound.
Cycles of length 1 are ignored.

gap> SignPerm((1,2,3)(4,5));
-1
gap> CycleStructurePerm((1,2,3)(4,5,9,7,8));
[ , 1,, 1 ]

On the other hand, if the cycle structure is irrelevant and he just
wants to check two permutations have the same cycle type structure
as he asked, then he need only check conjugacy in the mutually enclosing
symmetric group:

gap> IsConjugate(SymmetricGroup(4), (1,2)(3,4), (1,3)(2,4));          
true

[Two permutations of S_n are conjugate in S_n iff they have the same
cycle structure.]

Regards,
Greg Gamble




More information about the Forum mailing list