Message Boards Message Boards

Compute the composition of two permutations?

GROUPS:

{2,4,1,3} and {3,1,2,4} are two permutations of {1,2,3,4}.How to find the composition of these two permutations which is {1,2,4,3} (composition from right to left)?Thanks.

POSTED BY: jagannath debata
Answer
15 days ago

You can use Permute and Fold:

Fold[Permute, {1, 2, 3, 4}, {{3, 1, 2, 4}, {2, 4, 1, 3}}]

{1, 2, 4, 3}
POSTED BY: Gianluca Gorni
Answer
15 days ago

Thanks Gorni for the prompt reply

POSTED BY: jagannath debata
Answer
15 days ago

You could also use Part:

Part[{2,4,1,3},{3,1,2,4}]

{1,2,4,3}

Shorthand:

{2,4,1,3}[[{3,1,2,4}]]

{1,2,4,3}
POSTED BY: Hans Milton
Answer
13 days ago

Thanks Milton.Its easy to remember.

POSTED BY: jagannath debata
Answer
12 days ago

Group Abstract Group Abstract