Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

7 Some Permutation Essentials
 7.1 Complement
 7.2 Rank Encoding

7 Some Permutation Essentials

In this chapter we mention a couple functions that are fairly basic but useful tools to work with.

7.1 Complement

7.1-1 PermComplement
‣ PermComplement( perm )( function )

Returns: The permutation that is the complement of perm.

The complement of a permutation τ=τ_1...τ_n is the permutation

τ^C=(n+1)-τ_1 (n+1)-τ_2... (n+1)-τ_n

.

gap> PermComplement([3,2,8,6,7,1,5,4]);
[ 6, 7, 1, 3, 2, 8, 4, 5 ]
gap> 

7.2 Rank Encoding

7.2-1 IsRankEncoding
‣ 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> 
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 Bib Ind

generated by GAPDoc2HTML