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.
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 all close allBasic Examples (1)
Permutation relating two expressions with the same elements:
FindPermutation[head[a, c, d, e, b], head[c, a, b, d, e]]Verify the result using Permute:
Permute[head[a, c, d, e, b], %]Scope (1)
For expressions containing repeated parts, the permutation is not uniquely defined. FindPermutation only returns one of them:
expr1 = head[a, b, a, c, d, a, b];
expr2 = head[b, a, c, d, a, b, a];g = FindPermutation[expr1, expr2]Permute[expr1, g] === expr2However, this other permutation also relates those two expressions:
h = Cycles[{{1, 5, 4, 3, 7, 6, 2}}];Permute[expr1, h] === expr2Properties & Relations (1)
Relation with Ordering:
expr = {a, d, c, g, h, f};FindPermutation[expr]PermutationCycles[Ordering[expr]]Tech Notes
Related Guides
History
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_2026_findpermutation, author="Wolfram Research", title="{FindPermutation}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/FindPermutation.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_findpermutation, organization={Wolfram Research}, title={FindPermutation}, year={2010}, url={https://reference.wolfram.com/language/ref/FindPermutation.html}, note=[Accessed: 13-June-2026]}