Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 A B C Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

B Random functions
 B.1 Random functions

B Random functions

Here we describe some functions which allow to create several "random" objects.

B.1 Random functions

B.1-1 RandomNumericalSemigroup
‣ RandomNumericalSemigroup( n, a[, b] )( function )

Returns a ``random" numerical semigroup with no more than n generators in [1..a] (or in [a..b], if b is present).

gap> RandomNumericalSemigroup(3,9);
<Numerical semigroup with 3 generators>
gap> RandomNumericalSemigroup(3,9,55);
<Numerical semigroup with 3 generators>

B.1-2 RandomListForNS
‣ RandomListForNS( n, a, b )( function )

Returns a set of length not greater than n of random integers in [a..b] whose GCD is 1. It is used to create "random" numerical semigroups.

gap> RandomListForNS(13,1,79);
[ 22, 26, 29, 31, 34, 46, 53, 61, 62, 73, 76 ]

B.1-3 RandomModularNumericalSemigroup
‣ RandomModularNumericalSemigroup( k[, m] )( function )

Returns a ``random" modular numerical semigroup S(a,b) with a le k (see 1.) and multiplicity at least m, were m is the second argument, which may not be present..

gap> RandomModularNumericalSemigroup(9);
<Modular numerical semigroup satisfying 5x mod 6 <= x >
gap> RandomModularNumericalSemigroup(10,25);
<Modular numerical semigroup satisfying 4x mod 157 <= x >

B.1-4 RandomProportionallyModularNumericalSemigroup
‣ RandomProportionallyModularNumericalSemigroup( k[, m] )( function )

Returns a ``random" proportionally modular numerical semigroup S(a,b,c) with a le k (see 1.) and multiplicity at least m, were m is the second argument, which may not be present.

gap> RandomProportionallyModularNumericalSemigroup(9);
<Proportionally modular numerical semigroup satisfying 2x mod 3 <= 2x >
gap> RandomProportionallyModularNumericalSemigroup(10,25);
<Proportionally modular numerical semigroup satisfying 6x mod 681 <= 2x >

B.1-5 RandomListRepresentingSubAdditiveFunction
‣ RandomListRepresentingSubAdditiveFunction( m, a )( function )

Produces a ``random" list representing a subadditive function (see 1.) which is periodic with period m (or less). When possible, the images are in [a..20*a]. (Otherwise, the list of possible images is enlarged.)

gap> RandomListRepresentingSubAdditiveFunction(7,9);
[ 173, 114, 67, 0 ]
gap> RepresentsPeriodicSubAdditiveFunction(last);
true
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 A B C Bib Ind

generated by GAPDoc2HTML