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
10 Miscellaneous functions
3
4
This temporary chapter is dedicated to miscellaneous functions that are
5
relevant to some specific ongoing research questions.
6
7
8
10.1 Permutation Inclusion Set
9
10
This section is dedicated to the search of the set of permutations which lay
11
in between two permutations. Formally that is I_π,ρ = {ρ : π ≤ ρ σ}.
12
13
10.1-1 InbetweenPermAutomaton
14
15
InbetweenPermAutomaton( perm1, perm2 )  function
16
Returns: An automaton which accepts the encoded permutations between perm1
17
and perm2 where, perm2 is the subpermutation.
18
19
InbetweenPermAutomaton creates the intersection language between the
20
language of all subpermutations of perm1 and the language of
21
superpermutations of perm2.
22
23
 Example 
24
 gap> InbetweenPermAutomaton([3,2,1,4,6,5],[1,2]);
25
 < deterministic automaton on 3 letters with 8 states >
26
 gap> Display(last);
27
 | 1 2 3 4 5 6 7 8
28
 -----------------------------
29
 a | 2 2 1 1 6 3 2 6
30
 b | 2 2 4 2 2 4 5 5
31
 c | 2 2 2 2 2 2 2 7
32
 Initial state: [ 8 ]
33
 Accepting states: [ 1, 3 ]
34
 gap> 
35

36
37
10.1-2 InbetweenPermSet
38
39
InbetweenPermSet( perm1, perm2 )  function
40
Returns: A list which contains the permutations between perm1 and perm2
41
where, perm2 is the subpermutation.
42
43
Using InbetweenPermAutomaton we create the set of all permutations laying
44
between the input permutations.
45
46
 Example 
47
gap> InbetweenPermSet([3,2,1,4,6,5],[1,2]);
48
[ [ 1, 2 ], [ 1, 2, 3 ], [ 1, 3, 2 ], [ 2, 1, 3 ], [ 1, 2, 4, 3 ],
49
 [ 2, 1, 3, 4 ], [ 2, 1, 4, 3 ], [ 3, 2, 1, 4 ], [ 2, 1, 3, 5, 4 ],
50
 [ 3, 2, 1, 4, 5 ], [ 3, 2, 1, 5, 4 ], [ 3, 2, 1, 4, 6, 5 ] ]
51
gap> 
52

53
54
10.1-3 IsSubPerm
55
56
IsSubPerm( perm1, perm2 )  function
57
Returns: true if perm2 is a subpermutation of perm1.
58
59
Creates the automaton accepting all subpermutations of perm1 of the same
60
rank or less, and checks whether the automaton accepts the rank encoding of
61
perm2.
62
63
 Example 
64
gap> IsSubPerm([2,4,6,8,1,3,5,7],[2,3,1]);
65
true
66
gap> IsSubPerm([2,4,6,8,1,3,5,7],[3,2,1]);
67
false
68
gap> 
69

70
71
72
10.2 Automaton Manipulation
73
74
10.2-1 LoopFreeAut
75
76
LoopFreeAut( aut )  function
77
Returns: An automaton without any loops of length 1.
78
79
LoopFreeAut builds the subautomaton of aut that does not contain any loops
80
of length 1, except for the sink state.
81
82
 Example 
83
gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]);
84
< deterministic automaton on 3 letters with 4 states >
85
gap> Display(a);
86
 | 1 2 3 4
87
-----------------
88
 a | 2 4 3 3
89
 b | 4 4 1 4
90
 c | 3 1 2 4
91
Initial state: [ 1 ]
92
Accepting state: [ 2 ]
93
gap> b:=LoopFreeAut(a);
94
< deterministic automaton on 3 letters with 5 states >
95
gap> Display(b);
96
 | 1 2 3 4 5
97
--------------------
98
 a | 2 4 5 3 5
99
 b | 4 4 1 5 5
100
 c | 3 1 2 5 5
101
Initial state: [ 1 ]
102
Accepting state: [ 2 ]
103
gap> 
104

105
106
10.2-2 LoopVertexFreeAut
107
108
LoopVertexFreeAut( aut )  function
109
Returns: An automaton without any vertices that had loops of length 1.
110
111
LoopVertexFreeAut builds the subautomaton that does not contain the vertices
112
and transitions of vertices in aut that have loops of length 1. The function
113
minimalises and determinises the automaton before returning it, which might
114
change the numbering on the vertices, but the returned automaton is
115
isomorphic to the subautomaton of aut.
116
117
 Example 
118
gap> a:=Automaton("det",4,3,[[2,4,3,3],[4,4,1,4],[3,1,2,4]],[1],[2]);
119
< deterministic automaton on 3 letters with 4 states >
120
gap> Display(a);
121
 | 1 2 3 4
122
-----------------
123
 a | 2 4 3 3
124
 b | 4 4 1 4
125
 c | 3 1 2 4
126
Initial state: [ 1 ]
127
Accepting state: [ 2 ]
128
gap> b:=LoopVertexFreeAut(a);
129
< deterministic automaton on 3 letters with 3 states >
130
gap> Display(b);
131
 | 1 2 3
132
--------------
133
 a | 2 2 1
134
 b | 2 2 2
135
 c | 3 2 2
136
Initial state: [ 3 ]
137
Accepting state: [ 1 ]
138
gap> 
139

140
141
142