WLJS LogoWLJS Notebook

FindPermutation

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

FindPermutation[expr1, expr2] gives a permutation that converts expr1 to expr2.

Examples

Find permutation from sorted:

FindPermutation[{c, a, b}]
(* Cycles[{{1, 2, 3}}] *)

Permutation between lists:

FindPermutation[{a, b, c}, {c, a, b}]
(* Cycles[{{1, 3, 2}}] *)

Please visit the official Wolfram Language Reference for more details.

On this page