Macaulay2 » Documentation
Packages » RandomMonomialIdeals :: randomMonomialIdeals
next | previous | forward | backward | up | index | toc

randomMonomialIdeals -- generates random sets of monomial ideals

Synopsis

Description

This function creates $N$ random monomial ideals, with each monomial generator having degree $d$, $1\leq d\leq D$, in $n$ variables. If $p$ is a real number, it generates each of these ideals according to the Erdos-Renyi-type model (see https://arxiv.org/abs/1701.07130): from the list of all monomials of degree $1,\dots,D$ in $n$ variables, it selects each one, independently, with probability $p$.

i1 : n=2; D=3; p=0.2; N=10;
i5 : randomMonomialIdeals(n,D,p,N)

                      2   3                                    2 
o5 = {monomialIdeal (x , x ), monomialIdeal x , monomialIdeal x ,
                      1   2                  2                 2 
     ------------------------------------------------------------------------
                     3   2       2   3                                       
     monomialIdeal (x , x x , x x , x ), monomialIdeal x , monomialIdeal (x ,
                     1   1 2   1 2   2                  1                  1 
     ------------------------------------------------------------------------
      2                  2                                    2     2  
     x ), monomialIdeal x , monomialIdeal x , monomialIdeal (x x , x ),
      2                  1                 2                  1 2   2  
     ------------------------------------------------------------------------
                     2
     monomialIdeal (x , x )}
                     1   2

o5 : List
i6 : randomMonomialIdeals(5,3,0.4,4)

                                      2       2                       2 
o6 = {monomialIdeal (x x , x , x x , x x , x x , x ), monomialIdeal (x ,
                      1 2   3   1 4   2 4   2 4   5                   1 
     ------------------------------------------------------------------------
            2   2   2                                       3               
     x x , x , x , x , x x , x x x , x x ), monomialIdeal (x , x , x , x x ,
      1 2   2   3   4   1 5   2 3 5   4 5                   1   2   3   1 4 
     ------------------------------------------------------------------------
      2   2             2   3                   3   2     2   2       2   3 
     x , x x , x x , x x , x ), monomialIdeal (x , x x , x , x x , x x , x ,
      4   1 5   4 5   1 5   5                   1   1 2   2   1 3   2 3   3 
     ------------------------------------------------------------------------
                            2     2       2     2
     x x , x x x , x x x , x x , x x , x x , x x )}
      1 4   2 3 4   1 2 5   3 5   4 5   1 5   4 5

o6 : List

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

i7 : randomMonomialIdeals(3,2,1.0,1)

o7 = {monomialIdeal (x , x , x )}
                      1   2   3

o7 : List

If $M$ is an integer, then the function creates $N$ random monomial with $M$ (not necessarily minimal) generators: randomly select $M$ monomials from the list of all monomials of degree $1,\dots,D$ in $n$ variables, then generate the corresponding ideal.

i8 : n=8; D=4; M=7; N=3;
i12 : randomMonomialIdeals(n,D,M,N)

                         2           2       2         2             2      
o12 = {monomialIdeal (x x x , x x , x x x , x x x , x x x , x x x , x x x ),
                       1 4 5   4 6   2 5 6   1 2 7   1 3 7   1 5 7   2 3 8  
      -----------------------------------------------------------------------
                        3             2                             2   
      monomialIdeal (x x , x x x x , x x x , x x x x , x x x x , x x x ,
                      2 3   1 3 4 6   2 5 6   1 3 5 6   2 3 5 7   2 7 8 
      -----------------------------------------------------------------------
           2                     2       2       3     2         3
      x x x ), monomialIdeal (x x , x , x x x , x x , x x x , x x )}
       3 5 8                   2 4   7   1 3 8   3 8   1 5 8   1 8

o12 : List

Note that each generating set of each ideal has at most $M = 7$ monomials. If one monomial divides another monomial that was generated, it will not be in the generating set.

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 i-th entry is the probability of including a monomial of degree i in the monomial set, or it is a list of nonnegative integers whose i-th 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 randomMonomialSet generates the set utilizing the graded Erdos-Renyi-type model: select each monomial of degree $1\le d\le D$, independently, with probability $p_d$.

i13 : randomMonomialIdeals(2,3,{0.0, 1.0, 1.0},1)

                       2         2
o13 = {monomialIdeal (x , x x , x )}
                       1   1 2   2

o13 : List

Note that no monomials of degree 1 were generated, since the first probability vector entry, $p_1$, is 0.

If $M=M_1,\dots,M_D$ is a list of integers of length $D$, then the function creates a list of objects of type MonomialIdeal, where at most $M_d$ monomials are of degree $d$.

i14 : randomMonomialIdeals(3,3,{1,1,1},1)

                       3
o14 = {monomialIdeal (x , x )}
                       1   2

o14 : List

Observe that there are at most one degree-1, one degree-2, and one degree-3 monomials generating each ideal.

If Strategy=>"ER", which is the default setting for the graded fixed number of generators version of the function, each set of monomials used to generate a monomial ideal in the list is not necessarily minimal. Else if Strategy=> "Minimal" then each monomial ideal in the list is generated by minimal sets of $M_d$ monomials, or maximum number possible, of total degree $d$, starting from the smallest degree.

i15 : randomMonomialIdeals(3,3,{1,1,1},1, Strategy=>"Minimal")

                       2     2
o15 = {monomialIdeal (x , x x , x )}
                       1   1 2   3

o15 : List

Observe that there are at most one degree-1, one degree-2, and one degree-3 monomials generating each ideal. Also observe that Strategy=>"Minimal" generally gives more generators than the default Strategy=>"ER".

Caveat

Since the function returns a list of objects of type MonomialIdeals, only the minimal generating set will be displayed. In contrast, the function randomMonomialSet will display the full (not necessarily minimal) generating set produced by the model.

See also

Ways to use randomMonomialIdeals :

For the programmer

The object randomMonomialIdeals is a method function with options.