Random( D )
Random
returns a random element of the domain D. The distribution of
elements returned by Random
depends on the domain D. For finite
domains all elements are usually equally likely. For infinite domains
some reasonable distribution is used. See the chapters of the various
domains to find out which distribution is being used.
gap> Random( GaussianIntegers ); 1-4*E(4) gap> Random( GaussianIntegers ); 1+2*E(4) gap> Random( D12 ); () gap> Random( D12 ); (1,4)(2,5)(3,6)
The default function for random selection is DomainOps.Random
, which
computes the set of elements using Elements
and selects a random
element of this list using RandomList
(see RandomList for a
description of the pseudo random number generator used). This default
function can of course only be applied to finite domains. It is overlaid
by other functions for most other domains.
All random functions called this way rely on the low level random number
generator provided by RandomList
(see RandomList).
GAP 3.4.4