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

Cycles

Cycles
represents a permutation with disjoint cycles .
  • The cycles of a permutation are given as lists of positive integers, representing the points of the domain in which the permutation acts.
  • A cycle represents the mapping of the to . The last point is mapped to .
  • Points not included in any cycle are assumed to be mapped onto themselves.
  • Cycles must be disjoint, that is, they must have no common points.
  • Cycles objects are automatically canonicalized by dropping empty and singleton cycles, rotating each cycle so that the smallest point appears first, and ordering cycles by the first point.
  • Cycles represents the identity permutation.
A permutation with two cycles:
Automatic evaluation to a canonical form:
A permutation with two cycles:
In[1]:=
Click for copyable input
Out[1]=
 
Automatic evaluation to a canonical form:
In[1]:=
Click for copyable input
Out[1]=
Permutations can involve any positive integers, with cycles of any length:
Identity permutation:
The identity permutation contains no cycles in its canonical form:
Permutation applied to a single point:
Points not present in the cycles are mapped onto themselves:
Cycles given in SparseArray form are automatically converted into normal lists:
Generate the list of permutations corresponding to a symmetric group:
Permutations are numerically ordered by comparing their respective lists of images:
Canonical Mathematica ordering of Cycles objects:
The identity is always sorted first:
A way to compute the inverse of a permutation:
Only positive integers can appear in cycles:
All integers must be distinct:
Permutation objects with symbolic arguments return unevaluated:
Graph representation of a permutation:
The inverse permutation has the arrows reversed:
New in 8