Message Boards Message Boards

GROUPS:

Compute the composition of two permutations?

Posted 11 months ago
709 Views
|
4 Replies
|
3 Total Likes
|

{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.

4 Replies

You can use Permute and Fold:

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

{1, 2, 4, 3}

Thanks Gorni for the prompt reply

Posted 11 months 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}

Thanks Milton.Its easy to remember.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract