1# This file was created from xpl/probgen.xpl, do not edit!
2#########################################################################
3##
4#W  probgen.tst               GAP applications              Thomas Breuer
5##
6#Y  Copyright 2006,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,   Germany
7##
8##  In order to run the tests, one starts GAP from the `tst` subdirectory
9##  of the `pkg/ctbllib` directory, and calls `ReadTest( "probgen.tst" );`.
10##
11
12gap> START_TEST( "probgen.tst" );
13
14#############################################################################
15##
16##  The examples use the {\GAP} Character Table Library,
17##  the {\GAP} Library of Tables of Marks,
18##  and the {\GAP} interface to the {\ATLAS} of Group Representations,
19##  so we first load these three packages in the required versions.
20##  Also, we force the assertion level to zero;
21##  this is the default in interactive {\GAP} sessions
22##  but the level is automatically set to $1$ when a file is read with
23##  `ReadTest'.
24##
25gap> CompareVersionNumbers( GAPInfo.Version, "4.5.0" );
26true
27gap> LoadPackage( "ctbllib", "1.2" );
28true
29gap> LoadPackage( "tomlib", "1.2" );
30true
31gap> LoadPackage( "atlasrep", "1.5" );
32true
33gap> SetAssertionLevel( 0 );
34gap> max:= GAPInfo.CommandLineOptions.o;;
35gap> IsSubset( max, "m" ) and Int( Filtered( max, IsDigitChar ) ) >= 800;
36true
37gap> staterandom:= [ State( GlobalRandomSource ),
38>                    State( GlobalMersenneTwister ) ];;
39gap> ResetGlobalRandomNumberGenerators:= function()
40>     Reset( GlobalRandomSource, staterandom[1] );
41>     Reset( GlobalMersenneTwister, staterandom[2] );
42> end;;
43#############################################################################
44##
45#A  PositionsProperty( <list>, <prop> )
46##
47##  Let <list> be a dense list and <prop> be a unary function that returns
48##  `true' or `false' when applied to the entries of <list>.
49##  `PositionsProperty' returns the set of positions in <list> for which
50##  `true' is returned.
51##
52gap> if not IsBound( PositionsProperty ) then
53>      PositionsProperty:= function( list, prop )
54>        return Filtered( [ 1 .. Length( list ) ], i -> prop( list[i] ) );
55>      end;
56>    fi;
57#############################################################################
58##
59#F  TripleWithProperty( <threelists>, <prop> )
60#F  QuadrupleWithProperty( <fourlists>, <prop> )
61##
62##  Let <threelists> be a list of three lists $l_1, l_2, l_3$,
63##  and <prop> be a unary function that takes a triple $[ x_1, x_2, x_3 ]$
64##  with $x_i \in l_i$ as its argument and returns either `true' or `false'.
65##  `TripleWithProperty' returns a triple for which `prop' returns `true'
66##  if such a triple exists, and `fail' otherwise.
67##
68##  Analogously, the first argument of `QuadrupleWithProperty' is a list
69##  <fourlists> of four lists, and the second argument <prop> takes a
70##  quadruple as its argument.
71##
72gap> BindGlobal( "TripleWithProperty", function( threelists, prop )
73>     local i, j, k, test;
74>
75>     for i in threelists[1] do
76>       for j in threelists[2] do
77>         for k in threelists[3] do
78>           test:= [ i, j, k ];
79>           if prop( test ) then
80>               return test;
81>           fi;
82>         od;
83>       od;
84>     od;
85>
86>     return fail;
87> end );
88
89gap> BindGlobal( "QuadrupleWithProperty", function( fourlists, prop )
90>     local i, j, k, l, test;
91>
92>     for i in fourlists[1] do
93>       for j in fourlists[2] do
94>         for k in fourlists[3] do
95>           for l in fourlists[4] do
96>             test:= [ i, j, k, l ];
97>             if prop( test ) then
98>               return test;
99>             fi;
100>           od;
101>         od;
102>       od;
103>     od;
104>
105>     return fail;
106> end );
107#############################################################################
108##
109#F  PrintFormattedArray( <array> )
110##
111##  Let <array> be a rectangular table.
112##  `PrintFormattedArray' prints <array> such that each column is right
113##  aligned.
114##  The only difference to the {\GAP} library function `PrintArray'
115##  is that the latter prints all columns at the same width.
116##
117gap> BindGlobal( "PrintFormattedArray", function( array )
118>      local colwidths, n, row;
119>      array:= List( array, row -> List( row, String ) );
120>      colwidths:= List( TransposedMat( array ),
121>                        col -> Maximum( List( col, Length ) ) );
122>      n:= Length( array[1] );
123>      for row in List( array, row -> List( [ 1 .. n ],
124>                   i -> FormattedString( row[i], colwidths[i] ) ) ) do
125>        Print( "  ", JoinStringsWithSeparator( row, " " ), "\n" );
126>      od;
127> end );
128gap> BindGlobal( "NeededVariables", NamesUserGVars() );
129gap> BindGlobal( "CleanWorkspace", function()
130>       local name, record;
131>
132>       for name in Difference( NamesUserGVars(), NeededVariables ) do
133>        if not IsReadOnlyGlobal( name ) then
134>          UnbindGlobal( name );
135>        fi;
136>      od;
137>      for record in [ LIBTOMKNOWN, LIBTABLE ] do
138>        for name in RecNames( record.LOADSTATUS ) do
139>          Unbind( record.LOADSTATUS.( name ) );
140>          Unbind( record.( name ) );
141>        od;
142>      od;
143> end );
144#############################################################################
145##
146#F  PossiblePermutationCharacters( <sub>, <tbl> )
147##
148##  For two ordinary character tables <sub> and <tbl>,
149##  `PossiblePermutationCharacters' returns the set of all induced class
150##  functions of the trivial character of <sub> to <tbl>,
151##  w.r.t.~the possible class fusions from <sub> to <tbl>.
152##
153gap> BindGlobal( "PossiblePermutationCharacters", function( sub, tbl )
154>     local fus, triv;
155>
156>     fus:= PossibleClassFusions( sub, tbl );
157>     if fus = fail then
158>       return fail;
159>     fi;
160>     triv:= [ TrivialCharacter( sub ) ];
161>
162>     return Set( List( fus, map -> Induced( sub, tbl, triv, map )[1] ) );
163> end );
164#############################################################################
165##
166#A  PrimitivePermutationCharacters( <tbl> )
167##
168##  For an ordinary character table <tbl> for which either the value of one
169##  of the attributes `Maxes' or `UnderlyingGroup' is stored or the table of
170##  marks is contained in the {\GAP} library of tables of marks,
171##  `PrimitivePermutationCharacters' returns the list of all primitive
172##  permutation characters of <tbl>.
173##  Otherwise `fail' is returned.
174##
175gap> DeclareAttribute( "PrimitivePermutationCharacters", IsCharacterTable );
176gap> InstallMethod( PrimitivePermutationCharacters,
177>     [ IsCharacterTable ],
178>     function( tbl )
179>     local maxes, tom, G;
180>
181>     if HasMaxes( tbl ) then
182>       maxes:= List( Maxes( tbl ), CharacterTable );
183>       if ForAll( maxes, s -> GetFusionMap( s, tbl ) <> fail ) then
184>         return List( maxes, subtbl -> TrivialCharacter( subtbl )^tbl );
185>       fi;
186>     elif HasFusionToTom( tbl ) then
187>       tom:= TableOfMarks( tbl );
188>       maxes:= MaximalSubgroupsTom( tom );
189>       return PermCharsTom( tbl, tom ){ maxes[1] };
190>     elif HasUnderlyingGroup( tbl ) then
191>       G:= UnderlyingGroup( tbl );
192>       return List( MaximalSubgroupClassReps( G ),
193>                    M -> TrivialCharacter( M )^tbl );
194>     fi;
195>
196>     return fail;
197> end );
198#############################################################################
199##
200#F  ApproxP( <primitives>, <spos> )
201##
202##  Let <primitives> be a list of primitive permutation characters of a group
203##  $G$, say, and <spos> the position of the conjugacy class of the element
204##  $s \in G$.
205##  Assume that the elements in <primitives> have the form $1_M^G$,
206##  for suitable maximal subgroups $M$ of $G$,
207##  and let $\MM$ be the set of these groups $M$.
208##  `ApproxP' returns the class function $\psi$ of $G$ that is defined by
209##  $\psi(1) = 0$ and
210##  \[
211##     \psi(g) = \sum_{M \in \MM}
212##                   \frac{1_M^G(s) \cdot 1_M^G(g)}{1_M^G(1)}
213##  \]
214##  otherwise.
215##
216##  If <primitives> contains all those primitive permutation characters
217##  $1_M^G$ of $G$ (with multiplicity according to the number of conjugacy
218##  classes of these maximal subgroups) that do not vanish at $s$,
219##  and if all these $M$ are self-normalizing in $G$
220##  --this holds for example if $G$ is a finite simple group--
221##  then $\psi(g) = \total( g, s )$ holds.
222##
223##  The latter is an upper bound for the proportion
224##  $\prop( g, s )$ of elements in the conjugacy class of $s$ that generate
225##  together with $g$ a proper subgroup of $G$.
226##
227##  Note that if $\prop( g, s )$ is less than $1/k$ for all
228##  $g \in G^{\times}$ then $G$ has spread at least $k$.
229##
230gap> BindGlobal( "ApproxP", function( primitives, spos )
231>     local sum;
232>
233>     sum:= ShallowCopy( Sum( List( primitives,
234>                                   pi -> pi[ spos ] * pi / pi[1] ) ) );
235>     sum[1]:= 0;
236>
237>     return sum;
238> end );
239#############################################################################
240##
241#F  ProbGenInfoSimple( <tbl> )
242##
243##  Let <tbl> be the ordinary character table of a finite simple group $S$.
244##  If the full list of primitive permutation characters of <tbl> cannot be
245##  computed with `PrimitivePermutationCharacters' then `fail' is returned.
246##  Otherwise `ProbGenInfoSimple' returns a list of length $5$, containing
247##  the identifier of <tbl>,
248##  the value $\total(S)$,
249##  the value $\sprtotal( S )$,
250##  a list of {\ATLAS} names of the classes of elements $s$ for which
251##  $\total(S) = \total( S, s )$ holds,
252##  and the list of the corresponding cardinalities $|\M(S,s)|$.
253##
254gap> BindGlobal( "ProbGenInfoSimple", function( tbl )
255>     local prim, max, min, bound, s;
256>     prim:= PrimitivePermutationCharacters( tbl );
257>     if prim = fail then
258>       return fail;
259>     fi;
260>     max:= List( [ 1 .. NrConjugacyClasses( tbl ) ],
261>                 i -> Maximum( ApproxP( prim, i ) ) );
262>     min:= Minimum( max );
263>     bound:= Inverse( min );
264>     if IsInt( bound ) then
265>       bound:= bound - 1;
266>     else
267>       bound:= Int( bound );
268>     fi;
269>     s:= PositionsProperty( max, x -> x = min );
270>     s:= List( Set( List( s, i -> ClassOrbit( tbl, i ) ) ), i -> i[1] );
271>     return [ Identifier( tbl ),
272>              min,
273>              bound,
274>              AtlasClassNames( tbl ){ s },
275>              Sum( List( prim, pi -> pi{ s } ) ) ];
276> end );
277#############################################################################
278##
279#F  ProbGenInfoAlmostSimple( <tblS>, <tblG>, <sposS> )
280##
281##  Let <tblS> be the ordinary character table of a finite simple group $S$,
282##  <tblG> be the character table of an automorphic extension $G$ of $S$
283##  in which $S$ has prime index,
284##  and <sposS> a list of class positions in <tblS>.
285##
286##  If the full list of primitive permutation characters of <tblG> cannot be
287##  computed with `PrimitivePermutationCharacters' then `fail' is returned.
288##  Otherwise `ProbGenInfoAlmostSimple' returns a list of length five,
289##  containing
290##  the identifier of <tblG>,
291##  the maximum $m$ of $\total^{\prime}( G, s )$,
292##  for $s$ in the classes described by <sposS>,
293##  a list of {\ATLAS} names (w.r.t. $G$) of the classes of elements $s$
294##  for which this maximum is attained,
295##  and the list of the corresponding cardinalities $|\M^{\prime}(G,s)|$.
296##
297gap> BindGlobal( "ProbGenInfoAlmostSimple", function( tblS, tblG, sposS )
298>     local p, fus, inv, prim, sposG, outer, approx, l, max, min,
299>           s, cards, i, names;
300>
301>     p:= Size( tblG ) / Size( tblS );
302>     if not IsPrimeInt( p )
303>        or Length( ClassPositionsOfNormalSubgroups( tblG ) ) <> 3 then
304>       return fail;
305>     fi;
306>     fus:= GetFusionMap( tblS, tblG );
307>     if fus = fail then
308>       return fail;
309>     fi;
310>     inv:= InverseMap( fus );
311>     prim:= PrimitivePermutationCharacters( tblG );
312>     if prim = fail then
313>       return fail;
314>     fi;
315>     sposG:= Set( fus{ sposS } );
316>     outer:= Difference( PositionsProperty(
317>                 OrdersClassRepresentatives( tblG ), IsPrimeInt ), fus );
318>     approx:= List( sposG, i -> ApproxP( prim, i ){ outer } );
319>     if IsEmpty( outer ) then
320>       max:= List( approx, x -> 0 );
321>     else
322>       max:= List( approx, Maximum );
323>     fi;
324>     min:= Minimum( max);
325>     s:= sposG{ PositionsProperty( max, x -> x = min ) };
326>     cards:= List( prim, pi -> pi{ s } );
327>     for i in [ 1 .. Length( prim ) ] do
328>       # Omit the character that is induced from the simple group.
329>       if ForAll( prim[i], x -> x = 0 or x = prim[i][1] ) then
330>         cards[i]:= 0;
331>       fi;
332>     od;
333>     names:= AtlasClassNames( tblG ){ s };
334>     Perform( names, ConvertToStringRep );
335>
336>     return [ Identifier( tblG ),
337>              min,
338>              names,
339>              Sum( cards ) ];
340> end );
341#############################################################################
342##
343#F  SigmaFromMaxes( <tbl>, <sname>, <maxes>, <numpermchars> )
344#F  SigmaFromMaxes( <tbl>, <sname>, <maxes>, <numpermchars>, <choice> )
345##
346##  Let <tbl> be the ordinary character table of a finite almost simple group
347##  $G$ with socle $S$,
348##  <sname> be the name of a class in <tbl>,
349##  <maxes> be a list of character tables of all those maximal subgroups
350##  of $G$ which contain elements $s$ in the class with the name <sname>.
351##  Further let <numpermchars> be a list of integers such that the $i$-th
352##  entry in <maxes> induces `<numpermchars>[i]' different permutation
353##  characters.
354##  (So if several classes of maximal subgroups in $G$ induce the same
355##  permutation character then the table of this subgroup must occur with
356##  this multiplicity in <maxes>, and the corresponding entries in
357##  <numpermchars> must be $1$.
358##  Conversely, if there are $n$ classes of isomorphic maximal subgroups
359##  which induce $n$ different permutation characters then the table must
360##  occur only once in <maxes>, and the corresponding multiplicity in
361##  <numpermchars> must be $n$.)
362##
363##  The return value is `fail' if there is an entry `<maxes>[i]' such that
364##  `PossiblePermutationCharacters' does not return a list of length
365##  `<numpermchars>[i]' when its arguments are `<maxes>[i]' and <tbl>.
366##
367##  If the string `"outer"' is entered as the optional argument <choice> then
368##  $G$ is assumed to be an automorphic extension of $S$,
369##  with $[G:S]$ a prime,
370##  and $\total^{\prime}(G,s)$ is returned.
371##
372##  Otherwise `SigmaFromMaxes' returns $\total(G,s)$.
373##
374gap> BindGlobal( "SigmaFromMaxes", function( arg )
375>     local t, sname, maxes, numpermchars, prim, spos, outer;
376>
377>     t:= arg[1];
378>     sname:= arg[2];
379>     maxes:= arg[3];
380>     numpermchars:= arg[4];
381>     prim:= List( maxes, s -> PossiblePermutationCharacters( s, t ) );
382>     spos:= Position( AtlasClassNames( t ), sname );
383>     if ForAny( [ 1 .. Length( maxes ) ],
384>                i -> Length( prim[i] ) <> numpermchars[i] ) then
385>       return fail;
386>     elif Length( arg ) = 5 and arg[5] = "outer" then
387>       outer:= Difference(
388>           PositionsProperty( OrdersClassRepresentatives( t ), IsPrimeInt ),
389>           ClassPositionsOfDerivedSubgroup( t ) );
390>       return Maximum( ApproxP( Concatenation( prim ), spos ){ outer } );
391>     else
392>       return Maximum( ApproxP( Concatenation( prim ), spos ) );
393>     fi;
394> end );
395#############################################################################
396##
397#F  DisplayProbGenMaxesInfo( <tbl>, <snames> )
398##
399##  For a character table <tbl> with known `Maxes' value and a list <snames>
400##  of class names in <tbl>,
401##  `DisplayProbGenMaxesInfo' prints a description of the maximal subgroups
402##  of <tbl> that contain an element $s$ in the classes with names in the
403##  list <snames>.
404##  Printed are the `Identifier' values of the tables of the maximal
405##  subgroups and the number of conjugate subgroups in this class
406##  that contain $s$.
407##
408gap> BindGlobal( "DisplayProbGenMaxesInfo", function( tbl, snames )
409>     local mx, prim, i, spos, nonz, indent, j;
410>
411>     if not HasMaxes( tbl ) then
412>       Print( Identifier( tbl ), ": fail\n" );
413>       return;
414>     fi;
415>
416>     mx:= List( Maxes( tbl ), CharacterTable );
417>     prim:= List( mx, s -> TrivialCharacter( s )^tbl );
418>     Assert( 1, SortedList( prim ) =
419>                SortedList( PrimitivePermutationCharacters( tbl ) ) );
420>     for i in [ 1 .. Length( prim ) ] do
421>       # Deal with the case that the subgroup is normal.
422>       if ForAll( prim[i], x -> x = 0 or x = prim[i][1] ) then
423>         prim[i]:= prim[i] / prim[i][1];
424>       fi;
425>     od;
426>
427>     spos:= List( snames,
428>                  nam -> Position( AtlasClassNames( tbl ), nam ) );
429>     nonz:= List( spos, x -> PositionsProperty( prim, pi -> pi[x] <> 0 ) );
430>     for i in [ 1 .. Length( spos ) ] do
431>       Print( Identifier( tbl ), ", ", snames[i], ": " );
432>       indent:= ListWithIdenticalEntries(
433>           Length( Identifier( tbl ) ) + Length( snames[i] ) + 4, ' ' );
434>       if not IsEmpty( nonz[i] ) then
435>         Print( Identifier( mx[ nonz[i][1] ] ), "  (",
436>                prim[ nonz[i][1] ][ spos[i] ], ")\n" );
437>         for j in [ 2 .. Length( nonz[i] ) ] do
438>           Print( indent, Identifier( mx[ nonz[i][j] ] ), "  (",
439>                prim[ nonz[i][j] ][ spos[i] ], ")\n" );
440>         od;
441>       else
442>         Print( "\n" );
443>       fi;
444>     od;
445> end );
446#############################################################################
447##
448#F  PcConjugacyClassReps( <G> )
449##
450##  Let <G> be a finite solvable group.
451##  `PcConjugacyClassReps' returns a list of representatives of
452##  the conjugacy classes of <G>,
453##  which are computed using a polycyclic presentation for <G>.
454##
455gap> BindGlobal( "PcConjugacyClassReps", function( G )
456>      local iso;
457>
458>      iso:= IsomorphismPcGroup( G );
459>      return List( ConjugacyClasses( Image( iso ) ),
460>               c -> PreImagesRepresentative( iso, Representative( c ) ) );
461> end );
462#############################################################################
463##
464#F  ClassesOfPrimeOrder( <G>, <primes>, <N> )
465##
466##  Let <G> be a finite group, <primes> be a list of primes,
467##  and <N> be a normal subgroup of <G>.
468##  `ClassesOfPrimeOrder' returns a list of those conjugacy classes of <G>
469##  that are not contained in <N>
470##  and whose elements' orders occur in <primes>.
471##
472##  For each prime $p$ in <primes>, first class representatives of order $p$
473##  in a Sylow $p$ subgroup of <G> are computed,
474##  then the representatives in <N> are discarded,
475##  and then representatives w. r. t. conjugacy in <G> are computed.
476##
477##  (Note that this approach may be inappropriate if an elementary abelian
478##  Sylow $p$ subgroup for a large prime $p$ occurs, and if the conjugacy
479##  tests in <G> are expensive.)
480##
481gap> BindGlobal( "ClassesOfPrimeOrder", function( G, primes, N )
482>      local ccl, p, syl, reps;
483>
484>      ccl:= [];
485>      for p in primes do
486>        syl:= SylowSubgroup( G, p );
487>        reps:= Filtered( PcConjugacyClassReps( syl ),
488>                   r -> Order( r ) = p and not r in N );
489>        Append( ccl, DuplicateFreeList( List( reps,
490>                                          r -> ConjugacyClass( G, r ) ) ) );
491>      od;
492>
493>      return ccl;
494> end );
495#############################################################################
496##
497#F  IsGeneratorsOfTransPermGroup( <G>, <list> )
498##
499##  Let <G> be a finite group that acts *transitively* on its moved points,
500##  and <list> a list of elements in <G>.
501##
502##  `IsGeneratorsOfTransPermGroup' returns `true' if the elements in <list>
503##  generate <G>, and `false' otherwise.
504##  The main point is that the return value `true' requires the group
505##  generated by `list' to be transitive, and the check for transitivity
506##  is much cheaper than the test whether this group is equal to `G'.
507##
508gap> BindGlobal( "IsGeneratorsOfTransPermGroup", function( G, list )
509>     local S;
510>
511>     if not IsTransitive( G ) then
512>       Error( "<G> must be transitive on its moved points" );
513>     fi;
514>     S:= SubgroupNC( G, list );
515>
516>     return IsTransitive( S, MovedPoints( G ) ) and Size( S ) = Size( G );
517> end );
518#############################################################################
519##
520#F  RatioOfNongenerationTransPermGroup( <G>, <g>, <s> )
521##
522##  Let <G> be a finite group that acts *transitively* on its moved points,
523##  and <g> and <s> be two elements in <G>.
524##
525##  `RatioOfNongenerationTransPermGroup' returns the proportion
526##  $\prop(g,s)$.
527##
528gap> BindGlobal( "RatioOfNongenerationTransPermGroup", function( G, g, s )
529>     local nongen, pair;
530>
531>     if not IsTransitive( G ) then
532>       Error( "<G> must be transitive on its moved points" );
533>     fi;
534>     nongen:= 0;
535>     for pair in DoubleCosetRepsAndSizes( G, Centralizer( G, g ),
536>                     Centralizer( G, s ) ) do
537>       if not IsGeneratorsOfTransPermGroup( G, [ s, g^pair[1] ] ) then
538>         nongen:= nongen + pair[2];
539>       fi;
540>     od;
541>
542>     return nongen / Size( G );
543> end );
544#############################################################################
545##
546#F  DiagonalProductOfPermGroups( <groups> )
547##
548##  Let $G$ be a group, and let <groups> be a list
549##  $[ G_1, G_2, \ldots, G_n ]$ of permutation groups such that $G_i$
550##  describes the action of $G$ on a set $\Omega_i$, say.
551##  Moreover, we require that for $1 \leq i, j \leq n$,
552##  mapping the `GeneratorsOfGroup' list of $G_i$ to that of $G_j$
553##  defines an isomorphism.
554##
555##  `DiagonalProductOfPermGroups' takes `groups' as its argument,
556##  and returns the action of $G$ on the disjoint union of
557##  $\Omega_1, \Omega_2, \ldots \Omega_n$.
558##
559gap> BindGlobal( "DiagonalProductOfPermGroups", function( groups )
560>     local prodgens, deg, i, gens, D, pi;
561>
562>     prodgens:= GeneratorsOfGroup( groups[1] );
563>     deg:= NrMovedPoints( prodgens );
564>     for i in [ 2 .. Length( groups ) ] do
565>       gens:= GeneratorsOfGroup( groups[i] );
566>       D:= MovedPoints( gens );
567>       pi:= MappingPermListList( D, [ deg+1 .. deg+Length( D ) ] );
568>       deg:= deg + Length( D );
569>       prodgens:= List( [ 1 .. Length( prodgens ) ],
570>                        i -> prodgens[i] * gens[i]^pi );
571>     od;
572>
573>     return Group( prodgens );
574> end );
575#############################################################################
576##
577#F  RepresentativesMaximallyCyclicSubgroups( <tbl> )
578##
579##  For an ordinary character table <tbl>,
580##  `RepresentativesMaximallyCyclicSubgroups' returns a list of class
581##  positions containing exactly one class of generators for each class of
582##  maximally cyclic subgroups.
583##
584gap> BindGlobal( "RepresentativesMaximallyCyclicSubgroups", function( tbl )
585>     local n, result, orders, p, pmap, i, j;
586>
587>     # Initialize.
588>     n:= NrConjugacyClasses( tbl );
589>     result:= BlistList( [ 1 .. n ], [ 1 .. n ] );
590>
591>     # Omit powers of smaller order.
592>     orders:= OrdersClassRepresentatives( tbl );
593>     for p in Set( Factors( Size( tbl ) ) ) do
594>       pmap:= PowerMap( tbl, p );
595>       for i in [ 1 .. n ] do
596>         if orders[ pmap[i] ] < orders[i] then
597>           result[ pmap[i] ]:= false;
598>         fi;
599>       od;
600>     od;
601>
602>     # Omit Galois conjugates.
603>     for i in [ 1 .. n ] do
604>       if result[i] then
605>         for j in ClassOrbit( tbl, i ) do
606>           if i <> j then
607>             result[j]:= false;
608>           fi;
609>         od;
610>       fi;
611>     od;
612>
613>     # Return the result.
614>     return ListBlist( [ 1 .. n ], result );
615> end );
616#############################################################################
617##
618#F  ClassesPerhapsCorrespondingToTableColumns( <G>, <tbl>, <cols> )
619##
620##  For a group <G>, its ordinary character table <tbl>, and a list <cols>
621##  of class positions in <tbl>,
622##  `ClassesPerhapsCorrespondingToTableColumns' returns the sublist
623##  of those conjugacy classes of `G' for which the corresponding column
624##  in `tbl' can be contained in `cols',
625##  according to element order and class length.
626##
627gap> BindGlobal( "ClassesPerhapsCorrespondingToTableColumns",
628>    function( G, tbl, cols )
629>     local orders, classes, invariants;
630>
631>     orders:= OrdersClassRepresentatives( tbl );
632>     classes:= SizesConjugacyClasses( tbl );
633>     invariants:= List( cols, i -> [ orders[i], classes[i] ] );
634>
635>     return Filtered( ConjugacyClasses( G ),
636>         c -> [ Order( Representative( c ) ), Size(c) ] in invariants );
637> end );
638#############################################################################
639##
640#F  UpperBoundFixedPointRatios( <G>, <maxesclasses>, <truetest> )
641##
642##  Let <G> be a finite group, and <maxesclasses> be a list
643##  $[ l_1, l_2, ..., l_n ]$ such that each $l_i$ is a list of conjugacy
644##  classes of maximal subgroups $M_i$ of <G>, such that all classes of
645##  prime element order in $M_i$ are contained in $l_i$,
646##  and such that the $M_i$ are all those maximal subgroups of <G>
647##  (in particular, \emph{not} only conjugacy class representatives of
648##  subgroups) that contain a fixed element $s \in G$.
649##
650##  `UpperBoundFixedPointRatios' returns a list $[ x, y ]$, where
651##  \[
652##     x = \max_{1 \not= p \mid |G|} \max_{g \in G \setminus Z(G), |g|=p}
653##            \sum_{i=1}^n \sum_{h \in S(i,p,g)} |h^{M_i}| / |g^G|,
654##  \]
655##  and $S(i,p,g)$ is a set of representatives $h$ of all those classes in
656##  $l_i$ that satisfy $|h| = p$ and $|C_G(h)| = |C_G(g)|$,
657##  and in the case that $G$ is a permutation group additionally that
658##  $h$ and $g$ move the same number of points.
659##  Since $S(i,p,g) \supseteq g^G \cap M_i$ holds,
660##  $x$ is an upper bound for $\total(G,s)$.
661##
662##  The second entry is `true' if the first value is in fact equal to
663##  $\max_{g \in G \setminus Z(G)} \fpr(g,G/M}$, and `false' otherwise.
664##
665##  The third argument <truetest> must be `true' or `false',
666##  where `true' means that the exact value of $\total(G,s)$ is computed
667##  not just an upper bound; this can be much more expensive.
668##  (We try to reduce the number of conjugacy tests in this case,
669##  the second half of the code is not completely straightforward.)
670##
671##  If $G$ is an automorphic extension of a simple group $S$,
672##  with $[G:S] = p$ a prime, then `UpperBoundFixedPointRatios' can be used
673##  to compute $\total^{\prime}(G,s)$,
674##  by choosing $M_i$ the maximal subgroups of $G$ containing $s$,
675##  except $S$, such that $l_i$ contains only the classes of element order
676##  $p$ in $M_i \setminus (M_i \cap S)$.
677##
678##  Note that in the case $n = 1$, we have $\total(G,s) = \prop(G,s)$,
679##  so in this case the second entry `true' means that the first entry is
680##  equal to $\max_{g \in G \setminus Z(G)} \fpr(g,G/M_1}$.
681##
682gap> BindGlobal( "UpperBoundFixedPointRatios",
683>    function( G, maxesclasses, truetest )
684>     local myIsConjugate, invs, info, c, r, o, inv, pos, sums, max, maxpos,
685>           maxlen, reps, split, i, found, j;
686>
687>     myIsConjugate:= function( G, x, y )
688>       local movx, movy;
689>
690>       movx:= MovedPoints( x );
691>       movy:= MovedPoints( y );
692>       if movx = movy then
693>         G:= Stabilizer( G, movx, OnSets );
694>       fi;
695>       return IsConjugate( G, x, y );
696>     end;
697>
698>     invs:= [];
699>     info:= [];
700>
701>     # First distribute the classes according to invariants.
702>     for c in Concatenation( maxesclasses ) do
703>       r:= Representative( c );
704>       o:= Order( r );
705>       # Take only prime order representatives.
706>       if IsPrimeInt( o ) then
707>         inv:= [ o, Size( Centralizer( G, r ) ) ];
708>         # Omit classes that are central in `G'.
709>         if inv[2] <> Size( G ) then
710>           if IsPerm( r ) then
711>             Add( inv, NrMovedPoints( r ) );
712>           fi;
713>           pos:= First( [ 1 .. Length( invs ) ], i -> inv = invs[i] );
714>           if pos = fail then
715>             # This class is not `G'-conjugate to any of the previous ones.
716>             Add( invs, inv );
717>             Add( info, [ [ r, Size( c ) * inv[2] ] ] );
718>           else
719>             # This class may be conjugate to an earlier one.
720>             Add( info[ pos ], [ r, Size( c ) * inv[2] ] );
721>           fi;
722>         fi;
723>       fi;
724>     od;
725>
726>     if info = [] then
727>       return [ 0, true ];
728>     fi;
729>
730>     repeat
731>       # Compute the contributions of the classes with the same invariants.
732>       sums:= List( info, x -> Sum( List( x, y -> y[2] ) ) );
733>       max:= Maximum( sums );
734>       maxpos:= Filtered( [ 1 .. Length( info ) ], i -> sums[i] = max );
735>       maxlen:= List( maxpos, i -> Length( info[i] ) );
736>
737>       # Split the sets with the same invariants if necessary
738>       # and if we want to compute the exact value.
739>       if truetest and not 1 in maxlen then
740>         # Make one conjugacy test.
741>         pos:= Position( maxlen, Minimum( maxlen ) );
742>         reps:= info[ maxpos[ pos ] ];
743>         if myIsConjugate( G, reps[1][1], reps[2][1] ) then
744>           # Fuse the two classes.
745>           reps[1][2]:= reps[1][2] + reps[2][2];
746>           reps[2]:= reps[ Length( reps ) ];
747>           Unbind( reps[ Length( reps ) ] );
748>         else
749>           # Split the list. This may require additional conjugacy tests.
750>           Unbind( info[ maxpos[ pos ] ] );
751>           split:= [ reps[1], reps[2] ];
752>           for i in [ 3 .. Length( reps ) ] do
753>             found:= false;
754>             for j in split do
755>               if myIsConjugate( G, reps[i][1], j[1] ) then
756>                 j[2]:= reps[i][2] + j[2];
757>                 found:= true;
758>                 break;
759>               fi;
760>             od;
761>             if not found then
762>               Add( split, reps[i] );
763>             fi;
764>           od;
765>
766>           info:= Compacted( Concatenation( info,
767>                                            List( split, x -> [ x ] ) ) );
768>         fi;
769>       fi;
770>     until 1 in maxlen or not truetest;
771>
772>     return [ max / Size( G ), 1 in maxlen ];
773> end );
774#############################################################################
775##
776#F  OrbitRepresentativesProductOfClasses( <G>, <classreps> )
777##
778##  For a finite group <G> and a list
779##  $<classreps> = [ g_1, g_2, \ldots, g_n ]$ of elements in <G>,
780##  `OrbitRepresentativesProductOfClasses' returns a list of representatives
781##  of <G>-orbits on the Cartesian product
782##  $g_1^{<G>} \times g_2^{<G>} \times \cdots \times g_n^{<G>}$.
783##
784##  The idea behind this function is to choose $R(<G>, g_1) = \{ ( g_1 ) \}$
785##  in the case $n = 1$,
786##  and, for $n > 1$,
787##  \[
788##     R(<G>, g_1, g_2, \ldots, g_n) = \{ (h_1, h_2, \ldots, h_n);
789##        (h_1, h_2, \ldots, h_{n-1}) \in R(<G>, g_1, g_2, \ldots, g_{n-1}),
790##        k_n = g_n^d, \mbox{\rm\ for\ } d \in D \} ,
791##  \]
792##  where $D$ is a set of representatives of double cosets
793##  $C_{<G>}(g_n) \setminus <G> / \cap_{i=1}^{n-1} C_{<G>}(h_i)$.
794##
795gap> BindGlobal( "OrbitRepresentativesProductOfClasses",
796>    function( G, classreps )
797>     local cents, n, orbreps;
798>
799>     cents:= List( classreps, x -> Centralizer( G, x ) );
800>     n:= Length( classreps );
801>
802>     orbreps:= function( reps, intersect, pos )
803>       if pos > n then
804>         return [ reps ];
805>       fi;
806>       return Concatenation( List(
807>           DoubleCosetRepsAndSizes( G, cents[ pos ], intersect ),
808>             r -> orbreps( Concatenation( reps, [ classreps[ pos ]^r[1] ] ),
809>                  Intersection( intersect, cents[ pos ]^r[1] ), pos+1 ) ) );
810>     end;
811>
812>     return orbreps( [ classreps[1] ], cents[1], 2 );
813> end );
814#############################################################################
815##
816#F  RandomCheckUniformSpread( <G>, <classreps>, <s>, <N> )
817##
818##  Let <G> be a finite permutation group that is transitive on its moved
819##  points,
820##  <classreps> be a list of elements in <G>,
821##  <s> be an element in <G>,
822##  and <N> be a positive integer.
823##
824##  `RandomCheckUniformSpread' computes representatives $X$ of <G>-orbits
825##  on the Cartesian product of the conjugacy classes of <classreps>;
826##  for each of them, up to <N> random conjugates $s^{\prime}$ of <s> are
827##  checked whether $s^{\prime}$ generates <G> with each element in the
828##  $n$-tuple of elements in $X$.
829##  If such an element $s^{\prime}$ is found this way, for all $X$,
830##  the function returns `true',
831##  otherwise a representative $X$ is returned for which no good conjugate
832##  of <s> is found.
833##
834gap> BindGlobal( "RandomCheckUniformSpread", function( G, classreps, s, try )
835>     local elms, found, i, conj;
836>
837>     if not IsTransitive( G, MovedPoints( G ) ) then
838>       Error( "<G> must be transitive on its moved points" );
839>     fi;
840>
841>     # Compute orbit representatives of G on the direct product,
842>     # and try to find a good conjugate of s for each representative.
843>     for elms in OrbitRepresentativesProductOfClasses( G, classreps ) do
844>       found:= false;
845>       for i in [ 1 .. try ] do
846>         conj:= s^Random( G );
847>         if ForAll( elms,
848>               x -> IsGeneratorsOfTransPermGroup( G, [ x, conj ] ) ) then
849>           found:= true;
850>           break;
851>         fi;
852>       od;
853>       if not found then
854>         return elms;
855>       fi;
856>     od;
857>
858>     return true;
859> end );
860#############################################################################
861##
862#F  CommonGeneratorWithGivenElements( <G>, <classreps>, <tuple> )
863##
864##  Let <G> be a finite group,
865##  and <classreps> and <tuple> be lists of elements in <G>.
866##  `CommonGeneratorWithGivenElements' returns an element $g$ in the
867##  <G>-conjugacy class of one of the elements in <classreps> with the
868##  property that each element in <tuple> together with $g$ generates <G>,
869##  if such an element $g$ exists.
870##  Otherwise `fail' is returned.
871##
872gap> BindGlobal( "CommonGeneratorWithGivenElements",
873>    function( G, classreps, tuple )
874>     local inter, rep, repcen, pair;
875>
876>     if not IsTransitive( G, MovedPoints( G ) ) then
877>       Error( "<G> must be transitive on its moved points" );
878>     fi;
879>
880>     inter:= Intersection( List( tuple, x -> Centralizer( G, x ) ) );
881>     for rep in classreps do
882>       repcen:= Centralizer( G, rep );
883>       for pair in DoubleCosetRepsAndSizes( G, repcen, inter ) do
884>         if ForAll( tuple,
885>            x -> IsGeneratorsOfTransPermGroup( G, [ x, rep^pair[1] ] ) ) then
886>           return rep;
887>         fi;
888>       od;
889>     od;
890>
891>     return fail;
892> end );
893gap> sporinfo:= [];;
894gap> spornames:= AllCharacterTableNames( IsSporadicSimple, true,
895>                                        IsDuplicateTable, false );;
896gap> for tbl in List( spornames, CharacterTable ) do
897>      info:= ProbGenInfoSimple( tbl );
898>      if info <> fail then
899>        Add( sporinfo, info );
900>      fi;
901>    od;
902gap> PrintFormattedArray( sporinfo );
903   Co1    421/1545600         3671        [ "35A" ]    [ 4 ]
904   Co2          1/270          269        [ "23A" ]    [ 1 ]
905   Co3        64/6325           98        [ "21A" ]    [ 4 ]
906   F3+ 1/269631216855 269631216854        [ "29A" ]    [ 1 ]
907  Fi22         43/585           13        [ "16A" ]    [ 7 ]
908  Fi23   2651/2416635          911        [ "23A" ]    [ 2 ]
909    HN        4/34375         8593        [ "19A" ]    [ 1 ]
910    HS        64/1155           18        [ "15A" ]    [ 2 ]
911    He          3/595          198        [ "14C" ]    [ 3 ]
912    J1           1/77           76        [ "19A" ]    [ 1 ]
913    J2           5/28            5        [ "10C" ]    [ 3 ]
914    J3          2/153           76        [ "19A" ]    [ 2 ]
915    J4   1/1647124116   1647124115        [ "29A" ]    [ 1 ]
916    Ly     1/35049375     35049374        [ "37A" ]    [ 1 ]
917   M11            1/3            2        [ "11A" ]    [ 1 ]
918   M12            1/3            2        [ "10A" ]    [ 3 ]
919   M22           1/21           20        [ "11A" ]    [ 1 ]
920   M23         1/8064         8063        [ "23A" ]    [ 1 ]
921   M24       108/1265           11        [ "21A" ]    [ 2 ]
922   McL      317/22275           70 [ "15A", "30A" ] [ 3, 3 ]
923    ON       10/30723         3072        [ "31A" ]    [ 2 ]
924    Ru         1/2880         2879        [ "29A" ]    [ 1 ]
925   Suz       141/5720           40        [ "14A" ]    [ 3 ]
926    Th       2/267995       133997 [ "27A", "27B" ] [ 2, 2 ]
927gap> for entry in sporinfo do
928>      DisplayProbGenMaxesInfo( CharacterTable( entry[1] ), entry[4] );
929> od;
930Co1, 35A: (A5xJ2):2  (1)
931          (A6xU3(3)):2  (2)
932          (A7xL2(7)):2  (1)
933Co2, 23A: M23  (1)
934Co3, 21A: U3(5).3.2  (2)
935          L3(4).D12  (1)
936          s3xpsl(2,8).3  (1)
937F3+, 29A: 29:14  (1)
938Fi22, 16A: 2^10:m22  (1)
939           (2x2^(1+8)):U4(2):2  (1)
940           2F4(2)'  (4)
941           2^(5+8):(S3xA6)  (1)
942Fi23, 23A: 2..11.m23  (1)
943           L2(23)  (1)
944HN, 19A: U3(8).3_1  (1)
945HS, 15A: A8.2  (1)
946         5:4xa5  (1)
947He, 14C: 2^1+6.psl(3,2)  (1)
948         7^2:2psl(2,7)  (1)
949         7^(1+2):(S3x3)  (1)
950J1, 19A: 19:6  (1)
951J2, 10C: 2^1+4b:a5  (1)
952         a5xd10  (1)
953         5^2:D12  (1)
954J3, 19A: L2(19)  (1)
955         J3M3  (1)
956J4, 29A: frob  (1)
957Ly, 37A: 37:18  (1)
958M11, 11A: L2(11)  (1)
959M12, 10A: A6.2^2  (1)
960          M12M4  (1)
961          2xS5  (1)
962M22, 11A: L2(11)  (1)
963M23, 23A: 23:11  (1)
964M24, 21A: L3(4).3.2_2  (1)
965          2^6:(psl(3,2)xs3)  (1)
966McL, 15A: 3^(1+4):2S5  (1)
967          2.A8  (1)
968          5^(1+2):3:8  (1)
969McL, 30A: 3^(1+4):2S5  (1)
970          2.A8  (1)
971          5^(1+2):3:8  (1)
972ON, 31A: L2(31)  (1)
973         ONM8  (1)
974Ru, 29A: L2(29)  (1)
975Suz, 14A: J2.2  (2)
976          (a4xpsl(3,4)):2  (1)
977Th, 27A: ThN3B  (1)
978         ThM7  (1)
979Th, 27B: ThN3B  (1)
980         ThM7  (1)
981gap> SigmaFromMaxes( CharacterTable( "B" ), "47A",
982>        [ CharacterTable( "47:23" ) ], [ 1 ] );
9831/174702778623598780219392000000
984gap> t:= CharacterTable( "M" );;
985gap> s:= CharacterTable( "L2(59)" );;
986gap> pi:= PossiblePermutationCharacters( s, t );;
987gap> Length( pi );
9885
989gap> spos:= Position( OrdersClassRepresentatives( t ), 59 );
990152
991gap> Set( List( pi, x -> Maximum( ApproxP( [ x ], spos ) ) ) );
992[ 1/3385007637938037777290625 ]
993gap> sporautnames:= AllCharacterTableNames( IsSporadicSimple, true,
994>                       IsDuplicateTable, false,
995>                       OfThose, AutomorphismGroup );;
996gap> sporautnames:= Difference( sporautnames, spornames );
997[ "F3+.2", "Fi22.2", "HN.2", "HS.2", "He.2", "J2.2", "J3.2", "M12.2",
998  "M22.2", "McL.2", "ON.2", "Suz.2" ]
999gap> sporautinfo:= [];;
1000gap> fails:= [];;
1001gap> for name in sporautnames do
1002>      tbl:= CharacterTable( name{ [ 1 .. Position( name, '.' ) - 1 ] } );
1003>      tblG:= CharacterTable( name );
1004>      info:= ProbGenInfoSimple( tbl );
1005>      info:= ProbGenInfoAlmostSimple( tbl, tblG,
1006>          List( info[4], x -> Position( AtlasClassNames( tbl ), x ) ) );
1007>      if info = fail then
1008>        Add( fails, name );
1009>      else
1010>        Add( sporautinfo, info );
1011>      fi;
1012>    od;
1013gap> PrintFormattedArray( sporautinfo );
1014   F3+.2         0         [ "29AB" ]    [ 1 ]
1015  Fi22.2  251/3861         [ "16AB" ]    [ 7 ]
1016    HN.2    1/6875         [ "19AB" ]    [ 1 ]
1017    HS.2    36/275          [ "15A" ]    [ 2 ]
1018    He.2   37/9520         [ "14CD" ]    [ 3 ]
1019    J2.2      1/15         [ "10CD" ]    [ 3 ]
1020    J3.2    1/1080         [ "19AB" ]    [ 1 ]
1021   M12.2      4/99          [ "10A" ]    [ 1 ]
1022   M22.2      1/21         [ "11AB" ]    [ 1 ]
1023   McL.2      1/63 [ "15AB", "30AB" ] [ 3, 3 ]
1024    ON.2   1/84672         [ "31AB" ]    [ 1 ]
1025   Suz.2 661/46332          [ "14A" ]    [ 3 ]
1026gap> for entry in sporautinfo do
1027>      DisplayProbGenMaxesInfo( CharacterTable( entry[1] ), entry[3] );
1028> od;
1029F3+.2, 29AB: F3+  (1)
1030             frob  (1)
1031Fi22.2, 16AB: Fi22  (1)
1032              Fi22.2M4  (1)
1033              (2x2^(1+8)):(U4(2):2x2)  (1)
1034              2F4(2)'.2  (4)
1035              2^(5+8):(S3xS6)  (1)
1036HN.2, 19AB: HN  (1)
1037            U3(8).6  (1)
1038HS.2, 15A: HS  (1)
1039           S8x2  (1)
1040           5:4xS5  (1)
1041He.2, 14CD: He  (1)
1042            2^(1+6)_+.L3(2).2  (1)
1043            7^2:2.L2(7).2  (1)
1044            7^(1+2):(S3x6)  (1)
1045J2.2, 10CD: J2  (1)
1046            2^(1+4).S5  (1)
1047            (A5xD10).2  (1)
1048            5^2:(4xS3)  (1)
1049J3.2, 19AB: J3  (1)
1050            19:18  (1)
1051M12.2, 10A: M12  (1)
1052            (2^2xA5):2  (1)
1053M22.2, 11AB: M22  (1)
1054             L2(11).2  (1)
1055McL.2, 15AB: McL  (1)
1056             3^(1+4):4S5  (1)
1057             Isoclinic(2.A8.2)  (1)
1058             5^(1+2):(24:2)  (1)
1059McL.2, 30AB: McL  (1)
1060             3^(1+4):4S5  (1)
1061             Isoclinic(2.A8.2)  (1)
1062             5^(1+2):(24:2)  (1)
1063ON.2, 31AB: ON  (1)
1064            31:30  (1)
1065Suz.2, 14A: Suz  (1)
1066            J2.2x2  (2)
1067            (A4xL3(4):2_3):2  (1)
1068gap> SigmaFromMaxes( CharacterTable( "Fi24'.2" ), "29AB",
1069>        [ CharacterTable( "29:28" ) ], [ 1 ], "outer" );
10700
1071gap> 16 in OrdersClassRepresentatives( CharacterTable( "U4(2).2" ) );
1072false
1073gap> 16 in OrdersClassRepresentatives( CharacterTable( "G2(3).2" ) );
1074false
1075gap> t2:= CharacterTable( "Fi22.2" );;
1076gap> prim:= List( [ "Fi22.2M4", "(2x2^(1+8)):(U4(2):2x2)", "2F4(2)" ],
1077>        n -> PossiblePermutationCharacters( CharacterTable( n ), t2 ) );;
1078gap> t:= CharacterTable( "Fi22" );;
1079gap> pi:= PossiblePermutationCharacters(
1080>             CharacterTable( "2^(5+8):(S3xA6)" ), t );
1081[ Character( CharacterTable( "Fi22" ), [ 3648645, 56133, 10629, 2245, 567,
1082      729, 405, 81, 549, 165, 133, 37, 69, 20, 27, 81, 9, 39, 81, 19, 1, 13,
1083      33, 13, 1, 0, 13, 13, 5, 1, 0, 0, 0, 8, 4, 0, 0, 9, 3, 15, 3, 1, 1, 1,
1084      1, 3, 3, 1, 0, 0, 0, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2 ] ) ]
1085gap> torso:= CompositionMaps( pi[1], InverseMap( GetFusionMap( t, t2 ) ) );
1086[ 3648645, 56133, 10629, 2245, 567, 729, 405, 81, 549, 165, 133, 37, 69, 20,
1087  27, 81, 9, 39, 81, 19, 1, 13, 33, 13, 1, 0, 13, 13, 5, 1, 0, 0, 0, 8, 4, 0,
1088  9, 3, 15, 3, 1, 1, 1, 3, 3, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 1, 1, 2 ]
1089gap> ext:= PermChars( t2, rec( torso:= torso ) );;
1090gap> Add( prim, ext );
1091gap> prim:= Concatenation( prim );;  Length( prim );
10924
1093gap> spos:= Position( OrdersClassRepresentatives( t2 ), 16 );;
1094gap> List( prim, x -> x[ spos ] );
1095[ 1, 1, 4, 1 ]
1096gap> sigma:= ApproxP( prim, spos );;
1097gap> Maximum( sigma{ Difference( PositionsProperty(
1098>                        OrdersClassRepresentatives( t2 ), IsPrimeInt ),
1099>                        ClassPositionsOfDerivedSubgroup( t2 ) ) } );
1100251/3861
1101gap> SigmaFromMaxes( CharacterTable( "HN.2" ), "19AB",
1102>        [ CharacterTable( "U3(8).6" ) ], [ 1 ], "outer" );
11031/6875
1104gap> SigmaFromMaxes( CharacterTable( "HS.2" ), "15A",
1105>      [ CharacterTable( "S8x2" ),
1106>        CharacterTable( "5:4" ) * CharacterTable( "A5.2" ) ], [ 1, 1 ],
1107>      "outer" );
110836/275
1109gap> t:= CharacterTable( "He" );;
1110gap> t2:= CharacterTable( "He.2" );;
1111gap> prim:= PrimitivePermutationCharacters( t );;
1112gap> spos:= Position( AtlasClassNames( t ), "14C" );;
1113gap> prim:= Filtered( prim, x -> x[ spos ] <> 0 );;
1114gap> map:= InverseMap( GetFusionMap( t, t2 ) );;
1115gap> torso:= List( prim, pi -> CompositionMaps( pi, map ) );
1116[ [ 187425, 945, 449, 0, 21, 21, 25, 25, 0, 0, 5, 0, 0, 7, 1, 0, 0, 1, 0, 1,
1117      0, 0, 0, 0, 0, 0 ],
1118  [ 244800, 0, 64, 0, 84, 0, 0, 16, 0, 0, 4, 24, 45, 3, 4, 0, 0, 0, 0, 1, 0,
1119      0, 0, 0, 0, 0 ],
1120  [ 652800, 0, 512, 120, 72, 0, 0, 0, 0, 0, 8, 8, 22, 1, 0, 0, 0, 0, 0, 1, 0,
1121      0, 1, 1, 2, 0 ] ]
1122gap> ext:= List( torso, x -> PermChars( t2, rec( torso:= x ) ) );
1123[ [ Character( CharacterTable( "He.2" ), [ 187425, 945, 449, 0, 21, 21, 25,
1124          25, 0, 0, 5, 0, 0, 7, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 315, 15,
1125          0, 0, 3, 7, 7, 3, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0 ] ) ],
1126  [ Character( CharacterTable( "He.2" ), [ 244800, 0, 64, 0, 84, 0, 0, 16, 0,
1127          0, 4, 24, 45, 3, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 360, 0, 0, 0,
1128          6, 0, 0, 0, 0, 0, 3, 2, 2, 0, 0, 0, 0, 0, 0 ] ) ],
1129  [ Character( CharacterTable( "He.2" ), [ 652800, 0, 512, 120, 72, 0, 0, 0,
1130          0, 0, 8, 8, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 2, 0, 480, 0, 120,
1131          0, 12, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 1, 1 ] ) ] ]
1132gap> spos:= Position( AtlasClassNames( t2 ), "14CD" );;
1133gap> sigma:= ApproxP( Concatenation( ext ), spos );;
1134gap> Maximum( sigma{ Difference( PositionsProperty(
1135>                        OrdersClassRepresentatives( t2 ), IsPrimeInt ),
1136>                        ClassPositionsOfDerivedSubgroup( t2 ) ) } );
113737/9520
1138gap> SigmaFromMaxes( CharacterTable( "ON.2" ), "31AB",
1139>        [ CharacterTable( "P:Q", [ 31, 30 ] ) ], [ 1 ], "outer" );
11401/84672
1141gap> sporautinfo2:= [];;
1142gap> for name in List( sporautinfo, x -> x[1] ) do
1143>      Add( sporautinfo2, ProbGenInfoSimple( CharacterTable( name ) ) );
1144>    od;
1145gap> PrintFormattedArray( sporautinfo2 );
1146   F3+.2    19/5684  299        [ "42E" ]   [ 10 ]
1147  Fi22.2 1165/20592   17        [ "24G" ]    [ 3 ]
1148    HN.2     1/1425 1424        [ "24B" ]    [ 4 ]
1149    HS.2     21/550   26        [ "20C" ]    [ 4 ]
1150    He.2    33/4165  126        [ "24A" ]    [ 2 ]
1151    J2.2       1/15   14        [ "14A" ]    [ 1 ]
1152    J3.2   77/10260  133        [ "34A" ]    [ 1 ]
1153   M12.2    113/495    4        [ "12B" ]    [ 3 ]
1154   M22.2       8/33    4        [ "10A" ]    [ 4 ]
1155   McL.2      1/135  134        [ "22A" ]    [ 1 ]
1156    ON.2  61/109368 1792 [ "22A", "38A" ] [ 1, 1 ]
1157   Suz.2      1/351  350        [ "28A" ]    [ 1 ]
1158gap> for entry in sporautinfo2 do
1159>      DisplayProbGenMaxesInfo( CharacterTable( entry[1] ), entry[4] );
1160> od;
1161F3+.2, 42E: 2^12.M24  (2)
1162            2^2.U6(2):S3x2  (1)
1163            2^(3+12).(L3(2)xS6)  (2)
1164            (S3xS3xG2(3)):2  (1)
1165            S6xL2(8):3  (1)
1166            7:6xS7  (1)
1167            7^(1+2)_+:(6xS3).2  (2)
1168Fi22.2, 24G: Fi22.2M4  (1)
1169             2^(5+8):(S3xS6)  (1)
1170             3^5:(2xU4(2).2)  (1)
1171HN.2, 24B: 2^(1+8)_+.(A5xA5).2^2  (1)
1172           5^2.5.5^2.4S5  (2)
1173           HN.2M13  (1)
1174HS.2, 20C: (2xA6.2^2).2  (1)
1175           HS.2N5  (2)
1176           5:4xS5  (1)
1177He.2, 24A: 2^(1+6)_+.L3(2).2  (1)
1178           S4xL3(2).2  (1)
1179J2.2, 14A: L3(2).2x2  (1)
1180J3.2, 34A: L2(17)x2  (1)
1181M12.2, 12B: L2(11).2  (1)
1182            D8.(S4x2)  (1)
1183            3^(1+2):D8  (1)
1184M22.2, 10A: M22.2M4  (1)
1185            A6.2^2  (1)
1186            L2(11).2  (2)
1187McL.2, 22A: 2xM11  (1)
1188ON.2, 22A: J1x2  (1)
1189ON.2, 38A: J1x2  (1)
1190Suz.2, 28A: (A4xL3(4):2_3):2  (1)
1191gap> sporautchoices:= [
1192>        [ "Fi22",  "Fi22.2",  42 ],
1193>        [ "Fi24'", "Fi24'.2", 46 ],
1194>        [ "He",    "He.2",    42 ],
1195>        [ "HN",    "HN.2",    44 ],
1196>        [ "HS",    "HS.2",    30 ],
1197>        [ "ON",    "ON.2",    38 ], ];;
1198gap> for triple in sporautchoices do
1199>      tbl:= CharacterTable( triple[1] );
1200>      tbl2:= CharacterTable( triple[2] );
1201>      spos2:= PowerMap( tbl2, 2,
1202>          Position( OrdersClassRepresentatives( tbl2 ), triple[3] ) );
1203>      spos:= Position( GetFusionMap( tbl, tbl2 ), spos2 );
1204>      DisplayProbGenMaxesInfo( tbl, AtlasClassNames( tbl ){ [ spos ] } );
1205>    od;
1206Fi22, 21A: O8+(2).3.2  (1)
1207           S3xU4(3).2_2  (1)
1208           A10.2  (1)
1209           A10.2  (1)
1210F3+, 23A: Fi23  (1)
1211          F3+M7  (1)
1212He, 21B: 3.A7.2  (1)
1213         7^(1+2):(S3x3)  (1)
1214         7:3xpsl(3,2)  (2)
1215HN, 22A: 2.HS.2  (1)
1216HS, 15A: A8.2  (1)
1217         5:4xa5  (1)
1218ON, 19B: L3(7).2  (1)
1219         ONM2  (1)
1220         J1  (1)
1221gap> 42 in OrdersClassRepresentatives( CharacterTable( "G2(3).2" ) );
1222false
1223gap> Size( CharacterTable( "U4(2)" ) ) mod 7 = 0;
1224false
1225gap> SigmaFromMaxes( CharacterTable( "Fi22.2" ), "42A",
1226>     [ CharacterTable( "O8+(2).3.2" ) * CharacterTable( "Cyclic", 2 ),
1227>       CharacterTable( "S3" ) * CharacterTable( "U4(3).(2^2)_{122}" ) ],
1228>     [ 1, 1 ] );
1229163/1170
1230gap> SigmaFromMaxes( CharacterTable( "Fi24'.2" ), "46A",
1231>      [ CharacterTable( "Fi23" ) * CharacterTable( "Cyclic", 2 ),
1232>        CharacterTable( "2^12.M24" ) ],
1233>      [ 1, 1 ] );
1234566/5481
1235gap> SigmaFromMaxes( CharacterTable( "He.2" ), "42A",
1236>      [ CharacterTable( "3.A7.2" ) * CharacterTable( "Cyclic", 2 ),
1237>        CharacterTable( "7^(1+2):(S3x6)" ),
1238>        CharacterTable( "7:6" ) * CharacterTable( "L3(2)" ) ],
1239>      [ 1, 1, 1 ] );
12401/119
1241gap> SigmaFromMaxes( CharacterTable( "HN.2" ), "44A",
1242>      [ CharacterTable( "4.HS.2" ) ],
1243>      [ 1 ] );
1244997/192375
1245gap> SigmaFromMaxes( CharacterTable( "HS.2" ), "30A",
1246>      [ CharacterTable( "S8" ) * CharacterTable( "C2" ),
1247>        CharacterTable( "5:4" ) * CharacterTable( "S5" ) ],
1248>      [ 1, 1 ] );
124936/275
1250gap> SigmaFromMaxes( CharacterTable( "ON.2" ), "38A",
1251>      [ CharacterTable( "J1" ) * CharacterTable( "C2" ) ],
1252>      [ 1 ] );
125361/109368
1254gap> names:= AllCharacterTableNames( IsSimple, true,
1255>                                    IsDuplicateTable, false );;
1256gap> names:= Difference( names, spornames );;
1257gap> fails:= [];;
1258gap> lessthan3:= [];;
1259gap> atleast3:= [];;
1260gap> for name in names do
1261>      tbl:= CharacterTable( name );
1262>      info:= ProbGenInfoSimple( tbl );
1263>      if info = fail then
1264>        Add( fails, name );
1265>      elif info[3] < 3 then
1266>        Add( lessthan3, info );
1267>      else
1268>        Add( atleast3, info );
1269>      fi;
1270>    od;
1271gap> fails;
1272[ "2E6(2)", "2F4(8)", "A14", "A15", "A16", "A17", "A18", "E6(2)", "F4(2)",
1273  "L4(4)", "L4(5)", "L4(9)", "L5(3)", "L6(2)", "L8(2)", "O10+(2)", "O10-(2)",
1274  "O10-(3)", "O7(5)", "O8-(3)", "O9(3)", "R(27)", "S10(2)", "S12(2)",
1275  "S4(7)", "S4(8)", "S4(9)", "S6(4)", "S6(5)", "S8(3)", "U4(4)", "U4(5)",
1276  "U5(3)", "U5(4)", "U7(2)" ]
1277gap> PrintFormattedArray( lessthan3 );
1278      A5      1/3 2                [ "5A" ]       [ 1 ]
1279      A6      2/3 1                [ "5A" ]       [ 2 ]
1280      A7      2/5 2                [ "7A" ]       [ 2 ]
1281   O7(3)  199/351 1               [ "14A" ]       [ 3 ]
1282  O8+(2)  334/315 0 [ "15A", "15B", "15C" ] [ 7, 7, 7 ]
1283  O8+(3) 863/1820 2 [ "20A", "20B", "20C" ] [ 8, 8, 8 ]
1284   S6(2)      4/7 1                [ "9A" ]       [ 4 ]
1285   S8(2)     8/15 1               [ "17A" ]       [ 3 ]
1286   U4(2)    21/40 1               [ "12A" ]       [ 2 ]
1287   U4(3)   53/135 2                [ "7A" ]       [ 7 ]
1288gap> PrintFormattedArray( Filtered( atleast3, l -> l[1] <> "L7(2)" ) );
1289  2F4(2)' 118/1755   14                           [ "16A" ]             [ 2 ]
1290   3D4(2)   1/5292 5291                           [ "13A" ]             [ 1 ]
1291      A10     3/10    3                           [ "21A" ]             [ 1 ]
1292      A11    2/105   52                           [ "11A" ]             [ 2 ]
1293      A12      2/9    4                           [ "35A" ]             [ 1 ]
1294      A13   4/1155  288                           [ "13A" ]             [ 5 ]
1295       A8     3/14    4                           [ "15A" ]             [ 1 ]
1296       A9     9/35    3                      [ "9A", "9B" ]          [ 4, 4 ]
1297    G2(3)      1/7    6                           [ "13A" ]             [ 3 ]
1298    G2(4)     1/21   20                           [ "13A" ]             [ 2 ]
1299    G2(5)     1/31   30                     [ "7A", "21A" ]         [ 10, 1 ]
1300  L2(101)    1/101  100                    [ "51A", "17A" ]          [ 1, 1 ]
1301  L2(103)  53/5253   99             [ "52A", "26A", "13A" ]       [ 1, 1, 1 ]
1302  L2(107)  55/5671  103 [ "54A", "27A", "18A", "9A", "6A" ] [ 1, 1, 1, 1, 1 ]
1303  L2(109)    1/109  108                    [ "55A", "11A" ]          [ 1, 1 ]
1304   L2(11)     7/55    7                            [ "6A" ]             [ 1 ]
1305  L2(113)    1/113  112                    [ "57A", "19A" ]          [ 1, 1 ]
1306  L2(121)    1/121  120                           [ "61A" ]             [ 1 ]
1307  L2(125)    1/125  124        [ "63A", "21A", "9A", "7A" ]    [ 1, 1, 1, 1 ]
1308   L2(13)     1/13   12                            [ "7A" ]             [ 1 ]
1309   L2(16)     1/15   14                           [ "17A" ]             [ 1 ]
1310   L2(17)     1/17   16                            [ "9A" ]             [ 1 ]
1311   L2(19)   11/171   15                           [ "10A" ]             [ 1 ]
1312   L2(23)   13/253   19                     [ "6A", "12A" ]          [ 1, 1 ]
1313   L2(25)     1/25   24                           [ "13A" ]             [ 1 ]
1314   L2(27)    5/117   23                     [ "7A", "14A" ]          [ 1, 1 ]
1315   L2(29)     1/29   28                           [ "15A" ]             [ 1 ]
1316   L2(31)   17/465   27                     [ "8A", "16A" ]          [ 1, 1 ]
1317   L2(32)     1/31   30              [ "3A", "11A", "33A" ]       [ 1, 1, 1 ]
1318   L2(37)     1/37   36                           [ "19A" ]             [ 1 ]
1319   L2(41)     1/41   40                     [ "21A", "7A" ]          [ 1, 1 ]
1320   L2(43)   23/903   39                    [ "22A", "11A" ]          [ 1, 1 ]
1321   L2(47)  25/1081   43        [ "24A", "12A", "8A", "6A" ]    [ 1, 1, 1, 1 ]
1322   L2(49)     1/49   48                           [ "25A" ]             [ 1 ]
1323   L2(53)     1/53   52                     [ "27A", "9A" ]          [ 1, 1 ]
1324   L2(59)  31/1711   55       [ "30A", "15A", "10A", "6A" ]    [ 1, 1, 1, 1 ]
1325   L2(61)     1/61   60                           [ "31A" ]             [ 1 ]
1326   L2(64)     1/63   62                    [ "65A", "13A" ]          [ 1, 1 ]
1327   L2(67)  35/2211   63                    [ "34A", "17A" ]          [ 1, 1 ]
1328   L2(71)  37/2485   67 [ "36A", "18A", "12A", "9A", "6A" ] [ 1, 1, 1, 1, 1 ]
1329   L2(73)     1/73   72                           [ "37A" ]             [ 1 ]
1330   L2(79)  41/3081   75       [ "40A", "20A", "10A", "8A" ]    [ 1, 1, 1, 1 ]
1331    L2(8)      1/7    6                      [ "3A", "9A" ]          [ 1, 1 ]
1332   L2(81)     1/81   80                           [ "41A" ]             [ 1 ]
1333   L2(83)  43/3403   79 [ "42A", "21A", "14A", "7A", "6A" ] [ 1, 1, 1, 1, 1 ]
1334   L2(89)     1/89   88              [ "45A", "15A", "9A" ]       [ 1, 1, 1 ]
1335   L2(97)     1/97   96                     [ "49A", "7A" ]          [ 1, 1 ]
1336   L3(11)   1/6655 6654                   [ "19A", "133A" ]          [ 1, 1 ]
1337    L3(2)      1/4    3                            [ "7A" ]             [ 1 ]
1338    L3(3)     1/24   23                           [ "13A" ]             [ 1 ]
1339    L3(4)      1/5    4                            [ "7A" ]             [ 3 ]
1340    L3(5)    1/250  249                           [ "31A" ]             [ 1 ]
1341    L3(7)   1/1372 1371                           [ "19A" ]             [ 1 ]
1342    L3(8)   1/1792 1791                           [ "73A" ]             [ 1 ]
1343    L3(9)   1/2880 2879                           [ "91A" ]             [ 1 ]
1344    L4(3)  53/1053   19                           [ "20A" ]             [ 1 ]
1345    L5(2)   1/5376 5375                           [ "31A" ]             [ 1 ]
1346   O8-(2)     1/63   62                           [ "17A" ]             [ 1 ]
1347    S4(4)     4/15    3                           [ "17A" ]             [ 2 ]
1348    S4(5)      1/5    4                           [ "13A" ]             [ 1 ]
1349    S6(3)    1/117  116                           [ "14A" ]             [ 2 ]
1350   Sz(32)   1/1271 1270                     [ "5A", "25A" ]          [ 1, 1 ]
1351    Sz(8)     1/91   90                            [ "5A" ]             [ 1 ]
1352   U3(11)   1/6655 6654                           [ "37A" ]             [ 1 ]
1353    U3(3)    16/63    3                     [ "6A", "12A" ]          [ 2, 2 ]
1354    U3(4)    1/160  159                           [ "13A" ]             [ 1 ]
1355    U3(5)   46/525   11                           [ "10A" ]             [ 2 ]
1356    U3(7)   1/1372 1371                           [ "43A" ]             [ 1 ]
1357    U3(8)   1/1792 1791                           [ "19A" ]             [ 1 ]
1358    U3(9)   1/3600 3599                           [ "73A" ]             [ 1 ]
1359    U5(2)     1/54   53                           [ "11A" ]             [ 1 ]
1360    U6(2)     5/21    4                           [ "11A" ]             [ 4 ]
1361gap> First( atleast3, l -> l[1] = "L7(2)" );
1362[ "L7(2)", 1/4388290560, 4388290559, [ "127A" ], [ 1 ] ]
1363gap> list:= [
1364>   [ "A5", "A5.2" ],
1365>   [ "A6", "A6.2_1" ],
1366>   [ "A6", "A6.2_2" ],
1367>   [ "A6", "A6.2_3" ],
1368>   [ "A7", "A7.2" ],
1369>   [ "A8", "A8.2" ],
1370>   [ "A9", "A9.2" ],
1371>   [ "A11", "A11.2" ],
1372>   [ "L3(2)", "L3(2).2" ],
1373>   [ "L3(3)", "L3(3).2" ],
1374>   [ "L3(4)", "L3(4).2_1" ],
1375>   [ "L3(4)", "L3(4).2_2" ],
1376>   [ "L3(4)", "L3(4).2_3" ],
1377>   [ "L3(4)", "L3(4).3" ],
1378>   [ "S4(4)", "S4(4).2" ],
1379>   [ "U3(3)", "U3(3).2" ],
1380>   [ "U3(5)", "U3(5).2" ],
1381>   [ "U3(5)", "U3(5).3" ],
1382>   [ "U4(2)", "U4(2).2" ],
1383>   [ "U4(3)", "U4(3).2_1" ],
1384>   [ "U4(3)", "U4(3).2_3" ],
1385> ];;
1386gap> autinfo:= [];;
1387gap> fails:= [];;
1388gap> for pair in list do
1389>      tbl:= CharacterTable( pair[1] );
1390>      tblG:= CharacterTable( pair[2] );
1391>      info:= ProbGenInfoSimple( tbl );
1392>      spos:= List( info[4], x -> Position( AtlasClassNames( tbl ), x ) );
1393>      Add( autinfo, ProbGenInfoAlmostSimple( tbl, tblG, spos ) );
1394>    od;
1395gap> PrintFormattedArray( autinfo );
1396       A5.2      0        [ "5AB" ]    [ 1 ]
1397     A6.2_1    2/3        [ "5AB" ]    [ 2 ]
1398     A6.2_2    1/6         [ "5A" ]    [ 1 ]
1399     A6.2_3      0        [ "5AB" ]    [ 1 ]
1400       A7.2   1/15        [ "7AB" ]    [ 1 ]
1401       A8.2  13/28       [ "15AB" ]    [ 1 ]
1402       A9.2    1/4        [ "9AB" ]    [ 1 ]
1403      A11.2  1/945       [ "11AB" ]    [ 1 ]
1404    L3(2).2    1/4        [ "7AB" ]    [ 1 ]
1405    L3(3).2   1/18       [ "13AB" ]    [ 1 ]
1406  L3(4).2_1   3/10        [ "7AB" ]    [ 3 ]
1407  L3(4).2_2  11/60         [ "7A" ]    [ 1 ]
1408  L3(4).2_3   1/12        [ "7AB" ]    [ 1 ]
1409    L3(4).3   1/64         [ "7A" ]    [ 1 ]
1410    S4(4).2      0       [ "17AB" ]    [ 2 ]
1411    U3(3).2    2/7 [ "6A", "12AB" ] [ 2, 2 ]
1412    U3(5).2   2/21        [ "10A" ]    [ 2 ]
1413    U3(5).3 46/525        [ "10A" ]    [ 2 ]
1414    U4(2).2  16/45       [ "12AB" ]    [ 2 ]
1415  U4(3).2_1 76/135         [ "7A" ]    [ 3 ]
1416  U4(3).2_3 31/162        [ "7AB" ]    [ 3 ]
1417gap> t:= CharacterTable( "L4(3)" );;
1418gap> prim:= PrimitivePermutationCharacters( t );;
1419gap> spos:= Position( AtlasClassNames( t ), "20A" );;
1420gap> prim:= Filtered( prim, x -> x[ spos ] <> 0 );
1421[ Character( CharacterTable( "L4(3)" ), [ 2106, 106, 42, 0, 27, 27, 0, 46, 6,
1422      6, 1, 7, 7, 0, 3, 3, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1 ] ) ]
1423gap> for name in [ "L4(3).2_1", "L4(3).2_2", "L4(3).2_3" ] do
1424>      t2:= CharacterTable( name );
1425>      map:= InverseMap( GetFusionMap( t, t2 ) );
1426>      torso:= List( prim, pi -> CompositionMaps( pi, map ) );
1427>      ext:= Concatenation( List( torso,
1428>                              x -> PermChars( t2, rec( torso:= x ) ) ) );
1429>      sigma:= ApproxP( ext, Position( OrdersClassRepresentatives( t2 ), 20 ) );
1430>      max:= Maximum( sigma{ Difference( PositionsProperty(
1431>                           OrdersClassRepresentatives( t2 ), IsPrimeInt ),
1432>                           ClassPositionsOfDerivedSubgroup( t2 ) ) } );
1433>      Print( name, ":\n", ext, "\n", max, "\n" );
1434> od;
1435L4(3).2_1:
1436[ Character( CharacterTable( "L4(3).2_1" ), [ 2106, 106, 42, 0, 27, 0, 46, 6,
1437      6, 1, 7, 0, 3, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 4, 0, 0, 6, 6, 6, 6,
1438      2, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 ] ) ]
14390
1440L4(3).2_2:
1441[ Character( CharacterTable( "L4(3).2_2" ),
1442    [ 2106, 106, 42, 0, 27, 27, 0, 46, 6, 6, 1, 7, 7, 0, 3, 3, 0, 0, 0, 1, 1,
1443      1, 0, 0, 0, 1, 306, 306, 42, 6, 10, 10, 0, 0, 15, 15, 3, 3, 3, 3, 0, 0,
1444      1, 1, 0, 1, 1, 0, 0 ] ) ]
144517/117
1446L4(3).2_3:
1447[ Character( CharacterTable( "L4(3).2_3" ), [ 2106, 106, 42, 0, 27, 0, 46, 6,
1448      6, 1, 7, 0, 3, 0, 0, 1, 1, 0, 0, 0, 1, 36, 0, 0, 6, 6, 2, 2, 2, 1, 1,
1449      0, 0, 0 ] ) ]
14502/117
1451gap> SigmaFromMaxes( CharacterTable( "O8-(2).2" ), "17AB",
1452>        [ CharacterTable( "L2(16).4" ) ], [ 1 ], "outer" );
14530
1454gap> t:= CharacterTable( "S6(3)" );;
1455gap> t2:= CharacterTable( "S6(3).2" );;
1456gap> prim:= PrimitivePermutationCharacters( t );;
1457gap> spos:= Position( AtlasClassNames( t ), "14A" );;
1458gap> prim:= Filtered( prim, x -> x[ spos ] <> 0 );;
1459gap> map:= InverseMap( GetFusionMap( t, t2 ) );;
1460gap> torso:= List( prim, pi -> CompositionMaps( pi, map ) );;
1461gap> ext:= List( torso, pi -> PermChars( t2, rec( torso:= pi ) ) );
1462[ [ Character( CharacterTable( "S6(3).2" ), [ 155520, 0, 288, 0, 0, 0, 216,
1463          54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 0, 6,
1464          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 144,
1465          288, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 1, 1,
1466          1, 0, 0 ] ) ],
1467  [ Character( CharacterTable( "S6(3).2" ), [ 189540, 1620, 568, 0, 486, 0,
1468          0, 27, 540, 84, 24, 0, 0, 0, 0, 0, 54, 0, 0, 10, 0, 7, 1, 6, 6, 0,
1469          0, 0, 0, 0, 0, 18, 0, 0, 0, 6, 12, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
1470          0, 0, 234, 64, 30, 8, 0, 3, 90, 6, 0, 4, 10, 6, 0, 2, 1, 0, 0, 0,
1471          0, 0, 0, 0, 1, 1, 0, 0 ] ) ] ]
1472gap> spos:= Position( AtlasClassNames( t2 ), "14A" );;
1473gap> sigma:= ApproxP( Concatenation( ext ), spos );;
1474gap> Maximum( sigma{ Difference(
1475>      PositionsProperty( OrdersClassRepresentatives( t2 ), IsPrimeInt ),
1476>      ClassPositionsOfDerivedSubgroup( t2 ) ) } );
14777/3240
1478gap> SigmaFromMaxes( CharacterTable( "U5(2).2" ), "11AB",
1479>        [ CharacterTable( "L2(11).2" ) ], [ 1 ], "outer" );
14801/288
1481gap> CleanWorkspace();
1482gap> SigmaFromMaxes( CharacterTable( "O8-(3)" ), "41A",
1483>    [ CharacterTable( "L2(81).2_1" ) ], [ 1 ] );
14841/567
1485gap> ForAny( [ "S8(2)", "O8+(2)", "L5(2)", "O8-(2)", "A8" ],
1486>            x -> 45 in OrdersClassRepresentatives( CharacterTable( x ) ) );
1487false
1488gap> t:= CharacterTable( "O10+(2)" );;
1489gap> t2:= CharacterTable( "O10+(2).2" );;
1490gap> s2:= CharacterTable( "A5.2" ) * CharacterTable( "U4(2).2" );
1491CharacterTable( "A5.2xU4(2).2" )
1492gap> pi:= PossiblePermutationCharacters( s2, t2 );;
1493gap> spos:= Position( OrdersClassRepresentatives( t2 ), 45 );;
1494gap> approx:= ApproxP( pi, spos );;
1495gap> Maximum( approx{ ClassPositionsOfDerivedSubgroup( t2 ) } );
149643/4216
1497gap> Maximum( approx{ Difference(
1498>      PositionsProperty( OrdersClassRepresentatives( t2 ), IsPrimeInt ),
1499>      ClassPositionsOfDerivedSubgroup( t2 ) ) } );
150023/248
1501gap> SigmaFromMaxes( t2, "45AB", [ s2 ], [ 1 ], "outer" );
150223/248
1503gap> SigmaFromMaxes( CharacterTable( "O10-(2)" ), "33A",
1504>    [ CharacterTable( "Cyclic", 3 ) * CharacterTable( "U5(2)" ) ], [ 1 ] );
15051/119
1506gap> tblG:= CharacterTable( "U5(2)" );;
1507gap> tblMG:= CharacterTable( "Cyclic", 3 ) * tblG;;
1508gap> tblGA:= CharacterTable( "U5(2).2" );;
1509gap> acts:= PossibleActionsForTypeMGA( tblMG, tblG, tblGA );;
1510gap> poss:= Concatenation( List( acts, pi ->
1511>            PossibleCharacterTablesOfTypeMGA( tblMG, tblG, tblGA, pi,
1512>                "(3xU5(2)).2" ) ) );
1513[ rec( MGfusMGA := [ 1, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13, 13,
1514          14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 21, 21, 22, 22, 23, 23,
1515          24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 33, 34,
1516          35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1517          52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
1518          69, 70, 71, 72, 73, 74, 75, 76, 77, 31, 32, 33, 35, 34, 37, 36, 38,
1519          39, 40, 41, 42, 43, 45, 44, 47, 46, 49, 48, 51, 50, 52, 54, 53, 56,
1520          55, 57, 58, 60, 59, 62, 61, 64, 63, 66, 65, 68, 67, 69, 71, 70, 73,
1521          72, 75, 74, 77, 76 ], table := CharacterTable( "(3xU5(2)).2" ) ) ]
1522gap> SigmaFromMaxes( CharacterTable( "O10-(2).2" ), "33AB",
1523>        [ poss[1].table ], [ 1 ], "outer" );
15241/595
1525gap> CharacterTable( "O12+(2)" );
1526fail
1527gap> t:= CharacterTable( "O12+(2).2" );;
1528gap> h1:= CharacterTable( "L4(4).2^2" );;
1529gap> psi:= PossiblePermutationCharacters( h1, t );;
1530gap> Length( psi );
15311
1532gap> ForAny( psi[1], IsOddInt );
1533true
1534gap> SizesCentralizers( t ){ PositionsProperty(
1535>        OrdersClassRepresentatives( t ), x -> x = 17 ) } / 25;
1536[ 408/5, 408/5 ]
1537gap> h2:= CharacterTable( "S5" ) * CharacterTable( "O8-(2).2" );;
1538gap> phi:= PossiblePermutationCharacters( h2, t );;
1539gap> Length( phi );
15401
1541gap> prim:= Concatenation( psi, phi );;
1542gap> spos:= Position( OrdersClassRepresentatives( t ), 85 );
1543213
1544gap> List( prim, x -> x[ spos ] );
1545[ 2, 1 ]
1546gap> approx:= ApproxP( prim, spos );;
1547gap> Maximum( approx{ ClassPositionsOfDerivedSubgroup( t ) } );
15487675/1031184
1549gap> Maximum( approx{ Difference(
1550>      PositionsProperty( OrdersClassRepresentatives( t ), IsPrimeInt ),
1551>      ClassPositionsOfDerivedSubgroup( t ) ) } );
155273/1008
1553gap> t:= CharacterTable( "O12-(2)" );
1554fail
1555gap> t:= CharacterTable( "O12-(2).2" );;
1556gap> s1:= CharacterTable( "U4(4).4" );;
1557gap> pi1:= PossiblePermutationCharacters( s1, t );;
1558gap> s2:= CharacterTable( "L2(64).6" );;
1559gap> pi2:= PossiblePermutationCharacters( s2, t );;
1560gap> prim:= Concatenation( pi1, pi2 );;  Length( prim );
15612
1562gap> spos:= Position( OrdersClassRepresentatives( t ), 65 );;
1563gap> List( prim, x -> x[ spos ] );
1564[ 1, 1 ]
1565gap> approx:= ApproxP( prim, spos );;
1566gap> Maximum( approx{ ClassPositionsOfDerivedSubgroup( t ) } );
15671/1023
1568gap> Maximum( approx{ Difference(
1569>      PositionsProperty( OrdersClassRepresentatives( t ), IsPrimeInt ),
1570>      ClassPositionsOfDerivedSubgroup( t ) ) } );
15711/347820
1572gap> t:= CharacterTable( "S6(4)" );;
1573gap> degree:= Size( t ) / ( 2 * Size( CharacterTable( "U4(4)" ) ) );;
1574gap> pi1:= PermChars( t, rec( torso:= [ degree ] ) );;
1575gap> Length( pi1 );
15761
1577gap> CharacterTable( "L2(64).3" );  CharacterTable( "U4(4).2" );
1578fail
1579fail
1580gap> s:= CharacterTable( "L2(64)" );;
1581gap> subpi:= PossiblePermutationCharacters( s, t );;
1582gap> Length( subpi );
15831
1584gap> scp:= MatScalarProducts( t, Irr( t ), subpi );;
1585gap> nonzero:= PositionsProperty( scp[1], x -> x <> 0 );
1586[ 1, 11, 13, 14, 17, 18, 32, 33, 56, 58, 59, 73, 74, 77, 78, 79, 80, 93, 95,
1587  96, 103, 116, 117, 119, 120 ]
1588gap> const:= RationalizedMat( Irr( t ){ nonzero } );;
1589gap> degree:= Size( t ) / ( 3 * Size( s ) );
15905222400
1591gap> pi2:= PermChars( t, rec( torso:= [ degree ], chars:= const ) );;
1592gap> Length( pi2 );
15931
1594gap> prim:= Concatenation( pi1, pi2 );;
1595gap> spos:= Position( OrdersClassRepresentatives( t ), 65 );;
1596gap> List( prim, x -> x[ spos ] );
1597[ 1, 1 ]
1598gap> Maximum( ApproxP( prim, spos ) );
159916/63
1600gap> t2:= CharacterTable( "S6(4).2" );;
1601gap> tfust2:= GetFusionMap( t, t2 );;
1602gap> cand:= List( prim, x -> CompositionMaps( x, InverseMap( tfust2 ) ) );;
1603gap> ext:= List( cand, pi -> PermChars( t2, rec( torso:= pi ) ) );
1604[ [ Character( CharacterTable( "S6(4).2" ), [ 2016, 512, 96, 128, 32, 120, 0,
1605          6, 16, 40, 24, 0, 8, 136, 1, 6, 6, 1, 32, 0, 8, 6, 2, 0, 2, 0, 0,
1606          4, 0, 16, 32, 1, 8, 2, 6, 2, 1, 2, 4, 0, 0, 1, 6, 0, 1, 10, 0, 1,
1607          1, 0, 10, 10, 4, 0, 1, 0, 2, 0, 2, 1, 2, 2, 1, 1, 0, 0, 0, 1, 1, 1,
1608          1, 0, 0, 0, 0, 0, 32, 0, 0, 8, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 8, 0,
1609          0, 0, 2, 2, 0, 2, 2, 0, 2, 2, 2, 0, 0 ] ) ],
1610  [ Character( CharacterTable( "S6(4).2" ), [ 5222400, 0, 0, 0, 1280, 0, 960,
1611          120, 0, 0, 0, 0, 0, 0, 1600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 1, 0, 0,
1612          15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10, 0,
1613          0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0,
1614          0, 0, 0, 960, 0, 0, 0, 16, 0, 24, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1615          0, 0, 4, 1, 0, 0, 3, 0, 0, 0, 0, 0 ] ) ] ]
1616gap> spos2:= Position( OrdersClassRepresentatives( t2 ), 65 );;
1617gap> sigma:= ApproxP( Concatenation( ext ), spos2 );;
1618gap> Maximum( approx{ Difference(
1619>      PositionsProperty( OrdersClassRepresentatives( t2 ), IsPrimeInt ),
1620>      ClassPositionsOfDerivedSubgroup( t2 ) ) } );
16210
1622gap> SigmaFromMaxes( CharacterTable( "S6(4)" ), "85A",
1623>    [ CharacterTable( "L4(4).2_2" ),
1624>      CharacterTable( "A5" ) * CharacterTable( "S4(4)" ) ], [ 1, 1 ] );
1625142/455
1626gap> 16/63 < 142/455;
1627true
1628gap> t:= CharacterTable( "S6(5)" );;
1629gap> s1:= CharacterTable( "2.A5" );;
1630gap> s2:= CharacterTable( "2.S4(5)" );;
1631gap> dp:= s1 * s2;
1632CharacterTable( "2.A5x2.S4(5)" )
1633gap> c:= Difference( ClassPositionsOfCentre( dp ), Union(
1634>                        GetFusionMap( s1, dp ), GetFusionMap( s2, dp ) ) );
1635[ 62 ]
1636gap> s:= dp / c;
1637CharacterTable( "2.A5x2.S4(5)/[ 1, 62 ]" )
1638gap> SigmaFromMaxes( t, "78A", [ s ], [ 1 ] );
16399/217
1640gap> t:= CharacterTable( "S8(3)" );;
1641gap> pi:= List( [ "S4(9).2_1", "S4(9).2_2", "S4(9).2_3" ],
1642>               name -> PossiblePermutationCharacters(
1643>                           CharacterTable( name ), t ) );;
1644gap> List( pi, Length );
1645[ 1, 0, 0 ]
1646gap> spos:= Position( OrdersClassRepresentatives( t ), 41 );;
1647gap> pi[1][1][ spos ];
16481
1649gap> Maximum( ApproxP( pi[1], spos ) );
16501/546
1651gap> g:= SU(4,4);;
1652gap> orbs:= Orbits( g, NormedRowVectors( GF(16)^4 ), OnLines );;
1653gap> orblen:= List( orbs, Length );
1654[ 1105, 3264 ]
1655gap> List( orblen, x -> x mod 13 );
1656[ 0, 1 ]
1657gap> t:= CharacterTable( "U4(4)" );;
1658gap> pi:= PermChars( t, rec( torso:= [ orblen[2] ] ) );;
1659gap> Length( pi );
16601
1661gap> spos:= Position( OrdersClassRepresentatives( t ), 65 );;
1662gap> Maximum( ApproxP( pi, spos ) );
1663209/3264
1664gap> t:= CharacterTable( "U6(2)" );;
1665gap> s1:= CharacterTable( "U5(2)" );;
1666gap> pi1:= PossiblePermutationCharacters( s1, t );;
1667gap> Length( pi1 );
16681
1669gap> s2:= CharacterTable( "M22" );;
1670gap> pi2:= PossiblePermutationCharacters( s2, t );
1671[ Character( CharacterTable( "U6(2)" ), [ 20736, 0, 384, 0, 0, 0, 54, 0, 0,
1672      0, 0, 48, 0, 16, 6, 0, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0,
1673      1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ),
1674  Character( CharacterTable( "U6(2)" ), [ 20736, 0, 384, 0, 0, 0, 54, 0, 0,
1675      0, 48, 0, 0, 16, 6, 0, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0,
1676      1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ),
1677  Character( CharacterTable( "U6(2)" ), [ 20736, 0, 384, 0, 0, 0, 54, 0, 0,
1678      48, 0, 0, 0, 16, 6, 0, 0, 0, 0, 0, 0, 6, 0, 2, 0, 4, 0, 0, 0, 0, 0, 0,
1679      1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ) ]
1680gap> imgs:= Set( List( pi2, x -> Position( x, 48 ) ) );
1681[ 10, 11, 12 ]
1682gap> AtlasClassNames( t ){ imgs };
1683[ "4C", "4D", "4E" ]
1684gap> GetFusionMap( t, CharacterTable( "U6(2).3" ) ){ imgs };
1685[ 10, 10, 10 ]
1686gap> prim:= Concatenation( pi1, pi2 );;
1687gap> spos:= Position( OrdersClassRepresentatives( t ), 11 );;
1688gap> List( prim, x -> x[ spos ] );
1689[ 1, 1, 1, 1 ]
1690gap> Maximum( ApproxP( prim, spos ) );
16915/21
1692gap> PossibleClassFusions(
1693>        CharacterTable( "Cyclic", 3 ) * CharacterTable( "M22" ),
1694>        CharacterTable( "3.U6(2)" ) );
1695[  ]
1696gap> SigmaFromMaxes( CharacterTable( "U6(2).2" ), "11AB",
1697>        [ CharacterTable( "U5(2).2" ), CharacterTable( "M22.2" ) ],
1698>        [ 1, 1 ], "outer" );
16995/96
1700gap> SigmaFromMaxes( CharacterTable( "U6(2).3" ), "11A",
1701>        [ CharacterTable( "U5(2)" ) * CharacterTable( "Cyclic", 3 ) ],
1702>        [ 1 ], "outer" );
170359/224
1704gap> CleanWorkspace();
1705gap> PrimitivesInfoForOddDegreeAlternatingGroup:= function( n )
1706>     local G, max, cycle, spos, prim, nonz;
1707>
1708>     G:= AlternatingGroup( n );
1709>
1710>     # Compute representatives of the classes of maximal subgroups.
1711>     max:= MaximalSubgroupClassReps( G );
1712>
1713>     # Omit subgroups that cannot contain an `n'-cycle.
1714>     max:= Filtered( max, m -> IsTransitive( m, [ 1 .. n ] ) );
1715>
1716>     # Compute the permutation characters.
1717>     cycle:= [];
1718>     cycle[ n-1 ]:= 1;
1719>     spos:= PositionProperty( ConjugacyClasses( CharacterTable( G ) ),
1720>                c -> CycleStructurePerm( Representative( c ) ) = cycle );
1721>     prim:= List( max, m -> TrivialCharacter( m )^G );
1722>     nonz:= PositionsProperty( prim, x -> x[ spos ] <> 0 );
1723>
1724>     # Compute the subgroup names and the multiplicities.
1725>     return rec( spos := spos,
1726>                 prim := prim{ nonz },
1727>                 grps := List( max{ nonz },
1728>                               m -> TransitiveGroup( n,
1729>                                        TransitiveIdentification( m ) ) ),
1730>                 mult := List( prim{ nonz }, x -> x[ spos ] ) );
1731> end;;
1732gap> for n in [ 5, 7 .. 23 ] do
1733>      prim:= PrimitivesInfoForOddDegreeAlternatingGroup( n );
1734>      bound:= Maximum( ApproxP( prim.prim, prim.spos ) );
1735>      Print( n, ": ", prim.grps, ", ", prim.mult, ", ", bound, "\n" );
1736> od;
17375: [ D(5) = 5:2 ], [ 1 ], 1/3
17387: [ L(7) = L(3,2), L(7) = L(3,2) ], [ 1, 1 ], 2/5
17399: [ 1/2[S(3)^3]S(3), L(9):3=P|L(2,8) ], [ 1, 3 ], 9/35
174011: [ M(11), M(11) ], [ 1, 1 ], 2/105
174113: [ F_78(13)=13:6, L(13)=PSL(3,3), L(13)=PSL(3,3) ], [ 1, 2, 2 ], 4/1155
174215: [ 1/2[S(3)^5]S(5), 1/2[S(5)^3]S(3), L(15)=A_8(15)=PSL(4,2),
1743  L(15)=A_8(15)=PSL(4,2) ], [ 1, 1, 1, 1 ], 29/273
174417: [ L(17):4=PYL(2,16), L(17):4=PYL(2,16) ], [ 1, 1 ], 2/135135
174519: [ F_171(19)=19:9 ], [ 1 ], 1/6098892800
174621: [ t21n150, t21n161, t21n91 ], [ 1, 1, 2 ], 29/285
174723: [ M(23), M(23) ], [ 1, 1 ], 2/130945815
1748gap> t:= CharacterTable( "A5" );;
1749gap> ProbGenInfoSimple( t );
1750[ "A5", 1/3, 2, [ "5A" ], [ 1 ] ]
1751gap> OrdersClassRepresentatives( t );
1752[ 1, 2, 3, 5, 5 ]
1753gap> PrimitivePermutationCharacters( t );
1754[ Character( CharacterTable( "A5" ), [ 5, 1, 2, 0, 0 ] ),
1755  Character( CharacterTable( "A5" ), [ 6, 2, 0, 1, 1 ] ),
1756  Character( CharacterTable( "A5" ), [ 10, 2, 1, 0, 0 ] ) ]
1757gap> g:= AlternatingGroup( 5 );;
1758gap> inv:= g.1^2 * g.2;
1759(1,4)(2,5)
1760gap> cclreps:= List( ConjugacyClasses( g ), Representative );;
1761gap> SortParallel( List( cclreps, Order ), cclreps );
1762gap> List( cclreps, Order );
1763[ 1, 2, 3, 5, 5 ]
1764gap> Size( ConjugacyClass( g, inv ) );
176515
1766gap> prop:= List( cclreps,
1767>                 r -> RatioOfNongenerationTransPermGroup( g, inv, r ) );
1768[ 1, 1, 3/5, 1/3, 1/3 ]
1769gap> Minimum( prop );
17701/3
1771gap> triple:= [ (1,2)(3,4), (1,3)(2,4), (1,4)(2,3) ];;
1772gap> CommonGeneratorWithGivenElements( g, cclreps, triple );
1773fail
1774gap> t:= CharacterTable( "A6" );;
1775gap> ProbGenInfoSimple( t );
1776[ "A6", 2/3, 1, [ "5A" ], [ 2 ] ]
1777gap> OrdersClassRepresentatives( t );
1778[ 1, 2, 3, 3, 4, 5, 5 ]
1779gap> prim:= PrimitivePermutationCharacters( t );
1780[ Character( CharacterTable( "A6" ), [ 6, 2, 3, 0, 0, 1, 1 ] ),
1781  Character( CharacterTable( "A6" ), [ 6, 2, 0, 3, 0, 1, 1 ] ),
1782  Character( CharacterTable( "A6" ), [ 10, 2, 1, 1, 2, 0, 0 ] ),
1783  Character( CharacterTable( "A6" ), [ 15, 3, 3, 0, 1, 0, 0 ] ),
1784  Character( CharacterTable( "A6" ), [ 15, 3, 0, 3, 1, 0, 0 ] ) ]
1785gap> S:= AlternatingGroup( 6 );;
1786gap> inv:= (S.1*S.2)^2;
1787(1,3)(2,5)
1788gap> cclreps:= List( ConjugacyClasses( S ), Representative );;
1789gap> SortParallel( List( cclreps, Order ), cclreps );
1790gap> List( cclreps, Order );
1791[ 1, 2, 3, 3, 4, 5, 5 ]
1792gap> C:= ConjugacyClass( S, inv );;
1793gap> Size( C );
179445
1795gap> prop:= List( cclreps,
1796>                 r -> RatioOfNongenerationTransPermGroup( S, inv, r ) );
1797[ 1, 1, 1, 1, 29/45, 5/9, 5/9 ]
1798gap> Minimum( prop );
17995/9
1800gap> ApproxP( prim, 6 );
1801[ 0, 2/3, 1/2, 1/2, 0, 1/3, 1/3 ]
1802gap> triple:= [ (1,2)(3,4), (1,3)(2,4), (1,4)(2,3) ];;
1803gap> CommonGeneratorWithGivenElements( S, cclreps, triple );
1804fail
1805gap> triple:= [ (1,3)(2,4), (1,5)(2,6), (3,6)(4,5) ];;
1806gap> CommonGeneratorWithGivenElements( S, cclreps, triple );
1807fail
1808gap> TripleWithProperty( [ [ inv ], C, C ],
1809>        l -> ForAll( S, elm ->
1810>   ForAny( l, x -> not IsGeneratorsOfTransPermGroup( S, [ elm, x ] ) ) ) );
1811[ (1,3)(2,5), (1,3)(2,6), (1,3)(2,4) ]
1812gap> s:= (1,2,3,4)(5,6);;
1813gap> reps:= Filtered( cclreps, x -> Order( x ) > 1 );;
1814gap> ResetGlobalRandomNumberGenerators();
1815gap> for pair in UnorderedTuples( reps, 2 ) do
1816>      if RandomCheckUniformSpread( S, pair, s, 40 ) <> true then
1817>        Print( "#E  nongeneration!\n" );
1818>      fi;
1819>    od;
1820gap> G:= SymmetricGroup( 6 );;
1821gap> RatioOfNongenerationTransPermGroup( G, s, (1,2) );
18221
1823gap> goods:= Filtered( Elements( G ),
1824>      s -> IsGeneratorsOfTransPermGroup( G, [ s, (1,2) ] ) and
1825>           IsGeneratorsOfTransPermGroup( G, [ s, (3,4) ] ) );;
1826gap> Collected( List( goods, CycleStructurePerm ) );
1827[ [ [ ,,,, 1 ], 24 ] ]
1828gap> goods:= Filtered( Elements( G ),
1829>      s -> IsGeneratorsOfTransPermGroup( G, [ s, (1,2)(3,4)(5,6) ] ) and
1830>           IsGeneratorsOfTransPermGroup( G, [ s, (1,3)(2,4)(5,6) ] ) );;
1831gap> Collected( List( goods, CycleStructurePerm ) );
1832[ [ [ 1, 1 ], 24 ] ]
1833gap> Sgens:= GeneratorsOfGroup( S );;
1834gap> primord:= Filtered( List( ConjugacyClasses( G ), Representative ),
1835>                        x -> IsPrimeInt( Order( x ) ) );;
1836gap> for x in primord do
1837>      for y in primord do
1838>        for pair in DoubleCosetRepsAndSizes( G, Centralizer( G, y ),
1839>                        Centralizer( G, x ) ) do
1840>          if not ForAny( G, s -> IsSubset( Group( x,s ), S ) and
1841>                                 IsSubset( Group( y^pair[1], s ), S ) ) then
1842>            Error( [ x, y ] );
1843>          fi;
1844>        od;
1845>      od;
1846>    od;
1847gap> filt:= Filtered( S, s -> IsSubset( Group( (1,2), s ), S ) );;
1848gap> Collected( List( filt, Order ) );
1849[ [ 5, 48 ] ]
1850gap> ProbGenInfoSimple( CharacterTable( "A6.2_2" ) );
1851[ "A6.2_2", 1/6, 5, [ "10A" ], [ 1 ] ]
1852gap> ProbGenInfoSimple( CharacterTable( "A6.2_3" ) );
1853[ "A6.2_3", 1/9, 8, [ "8C" ], [ 1 ] ]
1854gap> t:= CharacterTable( "A6" );;
1855gap> t2:= CharacterTable( "A6.2_2" );;
1856gap> spos:= PositionsProperty( OrdersClassRepresentatives( t ), x -> x = 5 );;
1857gap> ProbGenInfoAlmostSimple( t, t2, spos );
1858[ "A6.2_2", 1/6, [ "5A", "5B" ], [ 1, 1 ] ]
1859gap> t:= CharacterTable( "A7" );;
1860gap> ProbGenInfoSimple( t );
1861[ "A7", 2/5, 2, [ "7A" ], [ 2 ] ]
1862gap> OrdersClassRepresentatives( t );
1863[ 1, 2, 3, 3, 4, 5, 6, 7, 7 ]
1864gap> prim:= PrimitivePermutationCharacters( t );
1865[ Character( CharacterTable( "A7" ), [ 7, 3, 4, 1, 1, 2, 0, 0, 0 ] ),
1866  Character( CharacterTable( "A7" ), [ 15, 3, 0, 3, 1, 0, 0, 1, 1 ] ),
1867  Character( CharacterTable( "A7" ), [ 15, 3, 0, 3, 1, 0, 0, 1, 1 ] ),
1868  Character( CharacterTable( "A7" ), [ 21, 5, 6, 0, 1, 1, 2, 0, 0 ] ),
1869  Character( CharacterTable( "A7" ), [ 35, 7, 5, 2, 1, 0, 1, 0, 0 ] ) ]
1870gap> g:= AlternatingGroup( 7 );;
1871gap> inv:= (g.1^3*g.2)^3;
1872(2,6)(3,7)
1873gap> ccl:= List( ConjugacyClasses( g ), Representative );;
1874gap> SortParallel( List( ccl, Order ), ccl );
1875gap> List( ccl, Order );
1876[ 1, 2, 3, 3, 4, 5, 6, 7, 7 ]
1877gap> Size( ConjugacyClass( g, inv ) );
1878105
1879gap> prop:= List( ccl, r -> RatioOfNongenerationTransPermGroup( g, inv, r ) );
1880[ 1, 1, 1, 1, 89/105, 17/21, 19/35, 2/5, 2/5 ]
1881gap> Minimum( prop );
18822/5
1883gap> OrdersClassRepresentatives( t );
1884[ 1, 2, 3, 3, 4, 5, 6, 7, 7 ]
1885gap> spos:= Position( OrdersClassRepresentatives( t ), 7 );;
1886gap> SizesCentralizers( t );
1887[ 2520, 24, 36, 9, 4, 5, 12, 7, 7 ]
1888gap> ApproxP( prim, spos );
1889[ 0, 2/5, 0, 2/5, 2/15, 0, 0, 2/15, 2/15 ]
1890gap> s:= (1,2,3,4,5,6,7);;
1891gap> 3B:= (1,2,3)(4,5,6);;
1892gap> C3B:= ConjugacyClass( g, 3B );;
1893gap> Size( C3B );
1894280
1895gap> ResetGlobalRandomNumberGenerators();
1896gap> for triple in UnorderedTuples( [ inv, 3B ], 3 ) do
1897>      if RandomCheckUniformSpread( g, triple, s, 80 ) <> true then
1898>        Print( "#E  nongeneration!\n" );
1899>      fi;
1900>    od;
1901gap> tom:= TableOfMarks( "A7" );;
1902gap> a7:= UnderlyingGroup( tom );;
1903gap> tommaxes:= MaximalSubgroupsTom( tom );
1904[ [ 39, 38, 37, 36, 35 ], [ 7, 15, 15, 21, 35 ] ]
1905gap> index15:= List( tommaxes[1]{ [ 2, 3 ] },
1906>                    i -> RepresentativeTom( tom, i ) );
1907[ Group([ (1,3)(2,7), (1,5,7)(3,4,6) ]),
1908  Group([ (1,4)(2,3), (2,4,6)(3,5,7) ]) ]
1909gap> deg15:= List( index15, s -> RightTransversal( a7, s ) );;
1910gap> reps:= List( deg15, l -> Action( a7, l, OnRight ) );
1911[ Group([ (1,5,7)(2,9,10)(3,11,4)(6,12,8)(13,14,15),
1912      (1,8,15,5,12)(2,13,11,3,10)(4,14,9,7,6) ]),
1913  Group([ (1,2,3)(4,6,5)(7,8,9)(10,12,11)(13,15,14),
1914      (1,12,3,13,10)(2,9,15,4,11)(5,6,14,7,8) ]) ]
1915gap> g:= DiagonalProductOfPermGroups( reps );;
1916gap> ResetGlobalRandomNumberGenerators();
1917gap> repeat s:= Random( g );
1918>    until Order( s ) = 7;
1919gap> NrMovedPoints( s );
192028
1921gap> mpg:= MovedPoints( g );;
1922gap> fixs:= Difference( mpg, MovedPoints( s ) );;
1923gap> orb_s:= Orbit( g, fixs, OnSets );;
1924gap> Length( orb_s );
1925120
1926gap> SizesCentralizers( t );
1927[ 2520, 24, 36, 9, 4, 5, 12, 7, 7 ]
1928gap> repeat 2a:= Random( g ); until Order( 2a ) = 2;
1929gap> repeat 3b:= Random( g );
1930>    until Order( 3b ) = 3 and Size( Centralizer( g, 3b ) ) = 9;
1931gap> orb2a:= Orbit( g, Difference( mpg, MovedPoints( 2a ) ), OnSets );;
1932gap> orb3b:= Orbit( g, Difference( mpg, MovedPoints( 3b ) ), OnSets );;
1933gap> orb2aor3b:= Union( orb2a, orb3b );;
1934gap> TripleWithProperty( [ [ orb2a[1], orb3b[1] ], orb2aor3b, orb2aor3b ],
1935>        l -> ForAll( orb_s,
1936>                 f -> not IsEmpty( Intersection( Union( l ), f ) ) ) );
1937fail
1938gap> QuadrupleWithProperty( [ [ orb2a[1] ], orb2a, orb2a, orb2a ],
1939>        l -> ForAll( orb_s,
1940>                 f -> not IsEmpty( Intersection( Union( l ), f ) ) ) );
1941[ [ 2, 11, 15, 19, 24, 29 ], [ 4, 9, 13, 21, 22, 28 ],
1942  [ 3, 10, 14, 20, 23, 30 ], [ 1, 5, 7, 25, 26, 27 ] ]
1943gap> has6A:= List( tommaxes[1]{ [ 4, 5 ] },
1944>                  i -> RepresentativeTom( tom, i ) );
1945[ Group([ (1,2)(3,7), (2,6,5,4)(3,7) ]),
1946  Group([ (2,3)(5,7), (1,2)(4,5,6,7), (2,3)(5,6) ]) ]
1947gap> trans:= List( has6A, s -> RightTransversal( a7, s ) );;
1948gap> reps:= List( trans, l -> Action( a7, l, OnRight ) );
1949[ Group([ (1,16,12)(2,17,13)(3,18,11)(4,19,14)(15,20,21),
1950      (1,4,7,9,10)(2,5,8,3,6)(11,12,15,14,13)(16,20,19,17,18) ]),
1951  Group([ (2,16,6)(3,17,7)(4,18,8)(5,19,9)(10,20,26)(11,21,27)(12,22,28)(13,
1952        23,29)(14,24,30)(15,25,31), (1,2,3,4,5)(6,10,13,15,9)(7,11,14,8,
1953        12)(16,20,23,25,19)(17,21,24,18,22)(26,32,35,31,28)(27,33,29,34,30)
1954     ]) ]
1955gap> g:= DiagonalProductOfPermGroups( reps );;
1956gap> repeat s:= Random( g );
1957>    until Order( s ) = 6;
1958gap> NrMovedPoints( s );
195953
1960gap> mpg:= MovedPoints( g );;
1961gap> fixs:= Difference( mpg, MovedPoints( s ) );;
1962gap> orb_s:= Orbit( g, fixs, OnSets );;
1963gap> Length( orb_s );
1964105
1965gap> repeat 3a:= Random( g );
1966>    until Order( 3a ) = 3 and Size( Centralizer( g, 3a ) ) = 36;
1967gap> orb3a:= Orbit( g, Difference( mpg, MovedPoints( 3a ) ), OnSets );;
1968gap> Length( orb3a );
196935
1970gap> TripleWithProperty( [ [ orb3a[1] ], orb3a, orb3a ],
1971>        l -> ForAll( orb_s,
1972>                 f -> not IsEmpty( Intersection( Union( l ), f ) ) ) );
1973[ [ 5, 7, 9, 17, 18, 19, 31, 32, 34, 40, 53 ],
1974  [ 5, 7, 9, 11, 13, 14, 30, 41, 42, 44, 53 ],
1975  [ 2, 3, 4, 5, 7, 9, 26, 47, 48, 50, 53 ] ]
1976#############################################################################
1977##
1978#F  RelativeSigmaL( <d>, <B> )
1979##
1980##  Let <d> be a positive integer and <B> a basis for a field extension
1981##  of degree $n$, say, over the field $F$ with $q$ elements.
1982##  `RelativeSigmaL' returns a group of $<d> n \times <d> n$ matrices
1983##  over $F$, which is the intersection of $\SL(<d> n, q)$ and the split
1984##  extension of an extension field type subgroup isomorphic with
1985##  $\GL(<d>, q^n)$ by the Frobenius automorphism that maps each matrix
1986##  entry to its $q$-th power.
1987##
1988##  (If $q$ is a prime then the return value is isomorphic with the
1989##  semilinear group $\SigmaL(<d>, q^n)$.)
1990##
1991gap> RelativeSigmaL:= function( d, B )
1992>     local n, F, q, glgens, diag, pi, frob, i;
1993>
1994>     n:= Length( B );
1995>     F:= LeftActingDomain( UnderlyingLeftModule( B ) );
1996>     q:= Size( F );
1997>
1998>     # Create the generating matrices inside the linear subgroup.
1999>     glgens:= List( GeneratorsOfGroup( SL( d, q^n ) ),
2000>                    m -> BlownUpMat( B, m ) );
2001>
2002>     # Create the matrix of a diagonal part that maps to determinant 1.
2003>     diag:= IdentityMat( d*n, F );
2004>     diag{ [ 1 .. n ] }{ [ 1 .. n ] }:= BlownUpMat( B, [ [ Z(q^n)^(q-1) ] ] );
2005>     Add( glgens, diag );
2006>
2007>     # Create the matrix that realizes the Frobenius action,
2008>     # and adjust the determinant.
2009>     pi:= List( B, b -> Coefficients( B, b^q ) );
2010>     frob:= NullMat( d*n, d*n, F );
2011>     for i in [ 0 .. d-1 ] do
2012>       frob{ [ 1 .. n ] + i*n }{ [ 1 .. n ] + i*n }:= pi;
2013>     od;
2014>     diag:= IdentityMat( d*n, F );
2015>     diag{ [ 1 .. n ] }{ [ 1 .. n ] }:= BlownUpMat( B, [ [ Z(q^n) ] ] );
2016>     diag:= diag^LogFFE( Inverse( Determinant( frob ) ), Determinant( diag ) );
2017>
2018>     # Return the result.
2019>     return Group( Concatenation( glgens, [ diag * frob ] ) );
2020> end;;
2021#############################################################################
2022##
2023#F  ApproxPForSL( <d>, <q> )
2024##
2025##  For a positive integer <d> and a prime power <q>,
2026##  `ApproxPForSL' returns $[ \M(G,s), \total( G, s ) ]$,
2027##  where $G = \PSL( <d>, <q> )$, $s \in G$ is the image of a Singer cycle
2028##  in $\SL(d,q)$,
2029##  and $\M(G,s)$ is the list of names of those maximal subgroups of $G$
2030##  that contain $s$.
2031##
2032gap> ApproxPForSL:= function( d, q )
2033>     local G, epi, PG, primes, maxes, names, ccl;
2034>
2035>     # Check whether this is an admissible case (see [Be00]).
2036>     if ( d = 2 and q in [ 2, 5, 7, 9 ] ) or ( d = 3 and q = 4 ) then
2037>       return fail;
2038>     fi;
2039>
2040>     # Create the group SL(d,q), and the map to PSL(d,q).
2041>     G:= SL( d, q );
2042>     epi:= ActionHomomorphism( G, NormedRowVectors( GF(q)^d ), OnLines );
2043>     PG:= ImagesSource( epi );
2044>
2045>     # Create the subgroups corresponding to the prime divisors of `d'.
2046>     primes:= Set( Factors( d ) );
2047>     maxes:= List( primes, p -> RelativeSigmaL( d/p,
2048>                                  Basis( AsField( GF(q), GF(q^p) ) ) ) );
2049>     names:= List( primes, p -> Concatenation( "GL(", String( d/p ), ",",
2050>                                  String( q^p ), ").", String( p ) ) );
2051>     if 2 < q then
2052>       names:= List( names, name -> Concatenation( name, " cap G" ) );
2053>     fi;
2054>
2055>     # Compute the conjugacy classes of prime order elements in the maxes.
2056>     # (In order to avoid computing all conjugacy classes of these subgroups,
2057>     # we work in Sylow subgroups.)
2058>     ccl:= List( List( maxes, x -> ImagesSet( epi, x ) ),
2059>             M -> ClassesOfPrimeOrder( M, Set( Factors( Size( M ) ) ),
2060>                                       TrivialSubgroup( M ) ) );
2061>
2062>     return [ names, UpperBoundFixedPointRatios( PG, ccl, true )[1] ];
2063> end;;
2064gap> pairs:= [ [ 3, 2 ], [ 3, 3 ], [ 4, 2 ], [ 4, 3 ], [ 4, 4 ],
2065>            [ 6, 2 ], [ 6, 3 ], [ 6, 4 ], [ 6, 5 ], [ 8, 2 ], [ 10, 2 ] ];;
2066gap> array:= [];;
2067gap> for pair in pairs do
2068>      d:= pair[1];  q:= pair[2];
2069>      approx:= ApproxPForSL( d, q );
2070>      Add( array, [ Concatenation( "SL(", String(d), ",", String(q), ")" ),
2071>                    (q^d-1)/(q-1),
2072>                    approx[1], approx[2] ] );
2073>    od;
2074gap> PrintFormattedArray( array );
2075   SL(3,2)    7                             [ "GL(1,8).3" ]             1/4
2076   SL(3,3)   13                      [ "GL(1,27).3 cap G" ]            1/24
2077   SL(4,2)   15                             [ "GL(2,4).2" ]            3/14
2078   SL(4,3)   40                       [ "GL(2,9).2 cap G" ]         53/1053
2079   SL(4,4)   85                      [ "GL(2,16).2 cap G" ]           1/108
2080   SL(6,2)   63                [ "GL(3,4).2", "GL(2,8).3" ]       365/55552
2081   SL(6,3)  364   [ "GL(3,9).2 cap G", "GL(2,27).3 cap G" ] 22843/123845436
2082   SL(6,4) 1365  [ "GL(3,16).2 cap G", "GL(2,64).3 cap G" ]         1/85932
2083   SL(6,5) 3906 [ "GL(3,25).2 cap G", "GL(2,125).3 cap G" ]        1/484220
2084   SL(8,2)  255                             [ "GL(4,4).2" ]          1/7874
2085  SL(10,2) 1023               [ "GL(5,4).2", "GL(2,32).5" ]        1/129794
2086gap> t:= CharacterTable( "L6(2)" );;
2087gap> s1:= CharacterTable( "3.L3(4).3.2_2" );;
2088gap> s2:= CharacterTable( "(7xL2(8)).3" );;
2089gap> SigmaFromMaxes( t, "63A", [ s1, s2 ], [ 1, 1 ] );
2090365/55552
2091gap> UpperBoundForSL:= function( d, q )
2092>     local G, Msize, ccl;
2093>
2094>     if not IsPrimeInt( d ) then
2095>       Error( "<d> must be a prime" );
2096>     fi;
2097>
2098>     G:= SL( d, q );
2099>     Msize:= (q^d-1) * d;
2100>     ccl:= Filtered( ConjugacyClasses( G ),
2101>                     c ->     Msize mod Order( Representative( c ) ) = 0
2102>                          and Size( c ) <> 1 );
2103>
2104>     return Msize / Minimum( List( ccl, Size ) );
2105> end;;
2106gap> NrConjugacyClasses( SL(11,4) );
21071397660
2108gap> pairs:= [ [ 3, 2 ], [ 3, 3 ], [ 5, 2 ], [ 5, 3 ], [ 5, 4 ],
2109>              [ 7, 2 ], [ 7, 3 ], [ 7, 4 ],
2110>              [ 11, 2 ], [ 11, 3 ] ];;
2111gap> array:= [];;
2112gap> for pair in pairs do
2113>      d:= pair[1];  q:= pair[2];
2114>      approx:= UpperBoundForSL( d, q );
2115>      Add( array, [ Concatenation( "SL(", String(d), ",", String(q), ")" ),
2116>                    (q^d-1)/(q-1),
2117>                    approx ] );
2118>    od;
2119gap> PrintFormattedArray( array );
2120   SL(3,2)     7                                   7/8
2121   SL(3,3)    13                                   3/4
2122   SL(5,2)    31                              31/64512
2123   SL(5,3)   121                                 10/81
2124   SL(5,4)   341                                15/256
2125   SL(7,2)   127                             7/9142272
2126   SL(7,3)  1093                                14/729
2127   SL(7,4)  5461                               21/4096
2128  SL(11,2)  2047 2047/34112245508649716682268134604800
2129  SL(11,3) 88573                              22/59049
2130gap> SigmaFromMaxes( CharacterTable( "L5(2)" ), "31A",
2131>        [ CharacterTable( "31:5" ) ], [ 1 ] );
21321/5376
2133gap> t:= CharacterTable( "L7(2)" );;
2134gap> s:= CharacterTable( "P:Q", [ 127, 7 ] );;
2135gap> pi:= PossiblePermutationCharacters( s, t );;
2136gap> Length( pi );
21372
2138gap> ord7:= PositionsProperty( OrdersClassRepresentatives( t ), x -> x = 7 );
2139[ 38, 45, 76, 77, 83 ]
2140gap> sizes:= SizesCentralizers( t ){ ord7 };
2141[ 141120, 141120, 3528, 3528, 49 ]
2142gap> List( pi, x -> x[83] );
2143[ 42, 0 ]
2144gap> spos:= Position( OrdersClassRepresentatives( t ), 127 );;
2145gap> Maximum( ApproxP( pi{ [ 1 ] }, spos ) );
21461/4388290560
2147#############################################################################
2148##
2149#F  SymmetricBasis( <q>, <n> )
2150##
2151##  For a positive integer <n> and a prime power <q>,
2152##  `SymmetricBasis' returns a basis $B$ for the `GF(<q>)'-vector space
2153##  `GF(<q>^<n>)' with the property that $`BlownUpMat'( B, x )$
2154##  is symmetric for each element $x$ in `GF(<q>^<n>)'.
2155##
2156gap> SymmetricBasis:= function( q, n )
2157>     local vectors, B, issymmetric;
2158>
2159>     if   q = 2 and n = 2 then
2160>       vectors:= [ Z(2)^0, Z(2^2) ];
2161>     elif q = 2 and n = 3 then
2162>       vectors:= [ Z(2)^0, Z(2^3), Z(2^3)^5 ];
2163>     elif q = 2 and n = 5 then
2164>       vectors:= [ Z(2)^0, Z(2^5), Z(2^5)^4, Z(2^5)^25, Z(2^5)^26 ];
2165>     elif q = 3 and n = 2 then
2166>       vectors:= [ Z(3)^0, Z(3^2) ];
2167>     elif q = 3 and n = 3 then
2168>       vectors:= [ Z(3)^0, Z(3^3)^2, Z(3^3)^7 ];
2169>     elif q = 4 and n = 2 then
2170>       vectors:= [ Z(2)^0, Z(2^4)^3 ];
2171>     elif q = 4 and n = 3 then
2172>       vectors:= [ Z(2)^0, Z(2^3), Z(2^3)^5 ];
2173>     elif q = 5 and n = 2 then
2174>       vectors:= [ Z(5)^0, Z(5^2)^2 ];
2175>     elif q = 5 and n = 3 then
2176>       vectors:= [ Z(5)^0, Z(5^3)^9, Z(5^3)^27 ];
2177>     else
2178>       Error( "sorry, no basis for <q> and <n> stored" );
2179>     fi;
2180>
2181>     B:= Basis( AsField( GF(q), GF(q^n) ), vectors );
2182>
2183>     # Check that the basis really has the required property.
2184>     issymmetric:= M -> M = TransposedMat( M );
2185>     if not ForAll( B, b -> issymmetric( BlownUpMat( B, [ [ b ] ] ) ) ) then
2186>       Error( "wrong basis!" );
2187>     fi;
2188>
2189>     # Return the result.
2190>     return B;
2191> end;;
2192#############################################################################
2193##
2194#F  EmbeddedMatrix( <F>, <mat>, <func> )
2195##
2196##  For a field <F>, a matrix <mat> and a function <func> that takes a matrix
2197##  and returns a matrix of the same shape,
2198##  `EmbeddedMatrix' returns a block diagonal matrix over the field <F>
2199##  whose diagonal blocks are <mat> and `<func>( <mat> )'.
2200##
2201gap> BindGlobal( "EmbeddedMatrix", function( F, mat, func )
2202>   local d, result;
2203>
2204>   d:= Length( mat );
2205>   result:= NullMat( 2*d, 2*d, F );
2206>   result{ [ 1 .. d ] }{ [ 1 .. d ] }:= mat;
2207>   result{ [ d+1 .. 2*d ] }{ [ d+1 .. 2*d ] }:= func( mat );
2208>
2209>   return result;
2210> end );
2211#############################################################################
2212##
2213#F  ApproxPForOuterClassesInExtensionOfSLByGraphAut( <d>, <q> )
2214##
2215##  For a positive integer <d> and a prime power <q>,
2216##  `ApproxPForOuterClassesInExtensionOfSLByGraphAut' returns
2217##  $[ \M(G,s), \total^{\prime}( G, s ) ]$,
2218##  where $G$ is $\PSL( <d>, <q> )$ extended by a graph automorphism,
2219##  $s \in G$ is the image of a Singer cycle in $\SL(d,q)$,
2220##  and $\M(G,s)$ is the list of names of those maximal subgroups of
2221##  $\PGL( <d>, <q> )$ that contain $s$.
2222##
2223gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut:= function( d, q )
2224>     local embedG, swap, G, orb, epi, PG, Gprime, primes, maxes, ccl, names;
2225>
2226>     # Check whether this is an admissible case (see [Be00],
2227>     # note that a graph automorphism exists only for `d > 2').
2228>     if d = 2 or ( d = 3 and q = 4 ) then
2229>       return fail;
2230>     fi;
2231>
2232>     # Provide a function that constructs a block diagonal matrix.
2233>     embedG:= mat -> EmbeddedMatrix( GF( q ), mat,
2234>                                     M -> TransposedMat( M^-1 ) );
2235>
2236>     # Create the matrix that exchanges the two blocks.
2237>     swap:= NullMat( 2*d, 2*d, GF(q) );
2238>     swap{ [ 1 .. d ] }{ [ d+1 .. 2*d ] }:= IdentityMat( d, GF(q) );
2239>     swap{ [ d+1 .. 2*d ] }{ [ 1 .. d ] }:= IdentityMat( d, GF(q) );
2240>
2241>     # Create the group SL(d,q).2, and the map to the projective group.
2242>     G:= ClosureGroupDefault( Group( List( GeneratorsOfGroup( SL( d, q ) ),
2243>                                           embedG ) ),
2244>                       swap );
2245>     orb:= Orbit( G, One( G )[1], OnLines );
2246>     epi:= ActionHomomorphism( G, orb, OnLines );
2247>     PG:= ImagesSource( epi );
2248>     Gprime:= DerivedSubgroup( PG );
2249>
2250>     # Create the subgroups corresponding to the prime divisors of `d'.
2251>     primes:= Set( Factors( d ) );
2252>     maxes:= List( primes,
2253>               p -> ClosureGroupDefault( Group( List( GeneratorsOfGroup(
2254>                          RelativeSigmaL( d/p, SymmetricBasis( q, p ) ) ),
2255>                          embedG ) ),
2256>                      swap ) );
2257>
2258>     # Compute conjugacy classes of outer involutions in the maxes.
2259>     # (In order to avoid computing all conjugacy classes of these subgroups,
2260>     # we work in the Sylow $2$ subgroups.)
2261>     maxes:= List( maxes, M -> ImagesSet( epi, M ) );
2262>     ccl:= List( maxes, M -> ClassesOfPrimeOrder( M, [ 2 ], Gprime ) );
2263>     names:= List( primes, p -> Concatenation( "GL(", String( d/p ), ",",
2264>                                    String( q^p ), ").", String( p ) ) );
2265>
2266>     return [ names, UpperBoundFixedPointRatios( PG, ccl, true )[1] ];
2267> end;;
2268gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 4, 3 );
2269[ [ "GL(2,9).2" ], 17/117 ]
2270gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 4, 4 );
2271[ [ "GL(2,16).2" ], 73/1008 ]
2272gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 6, 2 );
2273[ [ "GL(3,4).2", "GL(2,8).3" ], 41/1984 ]
2274gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 6, 3 );
2275[ [ "GL(3,9).2", "GL(2,27).3" ], 541/352836 ]
2276gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 6, 4 );
2277[ [ "GL(3,16).2", "GL(2,64).3" ], 3265/12570624 ]
2278gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 6, 5 );
2279[ [ "GL(3,25).2", "GL(2,125).3" ], 13001/195250000 ]
2280gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 8, 2 );
2281[ [ "GL(4,4).2" ], 367/1007872 ]
2282gap> ApproxPForOuterClassesInExtensionOfSLByGraphAut( 10, 2 );
2283[ [ "GL(5,4).2", "GL(2,32).5" ], 609281/476346056704 ]
2284#############################################################################
2285##
2286#F  RelativeGammaL( <d>, <B> )
2287##
2288##  Let the arguments be as for `RelativeSigmaL'.
2289##  Then `RelativeGammaL' returns the extension field type subgroup of
2290##  $\GL(d,q)$ that corresponds to the subgroup of $\SL(d,q)$ returned by
2291##  `RelativeSigmaL'.
2292##
2293gap> RelativeGammaL:= function( d, B )
2294>     local n, F, q, diag;
2295>
2296>     n:= Length( B );
2297>     F:= LeftActingDomain( UnderlyingLeftModule( B ) );
2298>     q:= Size( F );
2299>     diag:= IdentityMat( d * n, F );
2300>     diag{[ 1 .. n ]}{[ 1 .. n ]}:= BlownUpMat( B, [ [ Z(q^n) ] ] );
2301>     return ClosureGroup( RelativeSigmaL( d, B ),  diag );
2302> end;;
2303#############################################################################
2304##
2305#F  ApproxPForOuterClassesInGL( <d>, <q> )
2306##
2307##  Let the arguments be as for `ApproxPForSL'.
2308##  Then `ApproxPForOuterClassesInGL' returns the list of names of the
2309##  extension field type subgroups of $\GL(<d>,<q>)$,
2310##  and $\total^{\prime}(\GL(<d>,<q>),s)$,
2311##  for a Singer cycle $s \in \SL(d,q)$.
2312##
2313gap> ApproxPForOuterClassesInGL:= function( d, q )
2314>     local G, epi, PG, Gprime, primes, maxes, names;
2315>
2316>     # Check whether this is an admissible case (see [Be00]).
2317>     if ( d = 2 and q in [ 2, 5, 7, 9 ] ) or ( d = 3 and q = 4 ) then
2318>       return fail;
2319>     fi;
2320>
2321>     # Create the group GL(d,q), and the map to PGL(d,q).
2322>     G:= GL( d, q );
2323>     epi:= ActionHomomorphism( G, NormedRowVectors( GF(q)^d ), OnLines );
2324>     PG:= ImagesSource( epi );
2325>     Gprime:= ImagesSet( epi, SL( d, q ) );
2326>
2327>     # Create the subgroups corresponding to the prime divisors of `d'.
2328>     primes:= Set( Factors( d ) );
2329>     maxes:= List( primes, p -> RelativeGammaL( d/p,
2330>                                    Basis( AsField( GF(q), GF(q^p) ) ) ) );
2331>     maxes:= List( maxes, M -> ImagesSet( epi, M ) );
2332>     names:= List( primes, p -> Concatenation( "M(", String( d/p ), ",",
2333>                                    String( q^p ), ")" ) );
2334>
2335>     return [ names,
2336>              UpperBoundFixedPointRatios( PG, List( maxes,
2337>                  M -> ClassesOfPrimeOrder( M,
2338>                           Set( Factors( Index( PG, Gprime ) ) ), Gprime ) ),
2339>                  true )[1] ];
2340> end;;
2341gap> ApproxPForOuterClassesInGL( 6, 3 );
2342[ [ "M(3,9)", "M(2,27)" ], 41/882090 ]
2343gap> ApproxPForOuterClassesInGL( 4, 3 );
2344[ [ "M(2,9)" ], 0 ]
2345gap> ApproxPForOuterClassesInGL( 6, 4 );
2346[ [ "M(3,16)", "M(2,64)" ], 1/87296 ]
2347gap> ApproxPForOuterClassesInGL( 6, 5 );
2348[ [ "M(3,25)", "M(2,125)" ], 821563/756593750000 ]
2349gap> matgrp:= SL(6,4);;
2350gap> dom:= NormedRowVectors( GF(4)^6 );;
2351gap> Gprime:= Action( matgrp, dom, OnLines );;
2352gap> pi:= PermList( List( dom, v -> Position( dom, List( v, x -> x^2 ) ) ) );;
2353gap> G:= ClosureGroup( Gprime, pi );;
2354gap> maxes:= List( [ 2, 3 ], p -> Normalizer( G,
2355>              Action( RelativeSigmaL( 6/p,
2356>                Basis( AsField( GF(4), GF(4^p) ) ) ), dom, OnLines ) ) );;
2357gap> ccl:= List( maxes, M -> ClassesOfPrimeOrder( M, [ 2 ], Gprime ) );;
2358gap> List( ccl, Length );
2359[ 0, 1 ]
2360gap> UpperBoundFixedPointRatios( G, ccl, true );
2361[ 1/34467840, true ]
2362gap> embedFG:= function( F, mat )
2363>      return EmbeddedMatrix( F, mat,
2364>                 M -> List( TransposedMat( M^-1 ),
2365>                            row -> List( row, x -> x^2 ) ) );
2366>    end;;
2367gap> d:= 6;;  q:= 4;;
2368gap> alpha:= NullMat( 2*d, 2*d, GF(q) );;
2369gap> alpha{ [ 1 .. d ] }{ [ d+1 .. 2*d ] }:= IdentityMat( d, GF(q) );;
2370gap> alpha{ [ d+1 .. 2*d ] }{ [ 1 .. d ] }:= IdentityMat( d, GF(q) );;
2371gap> Gprime:= Group( List( GeneratorsOfGroup( SL(d,q) ),
2372>                          mat -> embedFG( GF(q), mat ) ) );;
2373gap> G:= ClosureGroupDefault( Gprime, alpha );;
2374gap> orb:= Orbit( G, One( G )[1], OnLines );;
2375gap> G:= Action( G, orb, OnLines );;
2376gap> Gprime:= Action( Gprime, orb, OnLines );;
2377gap> maxes:= List( Set( Factors( d ) ), p -> Group( List( GeneratorsOfGroup(
2378>              RelativeSigmaL( d/p, Basis( AsField( GF(q), GF(q^p) ) ) ) ),
2379>                mat -> embedFG( GF(q), mat ) ) ) );;
2380gap> maxes:= List( maxes, x -> Action( x, orb, OnLines ) );;
2381gap> maxes:= List( maxes, x -> Normalizer( G, x ) );;
2382gap> ccl:= List( maxes, M -> ClassesOfPrimeOrder( M, [ 2 ], Gprime ) );;
2383gap> List( ccl, Length );
2384[ 0, 1 ]
2385gap> UpperBoundFixedPointRatios( G, ccl, true );
2386[ 1/10792960, true ]
2387gap> d:= 6;;  q:= 3;;
2388gap> diag:= IdentityMat( d, GF(q) );;
2389gap> diag[1][1]:= Z(q);;
2390gap> embedDG:= mat -> EmbeddedMatrix( GF(q), mat,
2391>                                     M -> TransposedMat( M^-1 )^diag );;
2392gap> Gprime:= Group( List( GeneratorsOfGroup( SL(d,q) ), embedDG ) );;
2393gap> alpha:= NullMat( 2*d, 2*d, GF(q) );;
2394gap> alpha{ [ 1 .. d ] }{ [ d+1 .. 2*d ] }:= IdentityMat( d, GF(q) );;
2395gap> alpha{ [ d+1 .. 2*d ] }{ [ 1 .. d ] }:= IdentityMat( d, GF(q) );;
2396gap> G:= ClosureGroupDefault( Gprime, alpha );;
2397gap> maxes:= List( Set( Factors( d ) ), p -> Group( List( GeneratorsOfGroup(
2398>              RelativeSigmaL( d/p, Basis( AsField( GF(q), GF(q^p) ) ) ) ),
2399>                embedDG ) ) );;
2400gap> orb:= Orbit( G, One( G )[1], OnLines );;
2401gap> G:= Action( G, orb, OnLines );;
2402gap> Gprime:= Action( Gprime, orb, OnLines );;
2403gap> maxes:= List( maxes, M -> Normalizer( G, Action( M, orb, OnLines ) ) );;
2404gap> ccl:= List( maxes, M -> ClassesOfPrimeOrder( M, [ 2 ], Gprime ) );;
2405gap> List( ccl, Length );
2406[ 1, 1 ]
2407gap> UpperBoundFixedPointRatios( G, ccl, true );
2408[ 25/352836, true ]
2409gap> d:= 6;;  q:= 5;;
2410gap> embedG:= mat -> EmbeddedMatrix( GF(q),
2411>                                    mat, M -> TransposedMat( M^-1 ) );;
2412gap> Gprime:= Group( List( GeneratorsOfGroup( SL(d,q) ), embedG ) );;
2413gap> maxes:= List( Set( Factors( d ) ), p -> Group( List( GeneratorsOfGroup(
2414>              RelativeSigmaL( d/p, Basis( AsField( GF(q), GF(q^p) ) ) ) ),
2415>                embedG ) ) );;
2416gap> diag:= IdentityMat( d, GF(q) );;
2417gap> diag[1][1]:= Z(q);;
2418gap> diag:= embedG( diag );;
2419gap> alpha:= NullMat( 2*d, 2*d, GF(q) );;
2420gap> alpha{ [ 1 .. d ] }{ [ d+1 .. 2*d ] }:= IdentityMat( d, GF(q) );;
2421gap> alpha{ [ d+1 .. 2*d ] }{ [ 1 .. d ] }:= IdentityMat( d, GF(q) );;
2422gap> G:= ClosureGroupDefault( Gprime, alpha * diag );;
2423gap> orb:= Orbit( G, One( G )[1], OnLines );;
2424gap> Gprime:= Action( Gprime, orb, OnLines );;
2425gap> G:= Action( G, orb, OnLines );;
2426gap> maxes:= List( maxes, M -> Action( M, orb, OnLines ) );;
2427gap> extmaxes:= List( maxes, M -> Normalizer( G, M ) );;
2428gap> ccl:= List( extmaxes, M -> ClassesOfPrimeOrder( M, [ 2 ], Gprime ) );;
2429gap> List( ccl, Length );
2430[ 2, 1 ]
2431gap> UpperBoundFixedPointRatios( G, ccl, true );
2432[ 3863/6052750000, true ]
2433gap> diag:= Permutation( diag, orb, OnLines );;
2434gap> G:= ClosureGroupDefault( Gprime, diag );;
2435gap> extmaxes:= List( maxes, M -> Normalizer( G, M ) );;
2436gap> ccl:= List( extmaxes, M -> ClassesOfPrimeOrder( M, [ 2 ], Gprime ) );;
2437gap> List( ccl, Length );
2438[ 3, 1 ]
2439gap> UpperBoundFixedPointRatios( G, ccl, true );
2440[ 821563/756593750000, true ]
2441gap> alpha:= Permutation( alpha, orb, OnLines );;
2442gap> G:= ClosureGroupDefault( Gprime, alpha );;
2443gap> extmaxes:= List( maxes, M -> Normalizer( G, M ) );;
2444gap> ccl:= List( extmaxes, M -> ClassesOfPrimeOrder( M, [ 2 ], Gprime ) );;
2445gap> List( ccl, Length );
2446[ 2, 2 ]
2447gap> UpperBoundFixedPointRatios( G, ccl, true );
2448[ 13001/195250000, true ]
2449gap> t:= CharacterTable( "L3(2)" );;
2450gap> ProbGenInfoSimple( t );
2451[ "L3(2)", 1/4, 3, [ "7A" ], [ 1 ] ]
2452gap> OrdersClassRepresentatives( t );
2453[ 1, 2, 3, 4, 7, 7 ]
2454gap> PrimitivePermutationCharacters( t );
2455[ Character( CharacterTable( "L3(2)" ), [ 7, 3, 1, 1, 0, 0 ] ),
2456  Character( CharacterTable( "L3(2)" ), [ 7, 3, 1, 1, 0, 0 ] ),
2457  Character( CharacterTable( "L3(2)" ), [ 8, 0, 2, 0, 1, 1 ] ) ]
2458gap> tom:= TableOfMarks( "L3(2)" );;
2459gap> g:= UnderlyingGroup( tom );
2460Group([ (2,4)(5,7), (1,2,3)(4,5,6) ])
2461gap> mx:= MaximalSubgroupsTom( tom );
2462[ [ 14, 13, 12 ], [ 7, 7, 8 ] ]
2463gap> maxes:= List( mx[1], i -> RepresentativeTom( tom, i ) );;
2464gap> tr:= List( maxes, s -> RightTransversal( g, s ) );;
2465gap> acts:= List( tr, x -> Action( g, x, OnRight ) );;
2466gap> g7:= acts[1];
2467Group([ (3,4)(6,7), (1,3,2)(4,6,5) ])
2468gap> g8:= acts[3];
2469Group([ (1,6)(2,5)(3,8)(4,7), (1,7,3)(2,5,8) ])
2470gap> g14:= DiagonalProductOfPermGroups( acts{ [ 1, 2 ] } );
2471Group([ (3,4)(6,7)(11,13)(12,14), (1,3,2)(4,6,5)(8,11,9)(10,12,13) ])
2472gap> g15:= DiagonalProductOfPermGroups( acts{ [ 2, 3 ] } );
2473Group([ (4,6)(5,7)(8,13)(9,12)(10,15)(11,14),
2474  (1,4,2)(3,5,6)(8,14,10)(9,12,15) ])
2475gap> ccl:= List( ConjugacyClasses( g7 ), Representative );;
2476gap> SortParallel( List( ccl, Order ), ccl );
2477gap> List( ccl, Order );
2478[ 1, 2, 3, 4, 7, 7 ]
2479gap> Size( ConjugacyClass( g7, ccl[3] ) );
248056
2481gap> prop:= List( ccl,
2482>                 r -> RatioOfNongenerationTransPermGroup( g7, ccl[3], r ) );
2483[ 1, 5/7, 19/28, 2/7, 1/4, 1/4 ]
2484gap> Minimum( prop );
24851/4
2486gap> x:= g7.1;
2487(3,4)(6,7)
2488gap> fix:= Difference( MovedPoints( g7 ), MovedPoints( x ) );
2489[ 1, 2, 5 ]
2490gap> orb:= Orbit( g7, fix, OnSets );
2491[ [ 1, 2, 5 ], [ 1, 3, 4 ], [ 2, 3, 6 ], [ 2, 4, 7 ], [ 1, 6, 7 ],
2492  [ 3, 5, 7 ], [ 4, 5, 6 ] ]
2493gap> Union( orb{ [ 1, 2, 5 ] } ) = [ 1 .. 7 ];
2494true
2495gap> three:= g8.2;
2496(1,7,3)(2,5,8)
2497gap> fix:= Difference( MovedPoints( g8 ), MovedPoints( three ) );
2498[ 4, 6 ]
2499gap> orb:= Orbit( g8, fix, OnSets );;
2500gap> QuadrupleWithProperty( [ [ fix ], orb, orb, orb ],
2501>        list -> Union( list ) = [ 1 .. 8 ] );
2502[ [ 4, 6 ], [ 1, 7 ], [ 3, 8 ], [ 2, 5 ] ]
2503gap> x:= g15.1;
2504(4,6)(5,7)(8,13)(9,12)(10,15)(11,14)
2505gap> fixx:= Difference( MovedPoints( g15 ), MovedPoints( x ) );
2506[ 1, 2, 3 ]
2507gap> orbx:= Orbit( g15, fixx, OnSets );
2508[ [ 1, 2, 3 ], [ 1, 4, 5 ], [ 1, 6, 7 ], [ 2, 4, 6 ], [ 3, 4, 7 ],
2509  [ 3, 5, 6 ], [ 2, 5, 7 ] ]
2510gap> y:= g15.2;
2511(1,4,2)(3,5,6)(8,14,10)(9,12,15)
2512gap> fixy:= Difference( MovedPoints( g15 ), MovedPoints( y ) );
2513[ 7, 11, 13 ]
2514gap> orby:= Orbit( g15, fixy, OnSets );;
2515gap> QuadrupleWithProperty( [ [ fixy ], orby, orby, orby ],
2516>        l -> Difference( [ 1 .. 15 ], Union( l ) ) in orbx );
2517[ [ 7, 11, 13 ], [ 5, 8, 14 ], [ 1, 10, 15 ], [ 3, 9, 12 ] ]
2518gap> ResetGlobalRandomNumberGenerators();
2519gap> repeat s:= Random( g14 );
2520>    until Order( s ) = 4;
2521gap> s;
2522(2,3,5,4)(6,7)(8,9)(11,12,14,13)
2523gap> fixs:= Difference( MovedPoints( g14 ), MovedPoints( s ) );
2524[ 1, 10 ]
2525gap> orbs:= Orbit( g14, fixs, OnSets );;
2526gap> Length( orbs );
252721
2528gap> three:= g14.2;
2529(1,3,2)(4,6,5)(8,11,9)(10,12,13)
2530gap> fix:= Difference( MovedPoints( g14 ), MovedPoints( three ) );
2531[ 7, 14 ]
2532gap> orb:= Orbit( g14, fix, OnSets );;
2533gap> Length( orb );
253428
2535gap> QuadrupleWithProperty( [ [ fix ], orb, orb, orb ],
2536>        l -> ForAll( orbs, o -> not IsEmpty( Intersection( o,
2537>                        Union( l ) ) ) ) );
2538fail
2539gap> t:= CharacterTable( "M11" );;
2540gap> ProbGenInfoSimple( t );
2541[ "M11", 1/3, 2, [ "11A" ], [ 1 ] ]
2542gap> OrdersClassRepresentatives( t );
2543[ 1, 2, 3, 4, 5, 6, 8, 8, 11, 11 ]
2544gap> PrimitivePermutationCharacters( t );
2545[ Character( CharacterTable( "M11" ), [ 11, 3, 2, 3, 1, 0, 1, 1, 0, 0 ] ),
2546  Character( CharacterTable( "M11" ), [ 12, 4, 3, 0, 2, 1, 0, 0, 1, 1 ] ),
2547  Character( CharacterTable( "M11" ), [ 55, 7, 1, 3, 0, 1, 1, 1, 0, 0 ] ),
2548  Character( CharacterTable( "M11" ), [ 66, 10, 3, 2, 1, 1, 0, 0, 0, 0 ] ),
2549  Character( CharacterTable( "M11" ), [ 165, 13, 3, 1, 0, 1, 1, 1, 0, 0 ] ) ]
2550gap> Maxes( t );
2551[ "A6.2_3", "L2(11)", "3^2:Q8.2", "A5.2", "2.S4" ]
2552gap> gens11:= OneAtlasGeneratingSet( "M11", NrMovedPoints, 11 );
2553rec( charactername := "1a+10a",
2554  generators := [ (2,10)(4,11)(5,7)(8,9), (1,4,3,8)(2,5,6,9) ],
2555  groupname := "M11", id := "",
2556  identifier := [ "M11", [ "M11G1-p11B0.m1", "M11G1-p11B0.m2" ], 1, 11 ],
2557  isPrimitive := true, maxnr := 1, p := 11, rankAction := 2,
2558  repname := "M11G1-p11B0", repnr := 1, size := 7920, stabilizer := "A6.2_3",
2559  standardization := 1, transitivity := 4, type := "perm" )
2560gap> g11:= GroupWithGenerators( gens11.generators );;
2561gap> gens12:= OneAtlasGeneratingSet( "M11", NrMovedPoints, 12 );;
2562gap> g12:= GroupWithGenerators( gens12.generators );;
2563gap> g23:= DiagonalProductOfPermGroups( [ g11, g12 ] );
2564Group([ (2,10)(4,11)(5,7)(8,9)(12,17)(13,20)(16,18)(19,21),
2565  (1,4,3,8)(2,5,6,9)(12,17,18,15)(13,19)(14,20)(16,22,23,21) ])
2566gap> inv:= g11.1;
2567(2,10)(4,11)(5,7)(8,9)
2568gap> ccl:= List( ConjugacyClasses( g11 ), Representative );;
2569gap> SortParallel( List( ccl, Order ), ccl );
2570gap> List( ccl, Order );
2571[ 1, 2, 3, 4, 5, 6, 8, 8, 11, 11 ]
2572gap> Size( ConjugacyClass( g11, inv ) );
2573165
2574gap> prop:= List( ccl,
2575>                 r -> RatioOfNongenerationTransPermGroup( g11, inv, r ) );
2576[ 1, 1, 1, 149/165, 25/33, 31/55, 23/55, 23/55, 1/3, 1/3 ]
2577gap> Minimum( prop );
25781/3
2579gap> inv:= g12.1;
2580(1,6)(2,9)(5,7)(8,10)
2581gap> moved:= MovedPoints( inv );
2582[ 1, 2, 5, 6, 7, 8, 9, 10 ]
2583gap> orb12:= Orbit( g12, moved, OnSets );;
2584gap> Length( orb12 );
2585165
2586gap> TripleWithProperty( [ orb12{[1]}, orb12, orb12 ],
2587>        list -> IsEmpty( Intersection( list ) ) );
2588fail
2589gap> inv:= g23.1;
2590(2,10)(4,11)(5,7)(8,9)(12,17)(13,20)(16,18)(19,21)
2591gap> moved:= MovedPoints( inv );
2592[ 2, 4, 5, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 ]
2593gap> orb23:= Orbit( g23, moved, OnSets );;
2594gap> three:= ( g23.1*g23.2^2 )^2;
2595(2,6,10)(4,8,7)(5,9,11)(12,17,23)(15,18,16)(19,21,22)
2596gap> movedthree:= MovedPoints( three );;
2597gap> QuadrupleWithProperty( [ [ movedthree ], orb23, orb23, orb23 ],
2598>        list -> IsEmpty( Intersection( list ) ) );
2599[ [ 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 17, 18, 19, 21, 22, 23 ],
2600  [ 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21 ],
2601  [ 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 18, 19, 20, 23 ],
2602  [ 1, 2, 3, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 20, 22, 23 ] ]
2603gap> t:= CharacterTable( "M12" );;
2604gap> ProbGenInfoSimple( t );
2605[ "M12", 1/3, 2, [ "10A" ], [ 3 ] ]
2606gap> spos:= Position( OrdersClassRepresentatives( t ), 10 );
260713
2608gap> prim:= PrimitivePermutationCharacters( t );;
2609gap> List( prim, x -> x{ [ 1, spos ] } );
2610[ [ 12, 0 ], [ 12, 0 ], [ 66, 1 ], [ 66, 1 ], [ 144, 0 ], [ 220, 0 ],
2611  [ 220, 0 ], [ 396, 1 ], [ 495, 0 ], [ 495, 0 ], [ 1320, 0 ] ]
2612gap> Maxes( t );
2613[ "M11", "M12M2", "A6.2^2", "M12M4", "L2(11)", "3^2.2.S4", "M12M7", "2xS5",
2614  "M8.S4", "4^2:D12", "A4xS3" ]
2615gap> g:= MathieuGroup( 12 );
2616Group([ (1,2,3,4,5,6,7,8,9,10,11), (3,7,11,8)(4,10,5,6),
2617  (1,12)(2,11)(3,6)(4,8)(5,9)(7,10) ])
2618gap> approx:= ApproxP( prim, spos );
2619[ 0, 3/11, 1/3, 1/11, 1/132, 13/99, 13/99, 13/396, 1/132, 1/33, 1/33, 1/33,
2620  13/396, 0, 0 ]
2621gap> 2B:= g.2^2;
2622(3,11)(4,5)(6,10)(7,8)
2623gap> Size( ConjugacyClass( g, 2B ) );
2624495
2625gap> ResetGlobalRandomNumberGenerators();
2626gap> repeat s:= Random( g );
2627>    until Order( s ) = 10;
2628gap> prop:= RatioOfNongenerationTransPermGroup( g, 2B, s );
262931/99
2630gap> Filtered( approx, x -> x >= prop );
2631[ 1/3 ]
2632gap> x:= g.2^2;
2633(3,11)(4,5)(6,10)(7,8)
2634gap> ccl:= List( ConjugacyClasses( g ), Representative );;
2635gap> SortParallel( List( ccl, Order ), ccl );
2636gap> prop:= List( ccl, r -> RatioOfNongenerationTransPermGroup( g, x, r ) );
2637[ 1, 1, 1, 1, 39/55, 1, 1, 29/33, 7/55, 43/55, 383/495, 383/495, 31/99, 5/9,
2638  5/9 ]
2639gap> bad:= Filtered( prop, x -> x < 31/99 );
2640[ 7/55 ]
2641gap> pos:= Position( prop, bad[1] );;
2642gap> [ Order( ccl[ pos ] ), NrMovedPoints( ccl[ pos ] ) ];
2643[ 6, 12 ]
2644gap> x:= g.3;
2645(1,12)(2,11)(3,6)(4,8)(5,9)(7,10)
2646gap> s:= ccl[ pos ];;
2647gap> prop:= RatioOfNongenerationTransPermGroup( g, x, s );
264817/33
2649gap> prop > 31/99;
2650true
2651gap> t:= CharacterTable( "O7(3)" );;
2652gap> someprim:= [];;
2653gap> pi:= PossiblePermutationCharacters(
2654>             CharacterTable( "2.U4(3).2_2" ), t );;  Length( pi );
26551
2656gap> Append( someprim, pi );
2657gap> pi:= PermChars( t, rec( torso:= [ 364 ] ) );;  Length( pi );
26581
2659gap> Append( someprim, pi );
2660gap> pi:= PossiblePermutationCharacters(
2661>             CharacterTable( "L4(3).2_2" ), t );;  Length( pi );
26621
2663gap> Append( someprim, pi );
2664gap> pi:= PossiblePermutationCharacters( CharacterTable( "G2(3)" ), t );
2665[ Character( CharacterTable( "O7(3)" ), [ 1080, 0, 0, 24, 108, 0, 0, 0, 27,
2666      18, 9, 0, 12, 4, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 3, 6, 0, 3,
2667      2, 2, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 4, 0, 3, 0, 1, 1, 0, 0, 0, 0, 0,
2668      0, 0 ] ), Character( CharacterTable( "O7(3)" ),
2669    [ 1080, 0, 0, 24, 108, 0, 0, 27, 0, 18, 9, 0, 12, 4, 0, 0, 0, 0, 0, 0, 0,
2670      0, 12, 0, 0, 0, 0, 3, 0, 0, 6, 3, 2, 2, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0,
2671      0, 4, 3, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0 ] ) ]
2672gap> Append( someprim, pi );
2673gap> pi:= PermChars( t, rec( torso:= [ 1120 ] ) );;  Length( pi );
26741
2675gap> Append( someprim, pi );
2676gap> pi:= PossiblePermutationCharacters( CharacterTable( "S6(2)" ), t );
2677[ Character( CharacterTable( "O7(3)" ), [ 3159, 567, 135, 39, 0, 81, 0, 0,
2678      27, 27, 0, 15, 3, 3, 7, 4, 0, 27, 0, 0, 0, 0, 0, 9, 3, 0, 9, 0, 3, 9,
2679      3, 0, 2, 1, 1, 0, 0, 0, 3, 0, 2, 0, 0, 0, 3, 0, 0, 3, 1, 0, 0, 0, 1, 0,
2680      0, 0, 0, 0 ] ), Character( CharacterTable( "O7(3)" ),
2681    [ 3159, 567, 135, 39, 0, 81, 0, 27, 0, 27, 0, 15, 3, 3, 7, 4, 0, 27, 0,
2682      0, 0, 0, 0, 9, 3, 0, 9, 3, 0, 3, 9, 0, 2, 1, 1, 0, 0, 3, 0, 0, 2, 0, 0,
2683      0, 3, 0, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0 ] ) ]
2684gap> Append( someprim, pi );
2685gap> pi:= PossiblePermutationCharacters( CharacterTable( "S9" ), t );
2686[ Character( CharacterTable( "O7(3)" ), [ 12636, 1296, 216, 84, 0, 81, 0, 0,
2687      108, 27, 0, 6, 0, 12, 10, 1, 0, 27, 0, 0, 0, 0, 0, 9, 3, 0, 9, 0, 12,
2688      9, 3, 0, 1, 0, 2, 0, 0, 0, 3, 1, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 1, 1,
2689      0, 0, 0, 0, 1 ] ), Character( CharacterTable( "O7(3)" ),
2690    [ 12636, 1296, 216, 84, 0, 81, 0, 108, 0, 27, 0, 6, 0, 12, 10, 1, 0, 27,
2691      0, 0, 0, 0, 0, 9, 3, 0, 9, 12, 0, 3, 9, 0, 1, 0, 2, 0, 0, 3, 0, 1, 1,
2692      0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1 ] ) ]
2693gap> Append( someprim, pi );
2694gap> t2:= CharacterTable( "O7(3).2" );;
2695gap> s2:= CharacterTable( "Dihedral", 8 ) * CharacterTable( "U4(2).2" );
2696CharacterTable( "Dihedral(8)xU4(2).2" )
2697gap> pi:= PossiblePermutationCharacters( s2, t2 );;  Length( pi );
26981
2699gap> pi:= RestrictedClassFunctions( pi, t );;
2700gap> Append( someprim, pi );
2701gap> pi:= PossiblePermutationCharacters(
2702>             CharacterTable( "2^6:A7" ), t );;  Length( pi );
27031
2704gap> Append( someprim, pi );
2705gap> List( someprim, x -> x[1] );
2706[ 351, 364, 378, 1080, 1080, 1120, 3159, 3159, 12636, 12636, 22113, 28431 ]
2707gap> cl:= PositionsProperty( AtlasClassNames( t ),
2708>                            x -> x in [ "3D", "3E" ] );
2709[ 8, 9 ]
2710gap> List( Filtered( someprim, x -> x[1] = 12636 ), pi -> pi{ cl } );
2711[ [ 0, 108 ], [ 108, 0 ] ]
2712gap> GetFusionMap( t, t2 ){ cl };
2713[ 8, 8 ]
2714gap> spos:= Position( OrdersClassRepresentatives( t ), 14 );
271552
2716gap> Maximum( ApproxP( someprim, spos ) );
2717199/351
2718gap> approx:= List( [ 1 .. NrConjugacyClasses( t ) ],
2719>       i -> Maximum( ApproxP( someprim, i ) ) );;
2720gap> PositionsProperty( approx, x -> x <= 199/351 );
2721[ 52 ]
2722gap> pos:= PositionsProperty( someprim, x -> x[ spos ] <> 0 );
2723[ 1, 9, 10 ]
2724gap> List( someprim{ pos }, x -> x{ [ 1, spos ] } );
2725[ [ 351, 1 ], [ 12636, 1 ], [ 12636, 1 ] ]
2726gap> so73:= SpecialOrthogonalGroup( 7, 3 );;
2727gap> o73:= DerivedSubgroup( so73 );;
2728gap> orbs:= Orbits( o73, Elements( GF(3)^7 ) );;
2729gap> Set( List( orbs, Length ) );
2730[ 1, 702, 728, 756 ]
2731gap> g:= Action( o73, First( orbs, x -> Length( x ) = 702 ) );;
2732gap> Size( g ) = Size( t );
2733true
2734gap> ResetGlobalRandomNumberGenerators();
2735gap> repeat s:= Random( g );
2736>    until Order( s ) = 14;
2737gap> 2A:= s^7;;
2738gap> bad:= RatioOfNongenerationTransPermGroup( g, 2A, s );
2739155/351
2740gap> bad > 1/3;
2741true
2742gap> approx:= ApproxP( someprim, spos );;
2743gap> PositionsProperty( approx, x -> x >= 1/3 );
2744[ 2 ]
2745gap> consider:= RepresentativesMaximallyCyclicSubgroups( t );
2746[ 18, 19, 25, 26, 27, 30, 31, 32, 34, 35, 38, 39, 41, 42, 43, 44, 45, 46, 47,
2747  48, 49, 50, 52, 53, 54, 56, 57, 58 ]
2748gap> Length( consider );
274928
2750gap> consider:= ClassesPerhapsCorrespondingToTableColumns( g, t, consider );;
2751gap> Length( consider );
275231
2753gap> consider:= List( consider, Representative );;
2754gap> SortParallel( List( consider, Order ), consider );
2755gap> app2A:= List( consider, c ->
2756>       RatioOfNongenerationTransPermGroup( g, 2A, c ) );
2757[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 85/117, 1, 10/13, 10/13, 1, 1, 23/39, 23/39, 1,
2758  1, 1, 1, 1, 1/3, 1/3, 155/351, 67/117, 1, 1, 1, 1, 191/351 ]
2759gap> test:= PositionsProperty( app2A, x -> x <= 155/351 );
2760[ 23, 24, 25 ]
2761gap> List( test, i -> Order( consider[i] ) );
2762[ 13, 13, 14 ]
2763gap> C3A:= First( ConjugacyClasses( g ),
2764>               c -> Order( Representative( c ) ) = 3 and Size( c ) = 7280 );;
2765gap> repeat ss:= Random( g );
2766>    until Order( ss ) = 13;
2767gap> bad:= RatioOfNongenerationTransPermGroup( g, Representative( C3A ), ss );
276817/35
2769gap> bad > 155/351;
2770true
2771gap> approx:= ApproxP( someprim, spos );;
2772gap> max:= Maximum( approx{ [ 3 .. Length( approx ) ] } );
277359/351
2774gap> 155 + 2*59 < 351;
2775true
2776gap> third:= PositionsProperty( approx, x -> 2 * 155/351 + x >= 1 );
2777[ 2, 3, 6 ]
2778gap> ClassNames( t ){ third };
2779[ "2a", "2b", "3b" ]
2780gap> ord20:= PositionsProperty( OrdersClassRepresentatives( t ),
2781>                               x -> x = 20 );
2782[ 58 ]
2783gap> PowerMap( t, 10 ){ ord20 };
2784[ 3 ]
2785gap> repeat x:= Random( g );
2786>    until Order( x ) = 20;
2787gap> 2B:= x^10;;
2788gap> C2B:= ConjugacyClass( g, 2B );;
2789gap> ord15:= PositionsProperty( OrdersClassRepresentatives( t ),
2790>                               x -> x = 15 );
2791[ 53 ]
2792gap> PowerMap( t, 10 ){ ord15 };
2793[ 6 ]
2794gap> repeat x:= Random( g );
2795>    until Order( x ) = 15;
2796gap> 3B:= x^5;;
2797gap> C3B:= ConjugacyClass( g, 3B );;
2798gap> repeat s:= Random( g );
2799>    until Order( s ) = 14;
2800gap> RandomCheckUniformSpread( g, [ 2A, 2A, 2A ], s, 50 );
2801true
2802gap> RandomCheckUniformSpread( g, [ 2B, 2A, 2A ], s, 50 );
2803true
2804gap> RandomCheckUniformSpread( g, [ 3B, 2A, 2A ], s, 50 );
2805true
2806gap> prim:= someprim{ [ 1 ] };
2807[ Character( CharacterTable( "O7(3)" ), [ 351, 127, 47, 15, 27, 45, 36, 0, 0,
2808      9, 0, 15, 3, 3, 7, 6, 19, 19, 10, 11, 12, 8, 3, 5, 3, 6, 1, 0, 0, 3, 3,
2809      0, 1, 1, 1, 6, 3, 0, 0, 2, 2, 0, 3, 0, 3, 3, 0, 0, 1, 0, 0, 1, 0, 4, 4,
2810      1, 2, 0 ] ) ]
2811gap> spos:= Position( AtlasClassNames( t ), "14A" );;
2812gap> t2:= CharacterTable( "O7(3).2" );;
2813gap> map:= InverseMap( GetFusionMap( t, t2 ) );;
2814gap> torso:= List( prim, pi -> CompositionMaps( pi, map ) );;
2815gap> ext:= List( torso, x -> PermChars( t2, rec( torso:= x ) ) );
2816[ [ Character( CharacterTable( "O7(3).2" ), [ 351, 127, 47, 15, 27, 45, 36,
2817          0, 9, 0, 15, 3, 3, 7, 6, 19, 19, 10, 11, 12, 8, 3, 5, 3, 6, 1, 0,
2818          3, 0, 1, 1, 1, 6, 3, 0, 2, 2, 0, 3, 0, 3, 3, 0, 1, 0, 0, 1, 0, 4,
2819          1, 2, 0, 117, 37, 21, 45, 1, 13, 5, 1, 9, 9, 18, 15, 1, 7, 9, 6, 4,
2820          0, 3, 0, 3, 3, 6, 2, 2, 9, 6, 1, 3, 1, 4, 1, 2, 1, 1, 0, 3, 1, 0,
2821          0, 0, 0, 1, 1, 0, 0 ] ) ] ]
2822gap> approx:= ApproxP( Concatenation( ext ),
2823>        Position( AtlasClassNames( t2 ), "14A" ) );;
2824gap> Maximum( approx{ Difference(
2825>      PositionsProperty( OrdersClassRepresentatives( t2 ), IsPrimeInt ),
2826>      ClassPositionsOfDerivedSubgroup( t2 ) ) } );
28271/3
2828gap> t:= CharacterTable( "O8+(2)" );;
2829gap> ProbGenInfoSimple( t );
2830[ "O8+(2)", 334/315, 0, [ "15A", "15B", "15C" ], [ 7, 7, 7 ] ]
2831gap> prim:= PrimitivePermutationCharacters( t );;
2832gap> spos:= Position( OrdersClassRepresentatives( t ), 15 );;
2833gap> List( Filtered( prim, x -> x[ spos ] <> 0 ), l -> l{ [ 1, spos ] } );
2834[ [ 120, 1 ], [ 135, 2 ], [ 960, 2 ], [ 1120, 1 ], [ 12096, 1 ] ]
2835gap> matgroup:= DerivedSubgroup( GeneralOrthogonalGroup( 1, 8, 2 ) );;
2836gap> points:= NormedRowVectors( GF(2)^8 );;
2837gap> orbs:= Orbits( matgroup, points );;
2838gap> List( orbs, Length );
2839[ 135, 120 ]
2840gap> g:= Action( matgroup, orbs[2] );;
2841gap> Size( g );
2842174182400
2843gap> pi:= Sum( Irr( t ){ [ 1, 3, 7 ] } );
2844Character( CharacterTable( "O8+(2)" ), [ 120, 24, 32, 0, 0, 8, 36, 0, 0, 3,
2845  6, 12, 4, 8, 0, 0, 0, 10, 0, 0, 12, 0, 0, 8, 0, 0, 3, 6, 0, 0, 2, 0, 0, 2,
2846  1, 2, 2, 3, 0, 0, 2, 0, 0, 0, 0, 0, 3, 2, 0, 0, 1, 0, 0 ] )
2847gap> approx:= ApproxP( prim, spos );;
2848gap> testpos:= PositionsProperty( approx, x -> x >= 1/3 );
2849[ 2, 3, 7 ]
2850gap> AtlasClassNames( t ){ testpos };
2851[ "2A", "2B", "3A" ]
2852gap> approx{ testpos };
2853[ 254/315, 334/315, 1093/1120 ]
2854gap> ForAll( approx{ testpos }, x -> x > 1/2 );
2855true
2856gap> ResetGlobalRandomNumberGenerators();
2857gap> repeat s:= Random( g );
2858>    until Order( s ) = 15 and NrMovedPoints( g ) = 1 + NrMovedPoints( s );
2859gap> 3A:= s^5;;
2860gap> repeat x:= Random( g ); until Order( x ) = 8;
2861gap> 2A:= x^4;;
2862gap> repeat x:= Random( g ); until Order( x ) = 12 and
2863>      NrMovedPoints( g ) = 32 + NrMovedPoints( x^6 );
2864gap> 2B:= x^6;;
2865gap> prop15A:= List( [ 2A, 2B, 3A ],
2866>                    x -> RatioOfNongenerationTransPermGroup( g, x, s ) );
2867[ 23/35, 29/42, 149/224 ]
2868gap> Maximum( prop15A );
286929/42
2870gap> test:= List( [ 2A, 2B, 3A ], x -> ConjugacyClass( g, x ) );;
2871gap> ccl:= ConjugacyClasses( g );;
2872gap> consider:= Filtered( ccl, c -> Size( c ) in List( test, Size ) );;
2873gap> Length( consider );
28747
2875gap> filt:= Filtered( ccl, c -> ForAll( consider, cc ->
2876>       RatioOfNongenerationTransPermGroup( g, Representative( cc ),
2877>           Representative( c ) ) <= 29/42 ) );;
2878gap> Length( filt );
28793
2880gap> List( filt, c -> Order( Representative( c ) ) );
2881[ 15, 15, 15 ]
2882gap> SizesConjugacyClasses( t );
2883[ 1, 1575, 3780, 3780, 3780, 56700, 2240, 2240, 2240, 89600, 268800, 37800,
2884  340200, 907200, 907200, 907200, 2721600, 580608, 580608, 580608, 100800,
2885  100800, 100800, 604800, 604800, 604800, 806400, 806400, 806400, 806400,
2886  2419200, 2419200, 2419200, 7257600, 24883200, 5443200, 5443200, 6451200,
2887  6451200, 6451200, 8709120, 8709120, 8709120, 1209600, 1209600, 1209600,
2888  4838400, 7257600, 7257600, 7257600, 11612160, 11612160, 11612160 ]
2889gap> NrPolyhedralSubgroups( t, 2, 2, 2 );
2890rec( number := 14175, type := "V4" )
2891gap> repeat x:= Random( g );
2892>    until     Order( x ) mod 2 = 0
2893>          and NrMovedPoints( x^( Order(x)/2 ) ) = 120 - 24;
2894gap> x:= x^( Order(x)/2 );;
2895gap> repeat y:= x^Random( g );
2896>    until NrMovedPoints( x*y ) = 120 - 24;
2897gap> v4:= SubgroupNC( g, [ x, y ] );;
2898gap> n:= Normalizer( g, v4 );;
2899gap> Index( g, n );
290014175
2901gap> maxorder:= RepresentativesMaximallyCyclicSubgroups( t );;
2902gap> maxorderreps:= List( ClassesPerhapsCorrespondingToTableColumns( g, t,
2903>        maxorder ), Representative );;
2904gap> Length( maxorderreps );
290528
2906gap> CommonGeneratorWithGivenElements( g, maxorderreps, [ x, y, x*y ] );
2907fail
2908gap> reps:= List( ccl, Representative );;
2909gap> bading:= List( testpos, i -> Filtered( reps,
2910>        r -> Order( r ) = OrdersClassRepresentatives( t )[i] and
2911>             NrMovedPoints( r ) = 120 - pi[i] ) );;
2912gap> List( bading, Length );
2913[ 1, 1, 1 ]
2914gap> bading:= List( bading, x -> x[1] );;
2915gap> for pair in UnorderedTuples( bading, 2 ) do
2916>      test:= RandomCheckUniformSpread( g, pair, s, 80 );
2917>      if test <> true then
2918>        Error( test );
2919>      fi;
2920>    od;
2921gap> matgrp:= SO(1,8,2);;
2922gap> g2:= Image( IsomorphismPermGroup( matgrp ) );;
2923gap> IsTransitive( g2, MovedPoints( g2 ) );
2924true
2925gap> repeat x:= Random( g2 ); until Order( x ) = 14;
2926gap> 2F:= x^7;;
2927gap> Size( ConjugacyClass( g2, 2F ) );
2928120
2929gap> der:= DerivedSubgroup( g2 );;
2930gap> cclreps:= List( ConjugacyClasses( der ), Representative );;
2931gap> nongen:= List( cclreps,
2932>               x -> RatioOfNongenerationTransPermGroup( g2, 2F, x ) );;
2933gap> goodpos:= PositionsProperty( nongen, x -> x < 1 );;
2934gap> invariants:= List( goodpos, i -> [ Order( cclreps[i] ),
2935>      Size( Centralizer( g2, cclreps[i] ) ), nongen[i] ] );;
2936gap> SortedList( invariants );
2937[ [ 10, 20, 1/3 ], [ 10, 20, 1/3 ], [ 12, 24, 2/5 ], [ 12, 24, 2/5 ],
2938  [ 15, 15, 0 ], [ 15, 15, 0 ] ]
2939gap> aut:= Group( AtlasGenerators( "Fi22", 1, 4 ).generators );;
2940gap> Size( aut ) = 6 * Size( t );
2941true
2942gap> g3:= DerivedSubgroup( aut );;
2943gap> orbs:= Orbits( g3, MovedPoints( g3 ) );;
2944gap> List( orbs, Length );
2945[ 3150, 360 ]
2946gap> g3:= Action( g3, orbs[2] );;
2947gap> repeat s:= Random( g3 ); until Order( s ) = 15;
2948gap> repeat x:= Random( g3 ); until Order( x ) = 21;
2949gap> 3F:= x^7;;
2950gap> RatioOfNongenerationTransPermGroup( g3, 3F, s );
29510
2952gap> repeat x:= Random( g3 );
2953>    until Order( x ) = 12 and Size( Centralizer( g3, x^4 ) ) = 648;
2954gap> 3G:= x^4;;
2955gap> RatioOfNongenerationTransPermGroup( g3, 3G, s );
29560
2957gap> t2:= CharacterTable( "O8+(2).2" );;
2958gap> s:= CharacterTable( "S6(2)" ) * CharacterTable( "Cyclic", 2 );;
2959gap> pi:= PossiblePermutationCharacters( s, t2 );;
2960gap> prim:= pi;;
2961gap> pi:= PermChars( t2, rec( torso:= [ 135 ] ) );;
2962gap> Append( prim, pi );
2963gap> pi:= PossiblePermutationCharacters( CharacterTable( "A9.2" ), t2 );;
2964gap> Append( prim, pi );
2965gap> s:= CharacterTable( "Dihedral(6)" ) * CharacterTable( "U4(2).2" );;
2966gap> pi:= PossiblePermutationCharacters( s, t2 );;
2967gap> Append( prim, pi );
2968gap> s:= CharacterTableWreathSymmetric( CharacterTable( "S5" ), 2 );;
2969gap> pi:= PossiblePermutationCharacters( s, t2 );;
2970gap> Append( prim, pi );
2971gap> Length( prim );
29725
2973gap> ord15:= PositionsProperty( OrdersClassRepresentatives( t2 ),
2974>                               x -> x = 15 );
2975[ 39, 40 ]
2976gap> List( prim, pi -> pi{ ord15 } );
2977[ [ 1, 0 ], [ 2, 0 ], [ 2, 0 ], [ 1, 0 ], [ 1, 0 ] ]
2978gap> List( ord15, i -> Maximum( ApproxP( prim, i ) ) );
2979[ 307/120, 0 ]
2980gap> CleanWorkspace();
2981gap> t:= CharacterTable( "O8+(3)" );;
2982gap> ProbGenInfoSimple( t );
2983[ "O8+(3)", 863/1820, 2, [ "20A", "20B", "20C" ], [ 8, 8, 8 ] ]
2984gap> prim:= PrimitivePermutationCharacters( t );;
2985gap> ord:= OrdersClassRepresentatives( t );;
2986gap> spos:= Position( ord, 20 );;
2987gap> filt:= PositionsProperty( prim, x -> x[ spos ] <> 0 );
2988[ 1, 2, 7, 15, 18, 19, 24 ]
2989gap> Maxes( t ){ filt };
2990[ "O7(3)", "O8+(3)M2", "3^6:L4(3)", "2.U4(3).(2^2)_{122}", "(A4xU4(2)):2",
2991  "O8+(3)M19", "(A6xA6):2^2" ]
2992gap> prim{ filt }{ [ 1, spos ] };
2993[ [ 1080, 1 ], [ 1080, 1 ], [ 1120, 2 ], [ 189540, 1 ], [ 7960680, 1 ],
2994  [ 7960680, 1 ], [ 9552816, 1 ] ]
2995gap> ord:= OrdersClassRepresentatives( t );;
2996gap> ord20:= PositionsProperty( ord, x -> x = 20 );;
2997gap> cand:= [];;
2998gap> for i in ord20 do
2999>      approx:= ApproxP( prim, i );
3000>      Add( cand, PositionsProperty( approx, x -> x >= 1/3 ) );
3001>    od;
3002gap> cand;
3003[ [ 2, 6, 7, 10 ], [ 3, 6, 8, 11 ], [ 4, 6, 9, 12 ] ]
3004gap> AtlasClassNames( t ){ cand[1] };
3005[ "2A", "3A", "3B", "3E" ]
3006gap> t3:= CharacterTable( "O8+(3).3" );;
3007gap> tfust3:= GetFusionMap( t, t3 );;
3008gap> List( cand, x -> tfust3{ x } );
3009[ [ 2, 4, 5, 6 ], [ 2, 4, 5, 6 ], [ 2, 4, 5, 6 ] ]
3010gap> g:= Action( SO(1,8,3), NormedRowVectors( GF(3)^8 ), OnLines );;
3011gap> Size( g );
30129904359628800
3013gap> g:= DerivedSubgroup( g );;  Size( g );
30144952179814400
3015gap> orbs:= Orbits( g, MovedPoints( g ) );;
3016gap> List( orbs, Length );
3017[ 1080, 1080, 1120 ]
3018gap> g:= Action( g, orbs[1] );;
3019gap> PositionProperty( Irr( t ), chi -> chi[1] = 819 );
30209
3021gap> permchar:= Sum( Irr( t ){ [ 1, 2, 9 ] } );
3022Character( CharacterTable( "O8+(3)" ), [ 1080, 128, 0, 0, 24, 108, 135, 0, 0,
3023  108, 0, 0, 27, 27, 0, 0, 18, 9, 12, 16, 0, 0, 4, 15, 0, 0, 20, 0, 0, 12,
3024  11, 0, 0, 20, 0, 0, 15, 0, 0, 12, 0, 0, 2, 0, 0, 3, 3, 0, 0, 6, 6, 0, 0, 3,
3025  2, 2, 2, 18, 0, 0, 9, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 3, 0, 0, 12, 0, 0, 3,
3026  0, 0, 0, 0, 0, 4, 3, 3, 0, 0, 1, 0, 0, 4, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 3,
3027  0, 0, 2, 0, 0, 5, 0, 0, 1, 0, 0 ] )
3028gap> permchar{ ord20 };
3029[ 1, 0, 0 ]
3030gap> AtlasClassNames( t )[ PowerMap( t, 10 )[ ord20[1] ] ];
3031"2A"
3032gap> ord18:= PositionsProperty( ord, x -> x = 18 );;
3033gap> Set( AtlasClassNames( t ){ PowerMap( t, 6 ){ ord18 } } );
3034[ "3A" ]
3035gap> ord15:= PositionsProperty( ord, x -> x = 15 );;
3036gap> PowerMap( t, 5 ){ ord15 };
3037[ 7, 8, 9, 10, 11, 12 ]
3038gap> AtlasClassNames( t ){ [ 7 .. 12 ] };
3039[ "3B", "3C", "3D", "3E", "3F", "3G" ]
3040gap> permchar{ [ 7 .. 12 ] };
3041[ 135, 0, 0, 108, 0, 0 ]
3042gap> mp:= NrMovedPoints( g );;
3043gap> ResetGlobalRandomNumberGenerators();
3044gap> repeat 20A:= Random( g );
3045>    until Order( 20A ) = 20 and mp - NrMovedPoints( 20A ) = 1;
3046gap> 2A:= 20A^10;;
3047gap> repeat x:= Random( g ); until Order( x ) = 18;
3048gap> 3A:= x^6;;
3049gap> repeat x:= Random( g );
3050>    until Order( x ) = 15 and mp - NrMovedPoints( x^5 ) = 135;
3051gap> 3B:= x^5;;
3052gap> repeat x:= Random( g );
3053>    until Order( x ) = 15 and mp - NrMovedPoints( x^5 ) = 108;
3054gap> 3E:= x^5;;
3055gap> nongen:= List( [ 2A, 3A, 3B, 3E ],
3056>                   c -> RatioOfNongenerationTransPermGroup( g, c, 20A ) );
3057[ 3901/9477, 194/455, 451/1092, 451/1092 ]
3058gap> Maximum( nongen );
3059194/455
3060gap> maxorder:= RepresentativesMaximallyCyclicSubgroups( t );;
3061gap> Length( maxorder );
306257
3063gap> autt:= CharacterTable( "O8+(3).S4" );;
3064gap> fus:= PossibleClassFusions( t, autt );;
3065gap> orbreps:= Set( List( fus, map -> Set( ProjectionMap( map ) ) ) );
3066[ [ 1, 2, 5, 6, 7, 13, 17, 18, 19, 20, 23, 24, 27, 30, 31, 37, 43, 46, 50,
3067      54, 55, 56, 57, 58, 64, 68, 72, 75, 78, 84, 85, 89, 95, 96, 97, 100,
3068      106, 112 ] ]
3069gap> totest:= Intersection( maxorder, orbreps[1] );
3070[ 43, 50, 54, 56, 57, 64, 68, 75, 78, 84, 85, 89, 95, 97, 100, 106, 112 ]
3071gap> Length( totest );
307217
3073gap> AtlasClassNames( t ){ totest };
3074[ "6Q", "6X", "6B1", "8A", "8B", "9G", "9K", "12A", "12D", "12J", "12K",
3075  "12O", "13A", "14A", "15A", "18A", "20A" ]
3076gap> elementstotest:= [];;
3077gap> for elord in [ 13, 14, 15, 18 ] do
3078>      repeat s:= Random( g );
3079>      until Order( s ) = elord;
3080>      Add( elementstotest, s );
3081>    od;
3082gap> ordcent:= [ [ 6, 162 ], [ 9, 729 ], [ 9, 81 ], [ 12, 1728 ],
3083>                [ 12, 432 ], [ 12, 192 ], [ 12, 108 ], [ 12, 72 ] ];;
3084gap> cents:= SizesCentralizers( t );;
3085gap> for pair in ordcent do
3086>      Print( pair, ": ", AtlasClassNames( t ){
3087>          Filtered( [ 1 .. Length( ord ) ],
3088>                    i -> ord[i] = pair[1] and cents[i] = pair[2] ) }, "\n" );
3089>      repeat s:= Random( g );
3090>      until Order( s ) = pair[1] and Size( Centralizer( g, s ) ) = pair[2];
3091>      Add( elementstotest, s );
3092>    od;
3093[ 6, 162 ]: [ "6B1" ]
3094[ 9, 729 ]: [ "9G", "9H", "9I", "9J" ]
3095[ 9, 81 ]: [ "9K", "9L", "9M", "9N" ]
3096[ 12, 1728 ]: [ "12A", "12B", "12C" ]
3097[ 12, 432 ]: [ "12D", "12E", "12F", "12G", "12H", "12I" ]
3098[ 12, 192 ]: [ "12J" ]
3099[ 12, 108 ]: [ "12K", "12L", "12M", "12N" ]
3100[ 12, 72 ]: [ "12O", "12P", "12Q", "12R", "12S", "12T" ]
3101gap> AtlasClassNames( t ){ Filtered( [ 1 .. Length( ord ) ],
3102>        i -> cents[i] = 648 and cents[ PowerMap( t, 2 )[i] ] = 52488
3103>                            and cents[ PowerMap( t, 3 )[i] ] = 26127360 ) };
3104[ "6Q", "6R", "6S" ]
3105gap> repeat s:= Random( g );
3106>    until Order( s ) = 6 and Size( Centralizer( g, s ) ) = 648
3107>      and Size( Centralizer( g, s^2 ) ) = 52488
3108>      and Size( Centralizer( g, s^3 ) ) = 26127360;
3109gap> Add( elementstotest, s );
3110gap> AtlasClassNames( t ){ Filtered( [ 1 .. Length( ord ) ],
3111>        i -> cents[i] = 648 and cents[ PowerMap( t, 2 )[i] ] = 52488
3112>                            and cents[ PowerMap( t, 3 )[i] ] = 331776 ) };
3113[ "6X", "6Y", "6Z", "6A1" ]
3114gap> repeat s:= Random( g );
3115>    until Order( s ) = 6 and Size( Centralizer( g, s ) ) = 648
3116>      and Size( Centralizer( g, s^2 ) ) = 52488
3117>      and Size( Centralizer( g, s^3 ) ) = 331776;
3118gap> Add( elementstotest, s );
3119gap> AtlasClassNames( t ){ Filtered( [ 1 .. Length( ord ) ],
3120>        i -> ord[i] = 8 and cents[ PowerMap( t, 2 )[i] ] = 13824 ) };
3121[ "8A" ]
3122gap> repeat s:= Random( g );
3123>    until Order( s ) = 8 and Size( Centralizer( g, s^2 ) ) = 13824;
3124gap> Add( elementstotest, s );
3125gap> AtlasClassNames( t ){ Filtered( [ 1 .. Length( ord ) ],
3126>        i -> ord[i] = 8 and cents[ PowerMap( t, 2 )[i] ] = 1536 ) };
3127[ "8B" ]
3128gap> repeat s:= Random( g );
3129>    until Order( s ) = 8 and Size( Centralizer( g, s^2 ) ) = 1536;
3130gap> Add( elementstotest, s );
3131gap> nongen:= List( elementstotest,
3132>                   s -> RatioOfNongenerationTransPermGroup( g, 3A, s ) );;
3133gap> smaller:= PositionsProperty( nongen, x -> x < 194/455 );
3134[ 2, 3 ]
3135gap> nongen{ smaller };
3136[ 127/325, 1453/3640 ]
3137gap> repeat s:= Random( g );
3138>    until Order( s ) = 14 and NrMovedPoints( s ) = 1078;
3139gap> 2A:= s^7;;
3140gap> nongen:= RatioOfNongenerationTransPermGroup( g, 2A, s );
31411573/3645
3142gap> nongen > 194/455;
3143true
3144gap> repeat s:= Random( g );
3145>    until Order( s ) = 15 and NrMovedPoints( s ) = 1080 - 3;
3146gap> nongen:= RatioOfNongenerationTransPermGroup( g, 2A, s );
3147490/1053
3148gap> nongen > 194/455;
3149true
3150gap> for tup in UnorderedTuples( [ 2A, 3A, 3B, 3E ], 3 ) do
3151>      cl:= ShallowCopy( tup );
3152>      test:= RandomCheckUniformSpread( g, cl, 20A, 100 );
3153>      if test <> true then
3154>        Error( test );
3155>      fi;
3156>    od;
3157gap> der:= DerivedSubgroup( SO(1,8,3) );;
3158gap> repeat x:= PseudoRandom( der ); until Order( x ) = 40;
3159gap> 40 in ord;
3160false
3161gap> u42:= CharacterTable( "U4(2)" );;
3162gap> Filtered( OrdersClassRepresentatives( u42 ), x -> x mod 5 = 0 );
3163[ 5 ]
3164gap> u:= CharacterTable( Maxes( t )[18] );
3165CharacterTable( "(A4xU4(2)):2" )
3166gap> 2u42:= CharacterTable( "2.U4(2)" );;
3167gap> OrdersClassRepresentatives( 2u42 )[4];
31684
3169gap> GetFusionMap( 2u42, u42 )[4];
31703
3171gap> OrdersClassRepresentatives( u42 )[3];
31722
3173gap> List( PossibleClassFusions( u42, u ), x -> x[3] );
3174[ 8 ]
3175gap> PositionsProperty( SizesConjugacyClasses( u ), x -> x = 3 );
3176[ 2 ]
3177gap> ForAll( PossibleClassFusions( u, t ), x -> x[2] = x[8] );
3178true
3179gap> u:= CharacterTable( Maxes( t )[24] );
3180CharacterTable( "(A6xA6):2^2" )
3181gap> ClassPositionsOfDerivedSubgroup( u );
3182[ 1 .. 22 ]
3183gap> PositionsProperty( OrdersClassRepresentatives( u ), x -> x = 20 );
3184[ 8 ]
3185gap> List( ClassPositionsOfNormalSubgroups( u ),
3186>          x -> Sum( SizesConjugacyClasses( u ){ x } ) );
3187[ 1, 129600, 259200, 259200, 259200, 518400 ]
3188gap> t2:= CharacterTable( "O8+(3).2_1" );;
3189gap> ord20:= PositionsProperty( OrdersClassRepresentatives( t2 ),
3190>                x -> x = 20 );;
3191gap> ord20:= Intersection( ord20, ClassPositionsOfDerivedSubgroup( t2 ) );
3192[ 84, 85, 86 ]
3193gap> List( ord20, x -> x in PowerMap( t2, 2 ) );
3194[ false, true, true ]
3195gap> tfust2:= GetFusionMap( t, t2 );;
3196gap> tfust2{ PositionsProperty( OrdersClassRepresentatives( t ),
3197>                x -> x = 20 ) };
3198[ 84, 85, 86 ]
3199gap> primt2:= [];;
3200gap> poss:= PossiblePermutationCharacters( CharacterTable( "O7(3)" ), t );;
3201gap> invfus:= InverseMap( tfust2 );;
3202gap> List( poss, pi -> ForAll( CompositionMaps( pi, invfus ), IsInt ) );
3203[ false, false, false, false, true, true ]
3204gap> PossiblePermutationCharacters(
3205>        CharacterTable( "O7(3)" ) * CharacterTable( "Cyclic", 2 ), t2 );
3206[  ]
3207gap> ext:= PossiblePermutationCharacters( CharacterTable( "O7(3).2" ), t2 );;
3208gap> List( ext, pi -> pi{ ord20 } );
3209[ [ 1, 0, 0 ], [ 1, 0, 0 ] ]
3210gap> Append( primt2, ext );
3211gap> ext:= PossiblePermutationCharacters( CharacterTable( "L4(3).2^2" ), t2 );;
3212gap> List( ext, pi -> pi{ ord20 } );
3213[ [ 0, 0, 1 ], [ 0, 1, 0 ] ]
3214gap> Append( primt2, ext );
3215gap> List( PossiblePermutationCharacters( CharacterTable( "L4(3).2_2" ) *
3216>              CharacterTable( "Cyclic", 2 ), t2 ), pi -> pi{ ord20 } );
3217[ [ 1, 0, 0 ] ]
3218gap> ext:= PermChars( t2, rec( torso:= [ 1120 ] ) );;
3219gap> List( ext, pi -> pi{ ord20 } );
3220[ [ 2, 0, 0 ], [ 0, 0, 2 ], [ 0, 2, 0 ] ]
3221gap> Append( primt2, ext );
3222gap> filt:= Filtered( prim, x -> x[1] = 189540 );;
3223gap> cand:= List( filt, x -> CompositionMaps( x, invfus ) );;
3224gap> ext:= Concatenation( List( cand,
3225>              pi -> PermChars( t2, rec( torso:= pi ) ) ) );;
3226gap> List( ext, x -> x{ ord20 } );
3227[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
3228gap> Append( primt2, ext );
3229gap> ext:= PossiblePermutationCharacters( CharacterTable( "Symmetric", 4 ) *
3230>              CharacterTable( "U4(2).2" ), t2 );;
3231gap> List( ext, x -> x{ ord20 } );
3232[ [ 1, 0, 0 ], [ 1, 0, 0 ] ]
3233gap> Append( primt2, ext );
3234gap> filt:= Filtered( prim, x -> x[1] = 9552816 );;
3235gap> cand:= List( filt, x -> CompositionMaps( x, InverseMap( tfust2 ) ));;
3236gap> ext:= Concatenation( List( cand,
3237>              pi -> PermChars( t2, rec( torso:= pi ) ) ) );;
3238gap> List( ext, x -> x{ ord20 } );
3239[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
3240gap> Append( primt2, ext );
3241gap> Length( primt2 );
324215
3243gap> approx:= List( ord20, x -> ApproxP( primt2, x ) );;
3244gap> outer:= Difference(
3245>      PositionsProperty( OrdersClassRepresentatives( t2 ), IsPrimeInt ),
3246>      ClassPositionsOfDerivedSubgroup( t2 ) );;
3247gap> List( approx, l -> Maximum( l{ outer } ) );
3248[ 574/1215, 83/567, 83/567 ]
3249gap> t2:= CharacterTable( "O8+(3).2_2" );;
3250gap> ord20:= PositionsProperty( OrdersClassRepresentatives( t2 ),
3251>                x -> x = 20 );;
3252gap> ord20:= Intersection( ord20, ClassPositionsOfDerivedSubgroup( t2 ) );
3253[ 82, 83 ]
3254gap> tfust2:= GetFusionMap( t, t2 );;
3255gap> tfust2{ PositionsProperty( OrdersClassRepresentatives( t ),
3256>                x -> x = 20 ) };
3257[ 82, 83, 83 ]
3258gap> primt2:= [];;
3259gap> ext:= PermChars( t2, rec( torso:= [ 1080 ] ) );;
3260gap> List( ext, pi -> pi{ ord20 } );
3261[ [ 1, 0 ], [ 1, 0 ] ]
3262gap> Append( primt2, ext );
3263gap> ext:= PermChars( t2, rec( torso:= [ 1120 ] ) );;
3264gap> List( ext, pi -> pi{ ord20 } );
3265[ [ 2, 0 ] ]
3266gap> Append( primt2, ext );
3267gap> filt:= Filtered( prim, x -> x[1] = 189540 );;
3268gap> cand:= List( filt, x -> CompositionMaps( x, InverseMap( tfust2 ) ));;
3269gap> ext:= Concatenation( List( cand,
3270>              pi -> PermChars( t2, rec( torso:= pi ) ) ) );;
3271gap> List( ext, x -> x{ ord20 } );
3272[ [ 1, 0 ] ]
3273gap> Append( primt2, ext );
3274gap> filt:= Filtered( prim, x -> x[1] = 7960680 );;
3275gap> cand:= List( filt, x -> CompositionMaps( x, InverseMap( tfust2 ) ));;
3276gap> ext:= Concatenation( List( cand,
3277>              pi -> PermChars( t2, rec( torso:= pi ) ) ) );;
3278gap> List( ext, x -> x{ ord20 } );
3279[ [ 1, 0 ], [ 1, 0 ] ]
3280gap> Append( primt2, ext );
3281gap> ext:= PossiblePermutationCharacters( CharacterTableWreathSymmetric(
3282>              CharacterTable( "S6" ), 2 ), t2 );;
3283gap> List( ext, x -> x{ ord20 } );
3284[ [ 1, 0 ] ]
3285gap> Append( primt2, ext );
3286gap> Length( primt2 );
32877
3288gap> approx:= List( ord20, x -> ApproxP( primt2, x ) );;
3289gap> outer:= Difference(
3290>      PositionsProperty( OrdersClassRepresentatives( t2 ), IsPrimeInt ),
3291>      ClassPositionsOfDerivedSubgroup( t2 ) );;
3292gap> List( approx, l -> Maximum( l{ outer } ) );
3293[ 14/9, 0 ]
3294gap> approx:= ApproxP( primt2, ord20[1] );;
3295gap> bad:= Filtered( outer, i -> approx[i] >= 1/2 );
3296[ 84 ]
3297gap> OrdersClassRepresentatives( t2 ){ bad };
3298[ 2 ]
3299gap> SizesConjugacyClasses( t2 ){ bad };
3300[ 1080 ]
3301gap> Number( SizesConjugacyClasses( t2 ), x -> x = 1080 );
33021
3303gap> go:= GO(1,8,3);;
3304gap> so:= SO(1,8,3);;
3305gap> outerelm:= First( GeneratorsOfGroup( go ), x -> not x in so );;
3306gap> g2:= ClosureGroup( DerivedSubgroup( so ), outerelm );;
3307gap> Size( g2 );
330819808719257600
3309gap> dom:= NormedVectors( GF(3)^8 );;
3310gap> orbs:= Orbits( g2, dom, OnLines );;
3311gap> List( orbs, Length );
3312[ 1080, 1080, 1120 ]
3313gap> act:= Action( g2, orbs[1], OnLines );;
3314gap> Order( outerelm );
331526
3316gap> g:= Permutation( outerelm^13, orbs[1], OnLines );;
3317gap> Size( ConjugacyClass( act, g ) );
33181080
3319gap> ord20;
3320[ 82, 83 ]
3321gap> SizesCentralizers( t2 ){ ord20 };
3322[ 40, 20 ]
3323gap> der:= DerivedSubgroup( act );;
3324gap> repeat 20A:= Random( der );
3325>    until Order( 20A ) = 20 and Size( Centralizer( act, 20A ) ) = 40;
3326gap> RatioOfNongenerationTransPermGroup( act, g, 20A );
33271
3328gap> repeat 20BC:= Random( der );
3329>    until Order( 20BC ) = 20 and Size( Centralizer( act, 20BC ) ) = 20;
3330gap> RatioOfNongenerationTransPermGroup( act, g, 20BC );
33310
3332gap> ccl:= ConjugacyClasses( act );;
3333gap> der:= DerivedSubgroup( act );;
3334gap> reps:= Filtered( List( ccl, Representative ), x -> x in der );;
3335gap> Length( reps );
333683
3337gap> ratios:= List( reps,
3338>                   s -> RatioOfNongenerationTransPermGroup( act, g, s ) );;
3339gap> cand:= PositionsProperty( ratios, x -> x < 1 );;
3340gap> ratios:= ratios{ cand };;
3341gap> SortParallel( ratios, cand );
3342gap> ratios;
3343[ 0, 1/10, 1/10, 16/135, 1/3, 1/3, 11/27, 7/15, 7/15 ]
3344gap> invs:= List( cand,
3345>       x -> [ Order( reps[x] ), Size( Centralizer( der, reps[x] ) ) ] );
3346[ [ 20, 20 ], [ 18, 108 ], [ 18, 108 ], [ 14, 28 ], [ 15, 45 ], [ 15, 45 ],
3347  [ 10, 40 ], [ 12, 72 ], [ 12, 72 ] ]
3348gap> t3:= CharacterTable( "O8+(3).3" );;
3349gap> tfust3:= GetFusionMap( t, t3 );;
3350gap> inv:= InverseMap( tfust3 );;
3351gap> filt:= PositionsProperty( prim, x -> x[ spos ] <> 0 );;
3352gap> ForAll( prim{ filt },
3353>            pi -> ForAny( CompositionMaps( pi, inv ), IsList ) );
3354true
3355gap> outer:= Difference( [ 1 .. NrConjugacyClasses( t3 ) ],
3356>                ClassPositionsOfDerivedSubgroup( t3 ) );
3357[ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
3358  72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
3359  91, 92, 93, 94 ]
3360gap> Set( OrdersClassRepresentatives( t3 ){ outer } );
3361[ 3, 6, 9, 12, 18, 21, 24, 27, 36, 39 ]
3362gap> CleanWorkspace();
3363gap> q:= 4;;  n:= 8;;
3364gap> G:= DerivedSubgroup( SO( 1, n, q ) );;
3365gap> points:= NormedRowVectors( GF(q)^n );;
3366gap> orbs:= Orbits( G, points, OnLines );;
3367gap> List( orbs, Length );
3368[ 5525, 16320 ]
3369gap> hom:= ActionHomomorphism( G, orbs[1], OnLines );;
3370gap> G:= Image( hom );;
3371gap> Collected( Factors( Size( G ) ) );
3372[ [ 2, 24 ], [ 3, 5 ], [ 5, 4 ], [ 7, 1 ], [ 13, 1 ], [ 17, 2 ] ]
3373gap> ResetGlobalRandomNumberGenerators();
3374gap> repeat x:= Random( G );
3375>    until Order( x ) mod 13 = 0;
3376gap> x:= x^( Order( x ) / 13 );;
3377gap> c:= Centralizer( G, x );;
3378gap> IsAbelian( c );  AbelianInvariants( c );
3379true
3380[ 5, 5, 13 ]
3381gap> t:= CharacterTable( "S6(4)" );;
3382gap> ord65:= PositionsProperty( OrdersClassRepresentatives( t ),
3383>                               x -> x = 65 );
3384[ 105, 106, 107, 108, 109, 110, 111, 112 ]
3385gap> ord65 = ClassOrbit( t, ord65[1] );
3386true
3387gap> t:= CharacterTable( "U4(4)" );;
3388gap> ords:= OrdersClassRepresentatives( t );;
3389gap> ord65:= PositionsProperty( ords, x -> x = 65 );;
3390gap> ord65 = ClassOrbit( t, ord65[1] );
3391true
3392gap> syl5:= SylowSubgroup( c, 5 );;
3393gap> elms:= Filtered( Elements( syl5 ), y -> Order( y ) = 5 );;
3394gap> reps:= Set( List( elms, SmallestGeneratorPerm ) );;  Length( reps );
33956
3396gap> reps65:= List( reps, y -> SubgroupNC( G, [ y * x ] ) );;
3397gap> pairs:= Filtered( UnorderedTuples( [ 1 .. 6 ], 2 ),
3398>                      p -> p[1] <> p[2] );;
3399gap> ForAny( pairs, p -> IsConjugate( G, reps65[ p[1] ], reps65[ p[2] ] ) );
3400false
3401gap> cand:= List( reps, y -> Normalizer( G, SubgroupNC( G, [ y ] ) ) );;
3402gap> cand:= Filtered( cand, y -> Size( y ) = 10 * Size( t ) );;
3403gap> Length( cand );
34043
3405gap> norms:= List( reps65, y -> Normalizer( G, y ) );;
3406gap> ForAll( norms, y -> ForAll( cand, M -> IsSubset( M, y ) ) );
3407true
3408gap> syl5:= SylowSubgroup( cand[1], 5 );;
3409gap> Size( syl5 );  IsElementaryAbelian( syl5 );
3410625
3411true
3412gap> UpperBoundFixedPointRatios( G, List( cand, ConjugacyClasses ), false );
3413[ 34817/1645056, false ]
3414gap> frob:= PermList( List( orbs[1], v -> Position( orbs[1],
3415>              List( v, x -> x^2 ) ) ) );;
3416gap> G2:= ClosureGroupDefault( G, frob );;
3417gap> cand2:= List( cand, M -> Normalizer( G2, M ) );;
3418gap> ccl:= List( cand2,
3419>                M2 -> PcConjugacyClassReps( SylowSubgroup( M2, 2 ) ) );;
3420gap> List( ccl, l -> Number( l, x -> Order( x ) = 2 and not x in G ) );
3421[ 0, 0, 0 ]
3422gap> CleanWorkspace();
3423gap> g:= SO( 9, 3 );;
3424gap> g:= DerivedSubgroup( g );;
3425gap> Size( g );
342665784756654489600
3427gap> orbs:= Orbits( g, NormedRowVectors( GF(3)^9 ), OnLines );;
3428gap> List( orbs, Length ) / 41;
3429[ 3240/41, 81, 80 ]
3430gap> Size( SO( 9, 3 ) ) / Size( GO( -1, 8, 3 ) );
34313240
3432gap> t:= CharacterTable( "O9(3)" );;
3433gap> pi:= PermChars( t, rec( torso:= [ 3240 ] ) );
3434[ Character( CharacterTable( "O9(3)" ), [ 3240, 1080, 380, 132, 48, 324, 378,
3435      351, 0, 0, 54, 27, 54, 27, 0, 118, 0, 36, 46, 18, 12, 2, 8, 45, 0, 108,
3436      108, 135, 126, 0, 0, 56, 0, 0, 36, 47, 38, 27, 39, 36, 24, 12, 18, 18,
3437      15, 24, 2, 18, 15, 9, 0, 0, 0, 2, 0, 18, 11, 3, 9, 6, 6, 9, 6, 3, 6, 3,
3438      0, 6, 16, 0, 4, 6, 2, 45, 36, 0, 0, 0, 0, 0, 0, 0, 9, 9, 6, 3, 0, 0,
3439      15, 13, 0, 5, 7, 36, 0, 10, 0, 10, 19, 6, 15, 0, 0, 0, 0, 12, 3, 10, 0,
3440      3, 3, 7, 0, 6, 6, 2, 8, 0, 4, 0, 2, 0, 1, 3, 0, 0, 3, 0, 3, 2, 2, 3, 3,
3441      6, 2, 2, 9, 6, 3, 0, 0, 18, 9, 0, 0, 12, 0, 0, 8, 0, 6, 9, 5, 0, 0, 0,
3442      0, 0, 0, 0, 0, 3, 3, 3, 2, 1, 3, 3, 1, 0, 0, 4, 1, 0, 0, 1, 0, 3, 3, 1,
3443      1, 2, 2, 0, 0, 1, 3, 4, 0, 1, 2, 0, 0, 1, 0, 4, 1, 0, 0, 0, 0, 1, 0, 0,
3444      1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0 ] ) ]
3445gap> spos:= Position( OrdersClassRepresentatives( t ), 41 );
3446208
3447gap> approx:= ApproxP( pi, spos );;
3448gap> Maximum( approx );
34491/3
3450gap> PositionsProperty( approx, x -> x = 1/3 );
3451[ 2 ]
3452gap> SizesConjugacyClasses( t )[2];
34533321
3454gap> OrdersClassRepresentatives( t )[2];
34552
3456gap> g:= Action( g, orbs[1], OnLines );;
3457gap> repeat
3458>      repeat x:= Random( g ); ord:= Order( x ); until ord mod 2 = 0;
3459>      y:= x^(ord/2);
3460> until NrMovedPoints( y ) = 3240 - 1080;
3461gap> fp:= Difference( MovedPoints( g ), MovedPoints( y ) );;
3462gap> orb:= Orbit( g, fp, OnSets );;
3463gap> ForAny( orb, l -> IsEmpty( Intersection( l, fp ) ) );
3464false
3465gap> Size( GO(5,9) ) / 61;
34666886425600/61
3467gap> t:= CharacterTable( "O10-(3)" );  s:= CharacterTable( "U5(3)" );
3468CharacterTable( "O10-(3)" )
3469CharacterTable( "U5(3)" )
3470gap> SigmaFromMaxes( t, "61A", [ s ], [ 1 ] );
34711/1066
3472gap> m:= SU(5,3);;
3473gap> so:= SO(-1,10,3);;
3474gap> omega:= DerivedSubgroup( so );;
3475gap> om:= InvariantBilinearForm( so ).matrix;;
3476gap> Display( om );
3477 . 1 . . . . . . . .
3478 1 . . . . . . . . .
3479 . . 1 . . . . . . .
3480 . . . 2 . . . . . .
3481 . . . . 2 . . . . .
3482 . . . . . 2 . . . .
3483 . . . . . . 2 . . .
3484 . . . . . . . 2 . .
3485 . . . . . . . . 2 .
3486 . . . . . . . . . 2
3487gap> b:= Basis( GF(9), [ Z(3)^0, Z(3^2)^2 ] );
3488Basis( GF(3^2), [ Z(3)^0, Z(3^2)^2 ] )
3489gap> blow:= List( GeneratorsOfGroup( m ), x -> BlownUpMat( b, x ) );;
3490gap> form:= BlownUpMat( b, InvariantSesquilinearForm( m ).matrix );;
3491gap> ForAll( blow, x -> x * form * TransposedMat( x ) = form );
3492true
3493gap> Display( form );
3494 . . . . . . . . 1 .
3495 . . . . . . . . . 1
3496 . . . . . . 1 . . .
3497 . . . . . . . 1 . .
3498 . . . . 1 . . . . .
3499 . . . . . 1 . . . .
3500 . . 1 . . . . . . .
3501 . . . 1 . . . . . .
3502 1 . . . . . . . . .
3503 . 1 . . . . . . . .
3504gap> T1:= IdentityMat( 10, GF(3) );;
3505gap> T1{[1..3]}{[1..3]}:= [[1,1,0],[1,-1,1],[1,-1,-1]]*Z(3)^0;;
3506gap> pi:= PermutationMat( (1,10)(3,8), 10, GF(3) );;
3507gap> tr:= NullMat( 10,10,GF(3) );;
3508gap> tr{[1, 2]}{[1, 2]}:= [[1,1],[1,-1]]*Z(3)^0;;
3509gap> tr{[3, 4]}{[3, 4]}:= [[1,1],[1,-1]]*Z(3)^0;;
3510gap> tr{[7, 8]}{[7, 8]}:= [[1,1],[1,-1]]*Z(3)^0;;
3511gap> tr{[9,10]}{[9,10]}:= [[1,1],[1,-1]]*Z(3)^0;;
3512gap> tr{[5, 6]}{[5, 6]}:= [[1,0],[0,1]]*Z(3)^0;;
3513gap> tr2:= IdentityMat( 10,GF(3) );;
3514gap> tr2{[1,3]}{[1,3]}:= [[-1,1],[1,1]]*Z(3)^0;;
3515gap> tr2{[7,9]}{[7,9]}:= [[-1,1],[1,1]]*Z(3)^0;;
3516gap> T2:= tr2 * tr * pi;;
3517gap> D:= T1^-1 * T2;;
3518gap> tblow:= List( blow, x -> D * x * D^-1 );;
3519gap> IsSubset( omega, tblow );
3520true
3521gap> orbs:= Orbits( omega, NormedRowVectors( GF(3)^10 ), OnLines );;
3522gap> List( orbs, Length );
3523[ 9882, 9882, 9760 ]
3524gap> permgrp:= Action( omega, orbs[3], OnLines );;
3525gap> M:= SubgroupNC( permgrp,
3526>            List( tblow, x -> Permutation( x, orbs[3], OnLines ) ) );;
3527gap> ccl:= ClassesOfPrimeOrder( M, Set( Factors( Size( M ) ) ),
3528>                               TrivialSubgroup( M ) );;
3529gap> UpperBoundFixedPointRatios( permgrp, [ ccl ], false );
3530[ 1/1066, true ]
3531gap> CleanWorkspace();
3532gap> o:= SO(-1,14,2);;
3533gap> g:= SU(7,2);;
3534gap> b:= Basis( GF(4) );;
3535gap> blow:= List( GeneratorsOfGroup( g ), x -> BlownUpMat( b, x ) );;
3536gap> form:= NullMat( 14, 14, GF(2) );;
3537gap> for i in [ 1 .. 14 ] do form[i][ 15-i ]:= Z(2); od;
3538gap> ForAll( blow, x -> x * form * TransposedMat( x ) = form );
3539true
3540gap> pi:= PermutationMat( (1,13)(3,11)(5,9), 14, GF(2) );;
3541gap> pi * form * TransposedMat( pi ) = InvariantBilinearForm( o ).matrix;
3542true
3543gap> pi2:= PermutationMat( (7,3)(8,4), 14, GF(2) );;
3544gap> D:= pi2 * pi;;
3545gap> tblow:= List( blow, x -> D * x * D^-1 );;
3546gap> IsSubset( o, tblow );
3547true
3548gap> omega:= DerivedSubgroup( o );;
3549gap> IsSubset( omega, tblow );
3550true
3551gap> z:= Z(4) * One( g );;
3552gap> tz:= D * BlownUpMat( b, z ) * D^-1;;
3553gap> tz in omega;
3554true
3555gap> orbs:= Orbits( omega, NormedVectors( GF(2)^14 ), OnLines );;
3556gap> List( orbs, Length );
3557[ 8127, 8256 ]
3558gap> omega:= Action( omega, orbs[1], OnLines );;
3559gap> gens:= List( GeneratorsOfGroup( g ),
3560>             x -> Permutation( D * BlownUpMat( b, x ) * D^-1, orbs[1] ) );;
3561gap> g:= Group( gens );;
3562gap> ccl:= ClassesOfPrimeOrder( g, Set( Factors( Size( g ) ) ),
3563>                               TrivialSubgroup( g ) );;
3564gap> tz:= Permutation( tz, orbs[1] );;
3565gap> primereps:= List( ccl, Representative );;
3566gap> Add( primereps, () );
3567gap> reps:= Concatenation( List( primereps,
3568>               x -> List( [ 0 .. 2 ], i -> x * tz^i ) ) );;
3569gap> primereps:= Filtered( reps, x -> IsPrimeInt( Order( x ) ) );;
3570gap> Length( primereps );
357148
3572gap> M:= ClosureGroup( g, tz );;
3573gap> bccl:= List( primereps, x -> ConjugacyClass( M, x ) );;
3574gap> UpperBoundFixedPointRatios( omega, [ bccl ], false );
3575[ 1/2015, true ]
3576gap> CleanWorkspace();
3577gap> so:= SO(+1,12,3);;
3578gap> Display( InvariantBilinearForm( so ).matrix );
3579 . 1 . . . . . . . . . .
3580 1 . . . . . . . . . . .
3581 . . 1 . . . . . . . . .
3582 . . . 2 . . . . . . . .
3583 . . . . 2 . . . . . . .
3584 . . . . . 2 . . . . . .
3585 . . . . . . 2 . . . . .
3586 . . . . . . . 2 . . . .
3587 . . . . . . . . 2 . . .
3588 . . . . . . . . . 2 . .
3589 . . . . . . . . . . 2 .
3590 . . . . . . . . . . . 2
3591gap> g:= GO(+1,6,9);;
3592gap> Z(9)^2 = Z(3)^0 + Z(9);
3593true
3594gap> b:= Basis( GF(9), [ Z(3)^0, Z(9) ] );
3595Basis( GF(3^2), [ Z(3)^0, Z(3^2) ] )
3596gap> blow:= List( GeneratorsOfGroup( g ), x -> BlownUpMat( b, x ) );;
3597gap> m:= BlownUpMat( b, InvariantBilinearForm( g ).matrix );;
3598gap> Display( m );
3599 . . 1 . . . . . . . . .
3600 . . . 1 . . . . . . . .
3601 1 . . . . . . . . . . .
3602 . 1 . . . . . . . . . .
3603 . . . . 2 . . . . . . .
3604 . . . . . 2 . . . . . .
3605 . . . . . . 2 . . . . .
3606 . . . . . . . 2 . . . .
3607 . . . . . . . . 2 . . .
3608 . . . . . . . . . 2 . .
3609 . . . . . . . . . . 2 .
3610 . . . . . . . . . . . 2
3611gap> pi:= PermutationMat( (2,3), 12, GF(3) );;
3612gap> tr:= IdentityMat( 12, GF(3) );;
3613gap> tr{[3,4]}{[3,4]}:= [[1,-1],[1,1]]*Z(3)^0;;
3614gap> D:= tr * pi;;
3615gap> D * m * TransposedMat( D ) = InvariantBilinearForm( so ).matrix;
3616true
3617gap> tblow:= List( blow, x -> D * x * D^-1 );;
3618gap> IsSubset( so, tblow );
3619true
3620gap> orbs:= Orbits( so, NormedVectors( GF(3)^12 ), OnLines );;
3621gap> List( orbs, Length );
3622[ 88452, 88452, 88816 ]
3623gap> act:= Action( so, orbs[1], OnLines );;
3624gap> SetSize( act, Size( so ) / 2 );
3625gap> u:= SubgroupNC( act,
3626>            List( tblow, x -> Permutation( x, orbs[1], OnLines ) ) );;
3627gap> n:= Normalizer( act, u );;
3628gap> Size( n ) / Size( u );
36292
3630gap> norbs:= Orbits( n, MovedPoints( n ) );;
3631gap> List( norbs, Length );
3632[ 58968, 29484 ]
3633gap> hom:= ActionHomomorphism( n, norbs[2] );;
3634gap> nact:= Image( hom );;
3635gap> Size( nact ) = Size( n );
3636true
3637gap> ccl:= ClassesOfPrimeOrder( nact, Set( Factors( Size( nact ) ) ),
3638>                               TrivialSubgroup( nact ) );;
3639gap> Length( ccl );
364026
3641gap> preim:= List( ccl,
3642>        x -> PreImagesRepresentative( hom, Representative( x ) ) );;
3643gap> pccl:= List( preim, x -> ConjugacyClass( n, x ) );;
3644gap> for i in [ 1 .. Length( pccl ) ] do
3645>      SetSize( pccl[i], Size( ccl[i] ) );
3646>    od;
3647gap> UpperBoundFixedPointRatios( act, [ pccl ], false );
3648[ 2/88209, true ]
3649gap> sp:= SP(4,8);;
3650gap> Display( InvariantBilinearForm( sp ).matrix );
3651 . . . 1
3652 . . 1 .
3653 . 1 . .
3654 1 . . .
3655gap> z:= Z(64);;
3656gap> f:= AsField( GF(8), GF(64) );;
3657gap> repeat
3658>      b:= Basis( f, [ z, z^8 ] );
3659>      z:= z * Z(64);
3660> until b <> fail;
3661gap> sub:= SP(2,64);;
3662gap> Display( InvariantBilinearForm( sub ).matrix );
3663 . 1
3664 1 .
3665gap> ext:= Group( List( GeneratorsOfGroup( sub ),
3666>                       x -> BlownUpMat( b, x ) ) );;
3667gap> tr:= PermutationMat( (3,4), 4, GF(2) );;
3668gap> conj:= ConjugateGroup( ext, tr );;
3669gap> IsSubset( sp, conj );
3670true
3671gap> inv:= [[0,1,0,0],[1,0,0,0],[0,0,0,1],[0,0,1,0]] * Z(2);;
3672gap> inv in sp;
3673true
3674gap> inv in conj;
3675false
3676gap> Length( NullspaceMat( inv - inv^0 ) );
36772
3678gap> so:= SO(-1,4,8);;
3679gap> der:= DerivedSubgroup( so );;
3680gap> x:= First( GeneratorsOfGroup( so ), x -> not x in der );;
3681gap> x:= x^( Order(x)/2 );;
3682gap> Length( NullspaceMat( x - x^0 ) );
36833
3684gap> CharacterTable( "L2(64).2" );
3685fail
3686gap> t:= CharacterTable( "S4(8)" );;
3687gap> degree:= Size( t ) / ( 2 * Size( SL(2,64) ) );;
3688gap> pi:= PermChars( t, rec( torso:= [ degree ] ) );
3689[ Character( CharacterTable( "S4(8)" ), [ 2016, 0, 256, 32, 0, 36, 0, 8, 1,
3690      0, 4, 0, 0, 0, 28, 28, 28, 0, 0, 0, 0, 0, 0, 36, 36, 36, 0, 0, 0, 0, 0,
3691      0, 1, 1, 1, 0, 0, 0, 4, 4, 4, 0, 0, 0, 4, 4, 4, 0, 0, 0, 1, 1, 1, 0, 0,
3692      0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3693      1, 1, 1, 1 ] ), Character( CharacterTable( "S4(8)" ),
3694    [ 2016, 256, 0, 32, 36, 0, 0, 8, 1, 4, 0, 28, 28, 28, 0, 0, 0, 0, 0, 0,
3695      36, 36, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 4, 4, 4, 0, 0, 0, 4, 4,
3696      4, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
3697      0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ) ]
3698gap> spos:= Position( OrdersClassRepresentatives( t ), 65 );;
3699gap> List( pi, x -> x[ spos ] );
3700[ 1, 1 ]
3701gap> Maximum( ApproxP( pi, spos ) );
37028/63
3703gap> CleanWorkspace();
3704gap> t:= CharacterTable( "S6(2)" );;
3705gap> ProbGenInfoSimple( t );
3706[ "S6(2)", 4/7, 1, [ "9A" ], [ 4 ] ]
3707gap> prim:= PrimitivePermutationCharacters( t );;
3708gap> ord:= OrdersClassRepresentatives( t );;
3709gap> spos:= Position( ord, 9 );;
3710gap> filt:= PositionsProperty( prim, x -> x[ spos ] <> 0 );
3711[ 1, 8 ]
3712gap> Maxes( t ){ filt };
3713[ "U4(2).2", "L2(8).3" ]
3714gap> List( prim{ filt }, x -> x[ spos ] );
3715[ 1, 3 ]
3716gap> prim:= PrimitivePermutationCharacters( t );;
3717gap> spos9:= Position( ord, 9 );;
3718gap> approx9:= ApproxP( prim, spos9 );;
3719gap> filt9:= PositionsProperty( approx9, x -> x >= 1/3 );
3720[ 2, 6 ]
3721gap> AtlasClassNames( t ){ filt9 };
3722[ "2A", "3A" ]
3723gap> approx9{ filt9 };
3724[ 4/7, 5/14 ]
3725gap> List( Filtered( prim, x -> x[ spos9 ] <> 0 ), x -> x{ filt9 } );
3726[ [ 16, 10 ], [ 0, 0 ] ]
3727gap> spos15:= Position( ord, 15 );;
3728gap> approx15:= ApproxP( prim, spos15 );;
3729gap> filt15:= PositionsProperty( approx15, x -> x >= 1/3 );
3730[ 2, 3 ]
3731gap> PositionsProperty( ApproxP( prim{ [ 2 ] }, spos15 ), x -> x >= 1/3 );
3732[ 2, 3 ]
3733gap> AtlasClassNames( t ){ filt15 };
3734[ "2A", "2B" ]
3735gap> approx15{ filt15 };
3736[ 46/63, 8/21 ]
3737gap> transvection:= function( d )
3738>     local mat;
3739>     mat:= IdentityMat( d, Z(2) );
3740>     mat{ [ 1, d ] }{ [ 1, d ] }:= [ [ 0, 1 ], [ 1, 0 ] ] * Z(2);
3741>     return mat;
3742> end;;
3743gap> PositionsProperty( SizesConjugacyClasses( t ), x -> x in [ 63, 315 ] );
3744[ 2, 3 ]
3745gap> d:= 6;;
3746gap> matgrp:= Sp(d,2);;
3747gap> hom:= ActionHomomorphism( matgrp, NormedRowVectors( GF(2)^d ) );;
3748gap> g:= Image( hom, matgrp );;
3749gap> ResetGlobalRandomNumberGenerators();
3750gap> repeat s15:= Random( g );
3751>    until Order( s15 ) = 15;
3752gap> 2A:= Image( hom, transvection( d ) );;
3753gap> Size( ConjugacyClass( g, 2A ) );
375463
3755gap> IsTransitive( g, MovedPoints( g ) );
3756true
3757gap> RatioOfNongenerationTransPermGroup( g, 2A, s15 );
375811/21
3759gap> repeat 12C:= Random( g );
3760>    until Order( 12C ) = 12 and Size( Centralizer( g, 12C ) ) = 12;
3761gap> 2B:= 12C^6;;
3762gap> Size( ConjugacyClass( g, 2B ) );
3763315
3764gap> RatioOfNongenerationTransPermGroup( g, 2B, s15 );
37658/21
3766gap> ccl:= ConjugacyClasses( g );;
3767gap> reps:= List( ccl, Representative );;
3768gap> nongen2A:= List( reps,
3769>        x -> RatioOfNongenerationTransPermGroup( g, 2A, x ) );;
3770gap> min:= Minimum( nongen2A );
377111/21
3772gap> Number( nongen2A, x -> x = min );
37731
3774gap> nongen2B:= List( reps,
3775>        x -> RatioOfNongenerationTransPermGroup( g, 2B, x ) );;
3776gap> 3A:= s15^5;;
3777gap> nongen3A:= List( reps,
3778>        x -> RatioOfNongenerationTransPermGroup( g, 3A, x ) );;
3779gap> bad:= List( [ 1 .. NrConjugacyClasses( t ) ],
3780>                i -> Number( [ nongen2A, nongen2B, nongen3A ],
3781>                             x -> x[i] > 1/3 ) );;
3782gap> Minimum( bad );
37832
3784gap> PositionsProperty( approx9, x -> x + approx9[2] >= 1 );
3785[ 2 ]
3786gap> repeat s9:= Random( g );
3787>    until Order( s9 ) = 9;
3788gap> RandomCheckUniformSpread( g, [ 2A, 2A ], s9, 20 );
3789true
3790gap> t:= CharacterTable( "S8(2)" );;
3791gap> pi1:= PossiblePermutationCharacters( CharacterTable( "O8-(2).2" ), t );;
3792gap> pi2:= PossiblePermutationCharacters( CharacterTable( "S4(4).2" ), t );;
3793gap> pi3:= [ TrivialCharacter( CharacterTable( "L2(17)" ) )^t ];;
3794gap> prim:= Concatenation( pi1, pi2, pi3 );;
3795gap> Length( prim );
37963
3797gap> spos:= Position( OrdersClassRepresentatives( t ), 17 );;
3798gap> List( prim, x -> x[ spos ] );
3799[ 1, 1, 1 ]
3800gap> approx:= ApproxP( prim, spos );;
3801gap> PositionsProperty( approx, x -> x >= 1/3 );
3802[ 2 ]
3803gap> Number( prim, pi -> pi[2] <> 0 and pi[ spos ] <> 0 );
38041
3805gap> approx[2];
38068/15
3807gap> PositionsProperty( approx, x -> x + approx[2] >= 1 );
3808[ 2 ]
3809gap> d:= 8;;
3810gap> matgrp:= Sp(d,2);;
3811gap> hom:= ActionHomomorphism( matgrp, NormedRowVectors( GF(2)^d ) );;
3812gap> x:= Image( hom, transvection( d ) );;
3813gap> g:= Image( hom, matgrp );;
3814gap> C:= ConjugacyClass( g, x );;  Size( C );
3815255
3816gap> ResetGlobalRandomNumberGenerators();
3817gap> repeat s:= Random( g );
3818>    until Order( s ) = 17;
3819gap> RandomCheckUniformSpread( g, [ x, x ], s, 20 );
3820true
3821gap> t:= CharacterTable( "S10(2)" );;
3822gap> pi1:= PossiblePermutationCharacters( CharacterTable( "O10-(2).2" ), t );;
3823gap> pi2:= PossiblePermutationCharacters( CharacterTable( "L2(32).5" ), t );;
3824gap> prim:= Concatenation( pi1, pi2 );;  Length( prim );
38252
3826gap> spos:= Position( OrdersClassRepresentatives( t ), 33 );;
3827gap> approx:= ApproxP( prim, spos );;
3828gap> PositionsProperty( approx, x -> x >= 1/3 );
3829[ 2 ]
3830gap> Number( prim, pi -> pi[2] <> 0 and pi[ spos ] <> 0 );
38311
3832gap> approx[2];
383316/31
3834gap> d:= 10;;
3835gap> matgrp:= Sp(d,2);;
3836gap> hom:= ActionHomomorphism( matgrp, NormedRowVectors( GF(2)^d ) );;
3837gap> x:= Image( hom, transvection( d ) );;
3838gap> g:= Image( hom, matgrp );;
3839gap> C:= ConjugacyClass( g, x );;  Size( C );
38401023
3841gap> ResetGlobalRandomNumberGenerators();
3842gap> repeat s:= Random( g );
3843>    until Order( s ) = 33;
3844gap> RandomCheckUniformSpread( g, [ x, x ], s, 20 );
3845true
3846gap> t:= CharacterTable( "U4(2)" );;
3847gap> ProbGenInfoSimple( t );
3848[ "U4(2)", 21/40, 1, [ "12A" ], [ 2 ] ]
3849gap> OrdersClassRepresentatives( t );
3850[ 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 6, 6, 6, 6, 6, 6, 9, 9, 12, 12 ]
3851gap> prim:= PrimitivePermutationCharacters( t );
3852[ Character( CharacterTable( "U4(2)" ), [ 27, 3, 7, 0, 0, 9, 0, 3, 1, 2, 0,
3853      0, 3, 3, 0, 1, 0, 0, 0, 0 ] ), Character( CharacterTable( "U4(2)" ),
3854    [ 36, 12, 8, 0, 0, 6, 3, 0, 2, 1, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0 ] ),
3855  Character( CharacterTable( "U4(2)" ), [ 40, 8, 0, 13, 13, 4, 4, 4, 0, 0, 5,
3856      5, 2, 2, 2, 0, 1, 1, 1, 1 ] ), Character( CharacterTable( "U4(2)" ),
3857    [ 40, 16, 4, 4, 4, 1, 7, 0, 2, 0, 4, 4, 1, 1, 1, 1, 1, 1, 0, 0 ] ),
3858  Character( CharacterTable( "U4(2)" ), [ 45, 13, 5, 9, 9, 6, 3, 1, 1, 0, 1,
3859      1, 4, 4, 1, 2, 0, 0, 1, 1 ] ) ]
3860gap> g:= SU(4,2);;
3861gap> orbs:= Orbits( g, NormedRowVectors( GF(4)^4 ), OnLines );;
3862gap> List( orbs, Length );
3863[ 45, 40 ]
3864gap> g:= Action( g, orbs[2], OnLines );;
3865gap> spos:= Position( OrdersClassRepresentatives( t ), 9 );
386617
3867gap> approx:= ApproxP( prim, spos );
3868[ 0, 3/5, 1/10, 17/40, 17/40, 1/8, 11/40, 1/10, 1/20, 0, 9/40, 9/40, 3/40,
3869  3/40, 3/40, 1/40, 1/20, 1/20, 1/40, 1/40 ]
3870gap> badpos:= PositionsProperty( approx, x -> x >= 2/5 );
3871[ 2, 4, 5 ]
3872gap> PowerMap( t, 2 )[4];
38735
3874gap> OrdersClassRepresentatives( t );
3875[ 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 6, 6, 6, 6, 6, 6, 9, 9, 12, 12 ]
3876gap> SizesConjugacyClasses( t );
3877[ 1, 45, 270, 40, 40, 240, 480, 540, 3240, 5184, 360, 360, 720, 720, 1440,
3878  2160, 2880, 2880, 2160, 2160 ]
3879gap> PowerMap( t, 3 )[ spos ];
38804
3881gap> ResetGlobalRandomNumberGenerators();
3882gap> repeat s:= Random( g );
3883>    until Order( s ) = 9;
3884gap> Size( ConjugacyClass( g, s^3 ) );
388540
3886gap> prop:= RatioOfNongenerationTransPermGroup( g, s^3, s );
388713/40
3888gap> repeat x:= Random( g ); until Order( x ) = 12;
3889gap> Size( ConjugacyClass( g, x^6 ) );
389045
3891gap> prop:= RatioOfNongenerationTransPermGroup( g, x^6, s );
38922/5
3893gap> ccl:= List( ConjugacyClasses( g ), Representative );;
3894gap> SortParallel( List( ccl, Order ), ccl );
3895gap> List( ccl, Order );
3896[ 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 6, 6, 6, 6, 6, 6, 9, 9, 12, 12 ]
3897gap> prop:= List( ccl, r -> RatioOfNongenerationTransPermGroup( g, x^6, r ) );
3898[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 5/9, 1, 1, 1, 1, 1, 1, 2/5, 2/5, 7/15, 7/15 ]
3899gap> Minimum( prop );
39002/5
3901gap> approx[2]:= 2/5;;
3902gap> approx[4]:= 13/40;;
3903gap> primeord:= PositionsProperty( OrdersClassRepresentatives( t ),
3904>                                  IsPrimeInt );
3905[ 2, 3, 4, 5, 6, 7, 10 ]
3906gap> RemoveSet( primeord, 5 );
3907gap> primeord;
3908[ 2, 3, 4, 6, 7, 10 ]
3909gap> approx{ primeord };
3910[ 2/5, 1/10, 13/40, 1/8, 11/40, 0 ]
3911gap> AtlasClassNames( t ){ primeord };
3912[ "2A", "2B", "3A", "3C", "3D", "5A" ]
3913gap> triples:= Filtered( UnorderedTuples( primeord, 3 ),
3914>                  t -> Sum( approx{ t } ) >= 1 );
3915[ [ 2, 2, 2 ], [ 2, 2, 4 ], [ 2, 2, 7 ], [ 2, 4, 4 ], [ 2, 4, 7 ] ]
3916gap> repeat 6E:= Random( g );
3917>    until Order( 6E ) = 6 and Size( Centralizer( g, 6E ) ) = 18;
3918gap> 2A:= 6E^3;;
3919gap> 3A:= s^3;;
3920gap> 3D:= 6E^2;;
3921gap> RandomCheckUniformSpread( g, [ 2A, 2A, 2A ], s, 50 );
3922true
3923gap> RandomCheckUniformSpread( g, [ 2A, 2A, 3A ], s, 50 );
3924true
3925gap> RandomCheckUniformSpread( g, [ 3D, 2A, 2A ], s, 50 );
3926true
3927gap> RandomCheckUniformSpread( g, [ 2A, 3A, 3A ], s, 50 );
3928true
3929gap> RandomCheckUniformSpread( g, [ 3D, 3A, 2A ], s, 50 );
3930true
3931gap> t:= CharacterTable( "U4(2)" );;
3932gap> t2:= CharacterTable( "U4(2).2" );;
3933gap> spos:= PositionsProperty( OrdersClassRepresentatives( t ), x -> x = 9 );;
3934gap> ProbGenInfoAlmostSimple( t, t2, spos );
3935[ "U4(2).2", 7/20, [ "9AB" ], [ 2 ] ]
3936gap> t:= CharacterTable( "U4(3)" );;
3937gap> ProbGenInfoSimple( t );
3938[ "U4(3)", 53/135, 2, [ "7A" ], [ 7 ] ]
3939gap> prim:= PrimitivePermutationCharacters( t );;
3940gap> spos:= Position( OrdersClassRepresentatives( t ), 7 );
394113
3942gap> List( Filtered( prim, x -> x[ spos ] <> 0 ), l -> l{ [ 1, spos ] } );
3943[ [ 162, 1 ], [ 162, 1 ], [ 540, 1 ], [ 1296, 1 ], [ 1296, 1 ], [ 1296, 1 ],
3944  [ 1296, 1 ] ]
3945gap> matgrp:= DerivedSubgroup( SO( -1, 6, 3 ) );;
3946gap> orbs:= Orbits( matgrp, NormedRowVectors( GF(3)^6 ), OnLines );;
3947gap> List( orbs, Length );
3948[ 126, 126, 112 ]
3949gap> G:= Action( matgrp, orbs[3], OnLines );;
3950gap> approx:= ApproxP( prim, spos );
3951[ 0, 53/135, 1/10, 1/24, 1/24, 7/45, 4/45, 1/27, 1/36, 1/90, 1/216, 1/216,
3952  7/405, 7/405, 1/270, 0, 0, 0, 0, 1/270 ]
3953gap> Filtered( approx, x -> x >= 43/135 );
3954[ 53/135 ]
3955gap> OrdersClassRepresentatives( t );
3956[ 1, 2, 3, 3, 3, 3, 4, 4, 5, 6, 6, 6, 7, 7, 8, 9, 9, 9, 9, 12 ]
3957gap> ResetGlobalRandomNumberGenerators();
3958gap> repeat g:= Random( G ); until Order(g) = 2;
3959gap> repeat s:= Random( G );
3960>    until Order(s) = 7;
3961gap> bad:= RatioOfNongenerationTransPermGroup( G, g, s );
396243/135
3963gap> bad < 1/3;
3964true
3965gap> 4t:= CharacterTable( "4.U4(3)" );;
3966gap> Length( PossibleClassFusions( CharacterTable( "L3(4)" ), 4t ) );
39670
3968gap> Length( PossibleClassFusions( CharacterTable( "2.L3(4)" ), 4t ) );
39690
3970gap> Length( PossibleClassFusions( CharacterTable( "4_1.L3(4)" ), 4t ) );
39710
3972gap> Length( PossibleClassFusions( CharacterTable( "4_2.L3(4)" ), 4t ) );
39734
3974gap> 2t:= CharacterTable( "2.U4(3)" );;
3975gap> Length( PossibleClassFusions( CharacterTable( "2.A7" ), 2t ) );
39760
3977gap> Length( PossibleClassFusions( CharacterTable( "A7" ), 4t ) );
39780
3979gap> t2:= CharacterTable( "U4(3).2_2" );;
3980gap> pi1:= PossiblePermutationCharacters( CharacterTable( "U3(3).2" ), t2 );
3981[ Character( CharacterTable( "U4(3).2_2" ), [ 540, 12, 54, 0, 0, 9, 8, 0, 0,
3982      6, 0, 0, 1, 2, 0, 0, 0, 2, 0, 24, 4, 0, 0, 0, 0, 0, 0, 3, 2, 0, 4, 0,
3983      0, 0 ] ) ]
3984gap> pi2:= PossiblePermutationCharacters( CharacterTable( "A7.2" ), t2 );
3985[ Character( CharacterTable( "U4(3).2_2" ), [ 1296, 48, 0, 27, 0, 9, 0, 4, 1,
3986      0, 3, 0, 1, 0, 0, 0, 0, 0, 216, 24, 0, 4, 0, 0, 0, 9, 0, 3, 0, 1, 0, 1,
3987      0, 0 ] ) ]
3988gap> prim:= Concatenation( pi1, pi2, pi2 );;
3989gap> outer:= Difference(
3990>      PositionsProperty( OrdersClassRepresentatives( t2 ), IsPrimeInt ),
3991>      ClassPositionsOfDerivedSubgroup( t2 ) );;
3992gap> spos:= Position( OrdersClassRepresentatives( t2 ), 7 );;
3993gap> Maximum( ApproxP( prim, spos ){ outer } );
39941/3
3995gap> matgrp:= SO( -1, 6, 3 );
3996SO(-1,6,3)
3997gap> orbs:= Orbits( matgrp, NormedRowVectors( GF(3)^6 ), OnLines );;
3998gap> List( orbs, Length );
3999[ 126, 126, 112 ]
4000gap> G:= Action( matgrp, orbs[3], OnLines );;
4001gap> repeat s:= Random( G );
4002>    until Order( s ) = 7;
4003gap> repeat
4004>      repeat 2B:= Random( G ); until Order( 2B ) mod 2 = 0;
4005>      2B:= 2B^( Order( 2B ) / 2 );
4006>      c:= Centralizer( G, 2B );
4007>    until Size( c ) = 12096;
4008gap> RatioOfNongenerationTransPermGroup( G, 2B, s );
400913/27
4010gap> repeat
4011>      repeat 2C:= Random( G ); until Order( 2C ) mod 2 = 0;
4012>      2C:= 2C^( Order( 2C ) / 2 );
4013>      c:= Centralizer( G, 2C );
4014>    until Size( c ) = 1440;
4015gap> RatioOfNongenerationTransPermGroup( G, 2C, s );
40160
4017gap> CharacterTable( "U6(3)" );
4018fail
4019gap> g:= SU(6,3);;
4020gap> orbs:= Orbits( g, NormedRowVectors( GF(9)^6 ), OnLines );;
4021gap> List( orbs, Length );
4022[ 22204, 44226 ]
4023gap> repeat x:= PseudoRandom( g ); until Order( x ) = 244;
4024gap> List( orbs, o -> Number( o, v -> OnLines( v, x ) = v ) );
4025[ 0, 1 ]
4026gap> g:= Action( g, orbs[2], OnLines );;
4027gap> M:= Stabilizer( g, 1 );;
4028gap> elms:= [];;
4029gap> for p in Set( Factors( Size( M ) ) ) do
4030>      syl:= SylowSubgroup( M, p );
4031>      Append( elms, Filtered( PcConjugacyClassReps( syl ),
4032>                              r -> Order( r ) = p ) );
4033>    od;
4034gap> 1 - Minimum( List( elms, NrMovedPoints ) ) / Length( orbs[2] );
4035353/3159
4036gap> CharacterTable( "U8(2)" );
4037fail
4038gap> g:= SU(8,2);;
4039gap> orbs:= Orbits( g, NormedRowVectors( GF(4)^8 ), OnLines );;
4040gap> List( orbs, Length );
4041[ 10965, 10880 ]
4042gap> repeat x:= PseudoRandom( g ); until Order( x ) = 129;
4043gap> List( orbs, o -> Number( o, v -> OnLines( v, x ) = v ) );
4044[ 0, 1 ]
4045gap> g:= Action( g, orbs[2], OnLines );;
4046gap> M:= Stabilizer( g, 1 );;
4047gap> elms:= [];;
4048gap> for p in Set( Factors( Size( M ) ) ) do
4049>      syl:= SylowSubgroup( M, p );
4050>      Append( elms, Filtered( PcConjugacyClassReps( syl ),
4051>                              r -> Order( r ) = p ) );
4052>    od;
4053gap> Length( elms );
4054611
4055gap> 1 - Minimum( List( elms, NrMovedPoints ) ) / Length( orbs[2] );
40562753/10880
4057
4058gap> STOP_TEST( "probgen.tst", 75612500 );
4059
4060#############################################################################
4061##
4062#E
4063
4064