randomMonomialSet(ZZ,ZZ,RR)
randomMonomialSet(PolynomialRing,ZZ,RR)
randomMonomialSet(ZZ,ZZ,ZZ)
randomMonomialSet(PolynomialRing,ZZ,ZZ)
randomMonomialSet(ZZ,ZZ,List)
randomMonomialSet(PolynomialRing,ZZ,List)
The function randomMonomialSet creates a list of monomials, up to a given degree $d$, $1\leq d\leq D$, in $n$ variables. If $p$ is a real number, it generates the set according to the ErdosRenyitype model, that is, based on a Binomial distribution: from the list of all monomials of degree $1,\dots,D$ in $n$ variables, it selects each one, independently, with probability $p$.



Note that this model does not generate the monomial $1$:

If $M$ is an integer, then the function creates a list of monomials of length $M$: randomly select $M$ monomials from the list of all monomials of degree $1,\dots,D$ in $n$ variables.


Note that it returns a set with $M = 4$ monomials.
If $M$ is greater than the total number of monomials in $n$ variables of degree at most $D$, then the function will return all those monomials (and not $M$ of them). For example:

returns 5 monomials in a generating set, and not 10, since there are fewer than 10 monomials to choose from.
The input of type List controls the number of monomials in the generating set of each degree for the graded ER model. Specifically, this input is either a list of real numbers between 0 and 1, inclusive, whose ith entry is the probability of including a monomial of degree i in the monomial set, or it is a list of nonnegative integers whose ith entry is the number of monomials of each degree to include in the monomial set.
Consider the following two examples: If $p=p_1,\dots,p_D$ is a list of real numbers of length $D$, then the function generates the set utilizing the graded ErdosRenyitype model: select each monomial of degree $1\le d\le D$, independently, with probability $p_d$.

Note that the degree1 monomials were not generated, since the first probability vector entry is 0.
If $M=M_1,\dots,M_D$ is a list of integers of length $D$, then the function creates a list of monomials, where $M_d$ monomials are of degree $d$.

Observe that there are two degree1, one degree2, and one degree3 monomials.
If Strategy=>"ER", the default setting for the graded fixed number of generators version of the function, the set of monomials we obtain will not necessarily be minimal. Else if Strategy=> "Minimal" then the set of monomials constitutes a minimal generating set which is build up of $M_d$ monomials, or the maximum number possible, of total degree $d$, for $d$ from 1 to $D$, starting from $d=1$.

Observe that there are at most one degree1, one degree2, and one degree3 monomials.
Sometimes we are already working in a specific ring and would like the random sets of monomials to live in the same ring:



The object randomMonomialSet is a method function with options.