Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/utils/doc/   (MySQL Server Version 8.1-8.4©)  Datei vom 11.8.2025 mit Größe 16 kB image not shown  

Quelle  chap3.html   Sprache: HTML

 
 products/Sources/formale Sprachen/GAP/pkg/utils/doc/chap3.html


<?xml version="1.0" encoding="1.0" encoding="UTF-8"?>

<!DOCTYPEhtmlPUBLIC"//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (Utils) - Chapter 3: Lists, Sets and Strings</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap3"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap2.html">[Previous Chapter]</a>    <a href="chap4.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap3_mj.html">[MathJax on]</a></p>
<p><a id="X7AE6EFC086C0EB3C" name="X7AE6EFC086C0EB3C"></a></p>
<div class="ChapSects"><a href="chap3.html#X7AE6EFC086C0EB3C">3 <span class="Heading">Lists, Sets and Strings</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X7C3F1E7D878AAA65">3.1 <span class="Heading">Functions for lists</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap3.html#X78B7C92681D2F13C">3.1-1 DifferencesList</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap3.html#X7975371E865B89BC">3.1-2 QuotientsList</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap3.html#X86096E73858CFABD">3.1-3 SearchCycle</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap3.html#X7EF06CAD7F35245D">3.1-4 RandomCombination</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X82F443FF84B8FCE3">3.2 <span class="Heading">Distinct and Common Representatives</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap3.html#X78105CAA847A888C">3.2-1 DistinctRepresentatives</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3.html#X8033A2FE80FC2F2A">3.3 <span class="Heading">Functions for strings</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap3.html#X870C964E7804B266">3.3-1 BlankFreeString</a></span>
</div></div>
</div>

<h3>3 <span class="Heading">Lists, Sets and Strings</span></h3>

<p><a id="X7C3F1E7D878AAA65" name="X7C3F1E7D878AAA65"></a></p>

<h4>3.1 <span class="Heading">Functions for lists</span></h4>

<p><a id="X78B7C92681D2F13C" name="X78B7C92681D2F13C"></a></p>

