CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
2
7 Some Permutation Essentials
3
4
In this chapter we mention a couple functions that are fairly basic but
5
useful tools to work with.
6
7
8
7.1 Complement
9
10
7.1-1 PermComplement
11
12
PermComplement( perm )  function
13
Returns: The permutation that is the complement of perm.
14
15
The complement of a permutation τ=τ_1...τ_n is the permutation
16
17
18
τ^C=(n+1)-τ_1 (n+1)-τ_2... (n+1)-τ_n
19
20
.
21
22
 Example 
23
gap> PermComplement([3,2,8,6,7,1,5,4]);
24
[ 6, 7, 1, 3, 2, 8, 4, 5 ]
25
gap> 
26

27
28
29
7.2 Rank Encoding
30
31
7.2-1 IsRankEncoding
32
33
IsRankEncoding( perm )  function
34
Returns: true if perm is a valid rank encoding of a permutation.
35
36
IsRankEncoding checkes whether the input list perm is a valid rank encoding
37
by checking whether it is accepted by the bounded class automaton, with the
38
highest rank being set by the highest element in perm.
39
40
 Example 
41
gap> IsRankEncoding([3,2,6,4,4,1,2,1]);
42
true
43
gap> IsRankEncoding([3,2,6,4,5,1,2,1]);
44
false
45
gap> 
46

47
48
49