This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

PermutationCycles

PermutationCycles[perm]
gives a disjoint cycle representation of permutation perm.
  • The input permutation perm can be given as a permutation list or in disjoint cyclic form.
  • A permutation list is a reordering of the consecutive integers .
  • PermutationCycles[perm] returns an expression with head Cycles containing a list of cycles, each of the form , which represents the mapping of the to . The last point is mapped to .
Cyclic form of a permutation list of length 10:
Identity permutation list:
Cyclic form of a permutation list of length 10:
In[1]:=
Click for copyable input
Out[1]=
 
Identity permutation list:
In[1]:=
Click for copyable input
Out[1]=
Action on permutation lists:
With a head other than Cycles, singletons are kept:
On other cyclic permutations the input is returned unchanged:
PermutationCycles works efficiently with large permutation lists:
Permutation cycles can be considered a sparse representation of permutation lists:
Find the signature of a permutation list:
The permutation returned by PermutationCycles[list] produces with Permute the same result as using the original list with Part:
The collection of cycles returned by PermutationCycles corresponds to the permutation that generates the list from sorted order:
PermutationList gives the inverse of PermutationCycles:
A combination of PermutationCycles and PermutationList adds singletons:
A Mathematica implementation of PermutationCycles:
The built-in version is faster:
Number of permutations of the symmetric group with 6 to 1 cycles, including 1-cycles:
Construct an associated polynomial:
Compute the factorization:
Its coefficients are Stirling numbers of the first kind:
Average number of cycles for permutation lists of increasing length. Compare with the theoretical estimate:
New in 8