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
<Chapter><Heading>Some Permutation Essentials</Heading>
2
In this chapter we mention a couple functions that are fairly basic but useful tools to
3
work with.
4
5
<Section><Heading> Complement </Heading>
6
7
<ManSection>
8
<Func Name="PermComplement" Arg="perm"/>
9
<Returns>The permutation that is the complement of <C>perm</C>.</Returns>
10
<Description>
11
The complement of a permutation <M>\tau=\tau_{1}\ldots\tau_{n}</M> is the permutation
12
<Display Mode="M">\tau^{C}=(n+1)-\tau_{1}\ \ (n+1)-\tau_{2}\ldots (n+1)-\tau_{n}</Display>.
13
<Example><![CDATA[
14
gap> PermComplement([3,2,8,6,7,1,5,4]);
15
[ 6, 7, 1, 3, 2, 8, 4, 5 ]
16
gap> ]]></Example>
17
</Description>
18
</ManSection>
19
</Section>
20
21
<Section><Heading> Rank Encoding </Heading>
22
<ManSection>
23
<Func Name="IsRankEncoding" Arg="perm"/>
24
<Returns><C>true</C> if <C>perm</C> is a valid rank encoding of a permutation.</Returns>
25
<Description>
26
<C>IsRankEncoding</C> checkes whether the input list <C>perm</C> is a valid rank encoding
27
by checking whether it is accepted by the bounded class automaton, with the highest rank
28
being set by the highest element in <C>perm</C>.
29
<Example><![CDATA[
30
gap> IsRankEncoding([3,2,6,4,4,1,2,1]);
31
true
32
gap> IsRankEncoding([3,2,6,4,5,1,2,1]);
33
false
34
gap> ]]></Example>
35
</Description>
36
</ManSection>
37
</Section>
38
39
<!--<Section><Heading> Acceptance </Heading> -->
40
<!--<ManSection> -->
41
<!-- <Func Name="IsAcceptedWord" Arg="aut,perm"/> -->
42
<!-- <Returns><C>true</C> if <C>perm</C> is accepted by <C>aut</C>.</Returns> -->
43
<!-- <Description> -->
44
<!-- <C>IsAcceptedWord</C> checkes whether the input rank encoded <C>perm</C> is an accepted -->
45
<!-- permutation of <C>aut</C>. What makes <C>IsAcceptedWord</C> special is that it -->
46
<!-- translates the input list into a rational expression in terms of the appropriate alphabet -->
47
<!-- for the automata used in <C>PatternClass</C>. -->
48
<!--<Example><![CDATA[ -->
49
<!--gap> a:=MinimalAutomaton(GraphToAut(Seqstacks(2,2),1,6)); -->
50
<!--< deterministic automaton on 3 letters with 3 states > -->
51
<!--gap> IsAcceptedWord(a,[ 3, 3, 3, 1, 3, 1, 2, 1 ]); -->
52
<!--true -->
53
<!--gap> ]]></Example> -->
54
<!-- </Description> -->
55
<!--</ManSection> -->
56
<!--</Section> -->
57
58
59
60
</Chapter>
61
62