FindPermutation

FindPermutation[expr]

gives a permutation that produces expr by permuting Sort[expr].

FindPermutation[expr1,expr2]

gives a permutation that converts expr1 to expr2 for two expressions that differ only in the order of their arguments.

Details

  • The permutation is returned with head Cycles, in disjoint cyclic form.
  • If the arguments of expr1 are different, the permutation returned is uniquely defined.
  • FindPermutation[expr2,expr1] gives the inverse permutation of FindPermutation[expr1,expr2].

Examples

open allclose all

Basic Examples  (1)

Permutation relating two expressions with the same elements:

Verify the result using Permute:

Scope  (1)

For expressions containing repeated parts, the permutation is not uniquely defined. FindPermutation only returns one of them:

However, this other permutation also relates those two expressions:

Properties & Relations  (1)

Relation with Ordering:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_findpermutation, organization={Wolfram Research}, title={FindPermutation}, year={2010}, url={https://reference.wolfram.com/language/ref/FindPermutation.html}, note=[Accessed: 08-October-2024 ]}