Message Boards Message Boards

0
|
4901 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Compute the composition of two permutations?

Posted 6 years ago

{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
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}
POSTED BY: Gianluca Gorni
Posted 6 years 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

Thanks Gorni for the prompt reply

POSTED BY: jagannath debata

Thanks Milton.Its easy to remember.

POSTED BY: jagannath debata
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