LeftInversionToPermutation - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Iterator[Inversion]

  

LeftInversionToPermutation

  

convert left inversion table to permutation

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

LeftInversionToPermutation(b)

Parameters

b

-

{list,rtable}; left inversion table

Description

• 

LeftInversionToPermutation constructs the permutation, a, of integers 1 to n corresponding to the inversion table b, where bj is the number of elements to the left of j in a that are greater than j.

• 

The b parameter is a left inversion table; it may be a list or one-dimensional rtable indexed from one, with 0bjnj.

• 

The output is an Array indexed from 1 to n that contains a permutation of the integers from 1 to n.

Examples

withIterator:-Inversion:

b0,2,1,0

b0,2,1,0

(1)

aLeftInversionToPermutationb

a1432

(2)

PermutationToLeftInversiona

0210

(3)

References

  

Knuth, Donald Ervin. The Art of Computer Programming, volume 3, 2nd ed. sorting and searching sec. 5.1.1, inversions, exercise 4, answers, pp. 591-592.  See also exercise 5; this can be made Onlogn, rather than On2.

Compatibility

• 

The Iterator[Inversion][LeftInversionToPermutation] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

Iterator

Iterator[Inversion]