Permutation: Permute part...

A command to create a new Permutation which is a copy of the first selected Permutation but with a part that has been permuted according to a specification given by the second one.

Settings

Start index
the position in the first selected Permutation where the modification by the second one should start.

Examples

Suppose the first permutation p1 is (1,2,3,4,5,6,7,8,9,10,11) and the second one p2 is (2,3,5,1,4).

1. With Start index set to 1, the newly generated permutation p3 will be ((2,3,5,1,4), 6,7,8,9,10,11). The new p3 will have the same number of elements as p1. The permutation p2 which has 5 elements starts to operate at the first element and will stop after the fifth element. The first five elements in p3 will therefore equal the permuted first five elements of p1, while the last 6 elements of p3 will be a copy of those in p1.

2. With Start index set to 6, the newly generated permutation will be (1,2,3,4,5, (7,8,10,6,9), 11).


© djmw 20220929