Iterator[Inversion]
LeftInversionToPermutation
convert left inversion table to permutation
Calling Sequence
Parameters
Description
Examples
References
Compatibility
LeftInversionToPermutation(b)
b
-
{list,rtable}; left inversion table
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 0≤bj≤n−j.
The output is an Array indexed from 1 to n that contains a permutation of the integers from 1 to n.
with⁡Iterator:-Inversion:
b≔0,2,1,0
a≔LeftInversionToPermutation⁡b
a≔1432
PermutationToLeftInversion⁡a
0210
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 O⁡n⁢log⁡n, rather than O⁡n2.
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
Download Help Document