<h5>3.1-1 DifferencesList</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DifferencesList</code>( <var class="Arg">L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>This function has been transferred from package <strong class="pkg">ResClasses</strong>.</p>

<p>It takes a list <span class="SimpleMath">L</span> of length <span class="SimpleMath">n</span> and outputs the list of length <span class="SimpleMath">n-1</span> containing all the differences <span class="SimpleMath">L[i]-L[i-1]</span>.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">List( [1..12], n->n^3 );</span>
[ 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 1728 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">DifferencesList( last );</span>
[ 7, 19, 37, 61, 91, 127, 169, 217, 271, 331, 397 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">DifferencesList( last );</span>
[ 12, 18, 24, 30, 36, 42, 48, 54, 60, 66 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">DifferencesList( last );</span>
[ 6, 6, 6, 6, 6, 6, 6, 6, 6 ]

</pre></div>

<p><a id="X7975371E865B89BC" name="X7975371E865B89BC"></a></p>

<h5>3.1-2 QuotientsList</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ QuotientsList</code>( <var class="Arg">L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FloatQuotientsList</code>( <var class="Arg">L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>These functions have been transferred from package <strong class="pkg">ResClasses</strong>.</p>

<p>They take a list <span class="SimpleMath">L</span> of length <span class="SimpleMath">n</span> anoutput the quotients <span class="SimpleMath">L[i]/L[i-1]</span> of consecutive entries in <span class="SimpleMath">L</span>. An error is returned if an entry is zero.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">List( [0..10], n -> Factorial(n) );</span>
[ 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">QuotientsList( last );</span>
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">L := [ 1, 3, 5, -1, -3, -5 ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">QuotientsList( L );</span>
[ 3, 5/3, -1/5, 3, 5/3 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">FloatQuotientsList( L );</span>
[ 3., 1.66667, -0.2, 3., 1.66667 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">QuotientsList( [ 2, 1, 0, -1, -2 ] );</span>
[ 1/2, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<span class="GAPprompt">gap><eta="content-type" content="text/tml;charsetUTF-8 />
[ 2., 1.5, 1.33333, 1.25, 1.2, 1.16667, 1.14286, 1.125, 1.11111 ]
<span class="GAPprompt"gap;</span><spanclassGAPinputProduct( last/span>
10.<link rel="stylesheet"typetext"=manual." />

</pre></div>

<p><a id/>

 SearchCycle>

<div="func"< class"width0"<>
#82 < class""L/ar =tdright>&operation /tr><>
<p>This function has p><a id="X7AE6EFC086C0EB3C="AE6EFC086C0EB3C"/><>

<p><code class="code">SearchCycle</code> is a tool to find likely cycles in lists. What< class""><span="tocline>spanclass="nocss>nbsp> href.htmlX7C3F1E7D878AAA651span"">Functions listsspana>


<div class="example"><pre>

spanclass"GAPprompt"gap;/> <span class"L: [1..20];; L[1]:=13;;
<span class="GAPprompt">gap></span> <span class="GAPinput">for i in [1..19] do                                                     </span>
<span class="GAPprompt">></span> <span class="GAPinput">       if IsOddInt(L[i]) then L[i+1]:=3*L[i]+1; else L[i+1]:=L[i]/2; fi;</span>
<span class="GAPprompt">></span> <span class="GAPinput">   od;                                                                  </span>
<span class="GAPprompt">gap></span> <span class="GAPinput">L;                                                                      </span>
[ 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">SearchCycle( L );                                                       </span>
[ 1 ,2]
<span class="GAPprompt">gap></span> <span class="GAPinput">n := 1;;  L := [n];;</span>
< class=GAPprompt></> <span="GAPinput> in 1..0]do n=n^+)mod109; (Ln; od;/panjava.lang.StringIndexOutOfBoundsException: Index 127 out of bounds for length 127
span="GAPprompt>apgt;/>
[ 1, 2, 5, 26, 677, 363, 610, 481, 739, 715, 795, 272, 754, 157, 604, 848, 
  100spanclass="ContSS"><br /><span class="nocss">  </span><a href="chap3.html#X78105CAA847A888C">3.2-1 DistinctRepresentatives</a></span>
  21, 80, 521 7,75 7,74 17 0,4,10, 7,1,82 2, 
  378, 795,<div<div
  754, 157, 604, 84, 104 27,211 0,51 38 9,22 5,17 0,java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  848,104,27, 21, 82,51,37, 75,22,74,15, 6, 848, 1004, 
  271, 211, 802, 521, 378, 795, 272, 754, 157, 604, 848, 1004 ]
<div>
[ 157, 60<div>
<span="">gap></pan="">P : Positions L,17)<s>
[42,3,,2 4 8 8]
<span java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
12
[ 12, 12, 12, 12, 12, 12, 12 ]

</pre></div>

<p><a id="X7EF06CAD7F35245D" name="

This function has been transferred frompackage>ResClasses.



<h5.- </h5

< class"">gap;</span <span="GAPinput>List( [1..2,n-&;n^ ;/>
<> function been from <strong=pkg</strong<p>

<p> returns random < classSimpleMath/>-tuple distinct of 


<div class="example"><pre>

<span=GAPprompt>>  classD( last>
<span class="GAPprompt">gap   ,  ,6
[ 2, 16, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

</div="func"< class"" width"10">tr><d ="tdleft>codeclass""&82;/> var =Arg>L class=tdright>&;&;)/d>tr/>

<p><a id="X82F443FF84B8FCE3" name="X82F443FF84B8FCE3"></a></p<> functions have been from < classpkg<strong/java.lang.StringIndexOutOfBoundsException: Range [98, 99) out of bounds for length 98

<h4>3.2 <span class="Heading">Distinct and Common Representatives</span></h4>

<p><< class"">gapgt;</span<pan="GAPinput>ist 0.1] n &;Factorial() )/panjava.lang.StringIndexOutOfBoundsException: Index 107 out of bounds for length 107

<h5>3.<pan="GAPprompt>&t;/pan>( last ;/panjava.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91

<div class"< ""width=100%">""< =func82;DistinctRepresentatives( <ar""list)/d> =tdright&;operation;<tdtrtable/>
< class""width"0%>tr=tdleftcode=func"ã CommonRepresentatives( < class="Arglist <td =tdright&bsp;<td>/>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CommonTransversal</code>( <var class="Arg">grp</var>, <var class[ ,53 -15 3,53 ]
div=functable="" width=10"<>
func82;IsCommonTransversal(< =Arg</var var="Arg"subgrp>, < class=Arg<var/>tdtdright">(nbsp; )td
/div>

<p>These operations have been transferred from package <strong class="pkg">XMod</strong>.</p>

<p>They  with of of < class"">[1... ]/span>and systems distinct representatives simple, combinatorial.</p

<p> <span="impleMath>k> subsetshas at least >istinctRepresentatives>.</pjava.lang.StringIndexOutOfBoundsException: Index 365 out of bounds for length 365

<<id =""><

<p>531- </h5


<divp> class"SearchCycle is a tool to find likely cycles in . What, precisely,a em>ycle/em> is,isdeliberately here, andmaypossibly even change The is the beginning of the may be anything,following same pattern to be repeated severaltimes order to berecognized as a cycle.

<span">>gap></span> <span class="GAPinput">K := [ [3,4], [1,2], [2,3], [2,3,4] ];;</span>
<span ="">></spanspan="">CommonRepresentatives>
[ [ 3, 3, 3, 1 ], [ 1, 3, 4, 2 ] ]
<span classspan="GAPprompt>> od;
Group([ (1,2,3,4,5,6,7,8), (2,8)(3,7)(4,6) ])
<span class="GAPprompt"[13, 4, 20,1,5 6 ,4 ,1 4 ,1 ,2 14 ,1,  java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
<span class="GAPprompt">gap></span> <span class="GAPinput">c4 := Subgroup( d16, [ d16.1^2 ] ); </span>
Group([ (1,3,5,7)(2,4,6,8) ])
<span class="GAPprompt">gap></span> <span class="GAPinput">SetName( c4, "c4" );</span>
<span<span class"GAPprompt"gap;</span < classGAPinput( L) </span>
[ RightCoset(c4,()), RightCoset(c4,(2,8)(3,7)(4,6)), RightCoset(c4,(1java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
   3),(c4(,)(2,)(,6(,) 
<span class=< class>>span class";/>
[ (), (2,8)(3,7)(4,6), (1,2,3,4,5,6,7,8), (1,2)(3,8)(4,7)(5,6) ]
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCommonTransversal( java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 75
true

</pre></div>

<p><a id="X8033A2FE80FC2F2A" name="X8033A2FE80FC2F2A"></a></p>  21, 82 2,38 7,22 74 1, 60, 848, 104, 271,21, 802, 521, 

<h4>3.3 <span class="Heading 378 7

<p><a id="X870C964E7804B266" name="X870C964E7804B266"></a></p>

<h5>3.3-1 BlankFreeString</h5>

< class"< =func =10%"<><td="< =func"&87 BlankFreeString>(<var=""></var)><td=; td><></>
<p>This function has been transferred from package <strong class"gapgt; < =GAPinput"> =Positions,5;/>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class<
 , , f3
<span
"f1,,f3 ]"
<span
[,f3

</pre/>


< class=chlinkprevnextbot;<=."[ of ]  >&; &;[ ]/>nbsp>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href

<hr />
<p class=footgenerated<href://wwwmath.de.Luebeck">GAPDoc2HTML
</body>
</html>

100%


¤ Dauer der Verarbeitung: 0.9 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.