Permute

Permute[expr,perm]

permutes the positions of the elements of expr according to the permutation perm.

Permute[expr,gr]

returns the list of permuted forms of expr under the elements of the permutation group gr.

Details

  • Permute works with any nonatomic expressions, operating on the first level of expressions.
  • Permute reorders the elements of an expression but never changes its length.
  • The permutation perm can be given in disjoint cyclic form or as a permutation list.
  • When perm is given in cyclic form Cycles[{cyc1,cyc2,}], a cycle {p1,p2,} moves the elements of expr in a cyclic manner so that expr[[pi]] is moved to position pi+1.
  • When perm is given as a permutation list, the result is equivalent to the use of Permute[expr,PermutationCycles[perm]].
  • A permutation group gr can be specified by generators, with head PermutationGroup, or in named form, with head SymmetricGroup, AlternatingGroup, .

Examples

open allclose all

Basic Examples  (3)

Cyclic permutation of three elements in a list:

Equivalent action with a permutation list:

Take the lowercase alphabet:

Exchange the first and last character:

Permute several characters:

Permute an expression under all elements of a group:

Scope  (3)

Permute the parts of an expression:

Permute the parts of an expression under all elements of a group:

Give a permutation in list form. The length of the expression does not change:

Applications  (1)

The eight possible rotations and reflections of a square:

Properties & Relations  (6)

Permute never changes the number of parts of an expression. It simply reorders them:

However, Part can change the number of parts:

When applied to the identity permutation list, Permute is the inverse of PermutationReplace:

Another way of inverting the action of Permute is using FindPermutation:

When all parts of the expression are different, the permutation can be uniquely recovered:

Permute is a right action with respect to the product of permutations:

Dimensions[Transpose[array,perm]] is equivalent to Permute[Dimensions[array],perm]:

Compute the same results with the Cycles form of the permutation:

Applying Permute to a vector is equivalent to multiplying the vector from the right with a permutation matrix:

Possible Issues  (1)

Permute and Part interpret permutation lists in different ways:

Permute places the first object at the third position, the second object at the first position and the third object at the second position:

Part places the third object at the first position, the first object at the second position and the second object at the third position:

Those interpretations are effectively the inverse of each other:

Wolfram Research (2010), Permute, Wolfram Language function, https://reference.wolfram.com/language/ref/Permute.html.

Text

Wolfram Research (2010), Permute, Wolfram Language function, https://reference.wolfram.com/language/ref/Permute.html.

CMS

Wolfram Language. 2010. "Permute." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Permute.html.

APA

Wolfram Language. (2010). Permute. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Permute.html

BibTeX

@misc{reference.wolfram_2024_permute, author="Wolfram Research", title="{Permute}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/Permute.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_permute, organization={Wolfram Research}, title={Permute}, year={2010}, url={https://reference.wolfram.com/language/ref/Permute.html}, note=[Accessed: 21-November-2024 ]}