In this chapter we mention a couple functions that are fairly basic but useful tools to work with.
‣ PermComplement ( perm ) | ( function ) |
Returns: The permutation that is the complement of perm
.
The complement of a permutation \(\tau=\tau_{1}\ldots\tau_{n}\) is the permutation
\[\tau^{C}=(n+1)-\tau_{1}\ \ (n+1)-\tau_{2}\ldots (n+1)-\tau_{n}\]
.
gap> PermComplement([3,2,8,6,7,1,5,4]); [ 6, 7, 1, 3, 2, 8, 4, 5 ] gap>
‣ IsRankEncoding ( perm ) | ( function ) |
Returns: true
if perm
is a valid rank encoding of a permutation.
IsRankEncoding
checkes whether the input list perm
is a valid rank encoding by checking whether it is accepted by the bounded class automaton, with the highest rank being set by the highest element in perm
.
gap> IsRankEncoding([3,2,6,4,4,1,2,1]); true gap> IsRankEncoding([3,2,6,4,5,1,2,1]); false gap>
generated by GAPDoc2HTML