Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 Bib Ind

### 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 $$\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> 

#### 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> 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 Bib Ind

generated by GAPDoc2HTML