Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
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
Project: cocalc-sagemath-dev-slelievre
Views: 418346<Chapter><Heading>Some Permutation Essentials</Heading>1In this chapter we mention a couple functions that are fairly basic but useful tools to2work with.34<Section><Heading> Complement </Heading>56<ManSection>7<Func Name="PermComplement" Arg="perm"/>8<Returns>The permutation that is the complement of <C>perm</C>.</Returns>9<Description>10The complement of a permutation <M>\tau=\tau_{1}\ldots\tau_{n}</M> is the permutation11<Display Mode="M">\tau^{C}=(n+1)-\tau_{1}\ \ (n+1)-\tau_{2}\ldots (n+1)-\tau_{n}</Display>.12<Example><![CDATA[13gap> PermComplement([3,2,8,6,7,1,5,4]);14[ 6, 7, 1, 3, 2, 8, 4, 5 ]15gap> ]]></Example>16</Description>17</ManSection>18</Section>1920<Section><Heading> Rank Encoding </Heading>21<ManSection>22<Func Name="IsRankEncoding" Arg="perm"/>23<Returns><C>true</C> if <C>perm</C> is a valid rank encoding of a permutation.</Returns>24<Description>25<C>IsRankEncoding</C> checkes whether the input list <C>perm</C> is a valid rank encoding26by checking whether it is accepted by the bounded class automaton, with the highest rank27being set by the highest element in <C>perm</C>.28<Example><![CDATA[29gap> IsRankEncoding([3,2,6,4,4,1,2,1]);30true31gap> IsRankEncoding([3,2,6,4,5,1,2,1]);32false33gap> ]]></Example>34</Description>35</ManSection>36</Section>3738<!--<Section><Heading> Acceptance </Heading> -->39<!--<ManSection> -->40<!-- <Func Name="IsAcceptedWord" Arg="aut,perm"/> -->41<!-- <Returns><C>true</C> if <C>perm</C> is accepted by <C>aut</C>.</Returns> -->42<!-- <Description> -->43<!-- <C>IsAcceptedWord</C> checkes whether the input rank encoded <C>perm</C> is an accepted -->44<!-- permutation of <C>aut</C>. What makes <C>IsAcceptedWord</C> special is that it -->45<!-- translates the input list into a rational expression in terms of the appropriate alphabet -->46<!-- for the automata used in <C>PatternClass</C>. -->47<!--<Example><![CDATA[ -->48<!--gap> a:=MinimalAutomaton(GraphToAut(Seqstacks(2,2),1,6)); -->49<!--< deterministic automaton on 3 letters with 3 states > -->50<!--gap> IsAcceptedWord(a,[ 3, 3, 3, 1, 3, 1, 2, 1 ]); -->51<!--true -->52<!--gap> ]]></Example> -->53<!-- </Description> -->54<!--</ManSection> -->55<!--</Section> -->56575859</Chapter>606162