This is RandomIdeals.info, produced by Macaulay2, version 1.21

RandomIdeals -- A package to construct various sorts of random ideals
*********************************************************************

Description
===========

This package can be used to make experiments, trying many ideals, perhaps over
small fields. For example...what would you expect the regularities of "typical"
monomial ideals with 10 generators of degree 3 in 6 variables to be? Try a
bunch of examples -- it's fast. Here we do only 500 -- this takes about a
second on a fast machine -- but with a little patience, thousands can be done
conveniently.

+-----------------------------------------------------------------------------+
|i1 : setRandomSeed(currentTime())                                            |
|                                                                             |
|o1 = 1671054204                                                              |
+-----------------------------------------------------------------------------+
|i2 : kk=ZZ/101;                                                              |
+-----------------------------------------------------------------------------+
|i3 : S=kk[vars(0..5)];                                                       |
+-----------------------------------------------------------------------------+
|i4 : time tally for n from 1 to 500 list regularity                          |
|     -- used 3.91656 seconds                                                 |
|                                                                             |
|o4 = Tally{4 => 42 }                                                         |
|           5 => 201                                                          |
|           6 => 189                                                          |
|           7 => 58                                                           |
|           8 => 9                                                            |
|           9 => 1                                                            |
|                                                                             |
|o4 : Tally                                                                   |
|-----------------------------------------------------------------------------|
|randomMonomialIdeal(10:3,S)                                                  |
+-----------------------------------------------------------------------------+

How does this compare with the case of binomial ideals? or pure binomial
ideals? We invite the reader to experiment, replacing "randomMonomialIdeal"
above with "randomBinomialIdeal" or "randomPureBinomialIdeal", or taking larger
numbers of examples. Click the link "Finding Extreme Examples" below to see
some other, more elaborate ways to search.

See also
========

  * Finding Extreme Examples -- Ways to use
    random ideals to search for (counter)-examples
  * randomIdeal -- randomIdeal made from a given set of
    monomials
  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators
  * randomSquareFreeStep -- A step in a random
    walk with uniform distribution over all monomial ideals
  * randomBinomialIdeal -- randomBinomialIdeal with
    binomials of given degrees
  * randomPureBinomialIdeal, --
    randomPureBinomialIdeal with binomials of given degrees
  * randomSparseIdeal -- randomSparseIdeal made from
    a given set of monomials
  * randomElementsFromIdeal -- Chooses random
    elements of given degrees in a given ideal.
  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomShellableIdeal -- Produces a ideal from
    a random shellable simplicial complex
  * randomShellableIdealChain -- Produces a
    chain of ideals from a random shelling
  * randomShelling -- produces a random chain of
    shellable complexes

Authors
=======

  * Katie Ansaldi <kansaldi@gmail.com>
  * David Eisenbud (see http://www.msri.org/~de ) <de@msri.org>
  * Robert Krone (see http://rckr.one ) <rckrone@gmail.com>
  * Jay Yang <jkelleyy@gmail.com>

Version
=======

This documentation describes version 2.0 of RandomIdeals.

Source code
===========

The source code from which this documentation is derived is in the file
RandomIdeals.m2 (see common/share/Macaulay2/RandomIdeals.m2 ).

Exports
=======

  * Functions and commands
      * idealChainFromShelling -- Produces
        chains of ideals from a shelling.
      * idealFromShelling -- Produces an ideal from a
        shelling
      * isShelling -- determines whether a list represents a
        shelling of a simplicial complex.
      * randomAddition -- Adds a random facet to a
        shellable complex
      * randomBinomialEdgeIdeal -- Creates a
        binomial edge ideal from a random graph with n vertices and t edges.
      * randomBinomialIdeal -- randomBinomialIdeal
        with binomials of given degrees
      * randomEdgeIdeal -- Creates an edge ideal from a
        random graph with n vertices and t edges.
      * randomElementsFromIdeal -- Chooses
        random elements of given degrees in a given ideal.
      * randomIdeal -- randomIdeal made from a given set of
        monomials
      * randomMonomial -- Choose a random monomial of
        given degree in a given ring
      * randomMonomialIdeal -- random monomial
        ideal with given degree generators
      * randomPureBinomialIdeal, --
        randomPureBinomialIdeal with binomials of given degrees
      * randomShellableIdeal -- Produces a ideal
        from a random shellable simplicial complex
      * randomShellableIdealChain -- Produces
        a chain of ideals from a random shelling
      * randomShelling -- produces a random chain of
        shellable complexes
      * randomSparseIdeal -- randomSparseIdeal made
        from a given set of monomials
      * randomSquareFreeMonomialIdeal, --
        random square-free monomial ideal with given degree generators
      * randomSquareFreeStep -- A step in a random
        walk with uniform distribution over all monomial ideals
      * randomToricEdgeIdeal -- Creates a toric
        edge ideal from a random graph with n vertices and t edges.
      * regSeq -- regular sequence of powers of the variables,
        in given degrees
      * squareFree -- ideal of all square-free monomials of
        given degree
  * Methods
      * "idealChainFromShelling(List)" -- see idealChainFromShelling,
        -- Produces chains of ideals from a shelling.
      * "idealChainFromShelling(Ring,List)" -- see
        idealChainFromShelling, -- Produces chains of
        ideals from a shelling.
      * "idealFromShelling(List)" -- see idealFromShelling,
        -- Produces an ideal from a shelling
      * "idealFromShelling(Ring,List)" -- see idealFromShelling,
        -- Produces an ideal from a shelling
      * "isShelling(List)" -- see isShelling, -- determines
        whether a list represents a shelling of a simplicial complex.
      * "randomAddition(Ring,ZZ,List)" -- see randomAddition,
        -- Adds a random facet to a shellable complex
      * "randomAddition(ZZ,ZZ,List)" -- see randomAddition,
        -- Adds a random facet to a shellable complex
      * "randomBinomialEdgeIdeal(ZZ,ZZ)" -- see randomBinomialEdgeIdeal,
        -- Creates a binomial edge ideal from a random
        graph with n vertices and t edges.
      * "randomBinomialIdeal(List,Ring)" -- see randomBinomialIdeal,
        -- randomBinomialIdeal with binomials of given
        degrees
      * "randomBinomialIdeal(Sequence,Ring)" -- see randomBinomialIdeal,
        -- randomBinomialIdeal with binomials of given
        degrees
      * "randomEdgeIdeal(ZZ,ZZ)" -- see randomEdgeIdeal,
        -- Creates an edge ideal from a random graph with n vertices and t
        edges.
      * "randomElementsFromIdeal(List,Ideal)" -- see
        randomElementsFromIdeal, -- Chooses random
        elements of given degrees in a given ideal.
      * "randomIdeal(List,Matrix)" -- see randomIdeal, --
        randomIdeal made from a given set of monomials
      * "randomIdeal(Sequence,Matrix)" -- see randomIdeal,
        -- randomIdeal made from a given set of monomials
      * "randomMonomial(ZZ,Ring)" -- see randomMonomial,
        -- Choose a random monomial of given degree in a given ring
      * "randomMonomialIdeal(List,Ring)" -- see randomMonomialIdeal,
        -- random monomial ideal with given degree
        generators
      * "randomMonomialIdeal(Sequence,Ring)" -- see randomMonomialIdeal,
        -- random monomial ideal with given degree
        generators
      * "randomPureBinomialIdeal(List,Ring)" -- see
        randomPureBinomialIdeal, --
        randomPureBinomialIdeal with binomials of given degrees
      * "randomPureBinomialIdeal(Sequence,Ring)" -- see
        randomPureBinomialIdeal, --
        randomPureBinomialIdeal with binomials of given degrees
      * "randomShellableIdeal(Ring,ZZ,ZZ)" -- see randomShellableIdeal,
        -- Produces a ideal from a random shellable
        simplicial complex
      * "randomShellableIdealChain(Ring,ZZ)" -- see
        randomShellableIdealChain, -- Produces a
        chain of ideals from a random shelling
      * "randomShellableIdealChain(Ring,ZZ,ZZ)" -- see
        randomShellableIdealChain, -- Produces a
        chain of ideals from a random shelling
      * "randomShelling(Ring,ZZ)" -- see randomShelling,
        -- produces a random chain of shellable complexes
      * "randomShelling(Ring,ZZ,ZZ)" -- see randomShelling,
        -- produces a random chain of shellable complexes
      * "randomShelling(ZZ,ZZ)" -- see randomShelling, --
        produces a random chain of shellable complexes
      * "randomShelling(ZZ,ZZ,ZZ)" -- see randomShelling,
        -- produces a random chain of shellable complexes
      * "randomSparseIdeal(Matrix,ZZ,ZZ)" -- see randomSparseIdeal,
        -- randomSparseIdeal made from a given set of
        monomials
      * "randomSquareFreeMonomialIdeal(List,Ring)" -- see
        randomSquareFreeMonomialIdeal, -- random
        square-free monomial ideal with given degree generators
      * "randomSquareFreeMonomialIdeal(Sequence,Ring)" -- see
        randomSquareFreeMonomialIdeal, -- random
        square-free monomial ideal with given degree generators
      * "randomSquareFreeStep(Ideal)" -- see randomSquareFreeStep,
        -- A step in a random walk with uniform
        distribution over all monomial ideals
      * "randomSquareFreeStep(List)" -- see randomSquareFreeStep,
        -- A step in a random walk with uniform
        distribution over all monomial ideals
      * "randomSquareFreeStep(MonomialIdeal)" -- see
        randomSquareFreeStep, -- A step in a random walk
        with uniform distribution over all monomial ideals
      * "randomToricEdgeIdeal(ZZ,ZZ)" -- see randomToricEdgeIdeal,
        -- Creates a toric edge ideal from a random graph
        with n vertices and t edges.
      * "regSeq(List,Ring)" -- see regSeq, -- regular sequence of
        powers of the variables, in given degrees
      * "regSeq(Sequence,Ring)" -- see regSeq, -- regular
        sequence of powers of the variables, in given degrees
      * squareFree(ZZ,Ring) -- ideal of all
        square-free monomials of given degree
  * Symbols
      * AlexanderProbability -- option to
        randomSquareFreeStep

For the programmer
==================

The object RandomIdeals, is a package (Macaulay2Doc).

AlexanderProbability -- option to randomSquareFreeStep
******************************************************

Synopsis
========

  * Usage:
        M = randomSquareFreeStep(L, AlexanderProbability => p)
  * Inputs:
      * p, a real number (Macaulay2Doc), real number between 0 and 1.

Description
===========

Controls how often the Alexander dual is taken

See also
========

  * randomSquareFreeStep -- A step in a random
    walk with uniform distribution over all monomial ideals

Functions with optional argument named AlexanderProbability :
=============================================================

  * "randomSquareFreeStep(...,AlexanderProbability=>...)" -- see
    randomSquareFreeStep, -- A step in a random walk with
    uniform distribution over all monomial ideals

For the programmer
==================

The object AlexanderProbability, is a symbol (Macaulay2Doc).

Finding Extreme Examples -- Ways to use random ideals to search for (counter)-examples
**************************************************************************************

A common use of Macaulay2 is to look for extreme or particularly interesting
examples. Here are some examples of how this may be done.

Supposing first that some space of examples is finite; for example, we might be
interested in monomial ideals with a certain number of generators of a certain
degree d. Suppose, to be concrete, that we want to compare the maximum degree
of a first syzygy with the regularity of the ideal, and also with the maximum
degree of the last syzygy. (To make the comparison interesting, it seems
reasonable to subtract i from the maximum degree of an i-th syzygy.)

We may have no idea where to look for extreme examples, and it seems that
examples with small numbers of variables and generators may not show the range
of phenomena that actually occur. In large degree there may be too many
examples to search systematically; so instead we may choose many examples at
random, and hope to see a pattern.

Here is a simple example First we tally the projective dimensions of 500 random
square-free monomial ideals (what's the average?), then looking how big the
difference between the regularity of R/I and the "relation degree"-2 can be. It
turns out this the differences are rather small, only 1 in a typical run of
5000. So one might look for ideals with a difference of 2, as in the following
(in a real run, one would make the number of iterations much bigger; here we
keep it small so that Macaulay2 doesn't take too long to build it's
documentation files.)

+-----------------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                               |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : S=kk[vars(0..5)]                                                        |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : L=for n from 1 to 100 list res randomSquareFreeMonomialIdeal(10:3,S);   |
+-----------------------------------------------------------------------------+
|i4 : tally apply(L, F -> length F)                                           |
|                                                                             |
|o4 = Tally{3 => 34}                                                          |
|           4 => 66                                                           |
|                                                                             |
|o4 : Tally                                                                   |
+-----------------------------------------------------------------------------+
|i5 : tally apply(L, F -> regularity F - ((max flatten degrees F_2) - 2))     |
|                                                                             |
|o5 = Tally{0 => 94}                                                          |
|           1 => 6                                                            |
|                                                                             |
|o5 : Tally                                                                   |
+-----------------------------------------------------------------------------+
|i6 : L=for n from 1 to 500 list res randomSquareFreeMonomialIdeal(10:3,S);   |
+-----------------------------------------------------------------------------+
|i7 : scan(L, F -> if 1<(regularity F - (max flatten degrees F_2) + 2) then   |
|-----------------------------------------------------------------------------|
|print F.dd_1)                                                                |
+-----------------------------------------------------------------------------+

A typical problem might be to find how high the regularity of R/I can be when R
has reasonably few variables, and the degrees of the generators of I are
reasonably small; despite the wild examples of Mayr-Mayer, we don't know how to
make examples with large regularity without letting the number of variables
become large. The following program computes "rep" examples of random ideals
with monomial and binomial generators, and prints any whose regularity exceeds
the number "bound"

looper = (rep,bound, L1, L2) -> (for i from 1 to rep do ( if i % 1000 == 0 then
<< "." << flush; J := randomMonomialIdeal(L1,S) + randomBinomialIdeal(L2,S); m
:= regularity coker gens J; if m >= bound then << "reg " << m << " " <<
toString J << endl;))

For example: kk=ZZ/2 S=kk[a,b,c,d] looper(30000,10,{4},{4,4}) -- finds examples
with on monomial of degree 4 and 2 binomials of degree 4. The largest largest
regularity it has found (and the largest I know for an ideal in 4 variables of
degree 4) is 14. Here is an example it found: ideal(a*b^3,a^4+b^4,b*c^3+a*d^3)

Similarly:

looper(30000,10,{4,4},{4}) -- looks for examples with 2 monomials and 1
binomial of degree 4. Suggestively, the largest regularity it found was also
14: betti res ideal(c^4,b^4,a^3*c+b*d^3) -- reg 14

A more sophisticated and difficult situation arises when the space of examples
is not necessarily finite (except over a finite field) but is a unirational
variety (such as the space of ideals generated by (at most) a certain number of
forms of certain given degrees, or the space of smooth curves of genus g for
some g <= 14) one may be able to do a search for random examples, taking a
rational parametrization of the space of examples and plugging in random
inputs.

If the "interesting" examples live in a subvariety whose codimension is small,
then, working over a small field (say 2,3, or 5 elements) one might hope to see
elements of the subvariety "not too rarely". This principle has been used to
good effect for example by (Caviglia and Decker-Schreyer, ****--Schreyer).

See also
========

  * randomIdeal -- randomIdeal made from a given set of
    monomials
  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators
  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomBinomialIdeal -- randomBinomialIdeal with
    binomials of given degrees
  * randomPureBinomialIdeal, --
    randomPureBinomialIdeal with binomials of given degrees

idealChainFromShelling -- Produces chains of ideals from a shelling.
********************************************************************

Synopsis
========

  * Usage:
        L = idealChainFromShelling(P)
        L = idealChainFromShelling(R,P)
  * Inputs:
      * R, a ring (Macaulay2Doc), Polynomial ring
      * P, a list (Macaulay2Doc), A (possibly impure) shelled
        simplicial complex, represented by a list of lists of integers. Each
        list of integers is a facet of the complex and the order is a shelling.
        If the ring R is specified, the output is a list of ideals in R; else
        it is a list of ideals in QQ[x_0..x_{n-1}], where n is the maximum
        number of elements in one of the lists of integers
  * Outputs:
      * L, a list (Macaulay2Doc), a list of ideals

Description
===========

Outputs the Stanley-Reisner ideal for each successive simplicial complex formed
by truncating the shelling.

+-----------------------------------------------------------------------------+
|i1 : P =  {{1, 2, 4}, {0, 1, 4}, {0, 2, 4}, {0, 3, 4}};                      |
+-----------------------------------------------------------------------------+
|i2 : idealChainFromShelling(P)                                               |
|                                                                             |
|o2 = {monomialIdeal (x , x ), monomialIdeal (x x , x ), monomialIdeal        |
|                      0   3                   0 2   3                        |
|     ------------------------------------------------------------------------|
|     (x x x , x ), monomialIdeal (x x x , x x , x x )}                       |
|       0 1 2   3                   0 1 2   1 3   2 3                         |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * idealFromShelling -- Produces an ideal from a
    shelling
  * randomShellableIdealChain -- Produces a
    chain of ideals from a random shelling

Ways to use idealChainFromShelling :
====================================

  * "idealChainFromShelling(List)"
  * "idealChainFromShelling(Ring,List)"

For the programmer
==================

The object idealChainFromShelling, is a
method function (Macaulay2Doc).

idealFromShelling -- Produces an ideal from a shelling
******************************************************

Synopsis
========

  * Usage:
        I = idealFromShelling(P)
        I = idealFromShelling(S,P)
  * Inputs:
      * S, a ring (Macaulay2Doc), (If omitted, it will use
        S=QQ[x_0..x_{n-1}] where n is the maximum integer in the lists of P.
      * P, a list (Macaulay2Doc), A list of lists of integers.
        Each list of integers is a facet of the complex and the order is a
        shelling.
      * S, a ring (Macaulay2Doc), (If omitted, it will use
        S=QQ[x_0..x_{n-1}] where n is the maximum integer in the lists of P.
  * Outputs:
      * I, an ideal (Macaulay2Doc), generated by the monomials
        representing the minimal nonfaces of P

Description
===========

This gives the Stanley-Reisner ideal for the simplicial complex, that is the
ideal generated by the monomials representing the minimal nonfaces of P.

+-------------------------------------------------------+
|i1 : S = QQ[x_0,x_1,x_2,x_3,x_4]                       |
|                                                       |
|o1 = S                                                 |
|                                                       |
|o1 : PolynomialRing                                    |
+-------------------------------------------------------+
|i2 : P =  {{1, 2, 4}, {0, 1, 4}, {0, 2, 4}, {0, 3, 4}};|
+-------------------------------------------------------+
|i3 : idealFromShelling(S,P)                            |
|                                                       |
|o3 = monomialIdeal (x x x , x x , x x )                |
|                     0 1 2   1 3   2 3                 |
|                                                       |
|o3 : MonomialIdeal of S                                |
+-------------------------------------------------------+

See also
========

  * idealChainFromShelling -- Produces chains of
    ideals from a shelling.
  * randomShellableIdeal -- Produces a ideal from
    a random shellable simplicial complex

Ways to use idealFromShelling :
===============================

  * "idealFromShelling(List)"
  * "idealFromShelling(Ring,List)"

For the programmer
==================

The object idealFromShelling, is a method function (Macaulay2Doc).

isShelling -- determines whether a list represents a shelling of a simplicial complex.
**************************************************************************************

Synopsis
========

  * Usage:
        b = isShelling(P)
  * Inputs:
      * P, a list (Macaulay2Doc), A list of lists of integers.
        Each list of integers is a facet of the complex and the order is a
        possible shelling.
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if and only if P
        is a shelling.

Description
===========

An ordering $F_1,..F_d$ of the facets of a simplicial complex $P$ is shellable
if $(F_1 \cup .. \cup F_{k-1}) \cap F_k$ is pure of dim$F_k -1$ for all $k =
2,..,d$. Determines if a list of faces is a shelling order of the simplicial
complex.

+-----------------------------------+
|i1 : P = {{1, 2, 3}, {1, 2, 5}};   |
+-----------------------------------+
|i2 : isShelling(P)                 |
|                                   |
|o2 = true                          |
+-----------------------------------+
|i3 : Q = {{1,2,3},{3,4,5},{2,3,4}};|
+-----------------------------------+
|i4 : isShelling(Q)                 |
|                                   |
|o4 = false                         |
+-----------------------------------+

Ways to use isShelling :
========================

  * "isShelling(List)"

For the programmer
==================

The object isShelling, is a method function (Macaulay2Doc).

randomAddition -- Adds a random facet to a shellable complex
************************************************************

Synopsis
========

  * Usage:
        p=randomAddition(n,m,P)
        p=randomAddition(R,m,P)
  * Inputs:
      * n, an integer (Macaulay2Doc), the number of vertices (if a
        ring is specified, n is the number of variables.
      * m, an integer (Macaulay2Doc), the dimension of the new facet
      * P, a list (Macaulay2Doc), A list of lists of integers.
        Each list of integers is a facet of the complex and the order is a
        shelling.
      * R, a ring (Macaulay2Doc), A polynomial ring.
  * Outputs:
      * p, a list (Macaulay2Doc), A list of lists of integers.
        Each list of integers is a facet of the complex and the order is a
        shelling.

Description
===========

This function randomly chooses a facet of size m+1 and checks whether the facet
can be shellably added to the shelling. If it can be shellably added to the
shelling, it is added to the shelling and the new shelling is returned.
Otherwise, the process repeats up to 20 times.

This function can be used to randomly construct non-pure shellable complexes.
A new m-simplex can only be glued to previous simplices of dimension at least
m.  If all previous simplices are smaller, then the addition will fail.

+-----------------------------------+
|i1 : P={{1,2,3}}                   |
|                                   |
|o1 = {{1, 2, 3}}                   |
|                                   |
|o1 : List                          |
+-----------------------------------+
|i2 : P=randomAddition(6,2,P)       |
|                                   |
|o2 = {{1, 2, 3}, {0, 1, 2}}        |
|                                   |
|o2 : List                          |
+-----------------------------------+
|i3 : P=randomAddition(6,1,P)       |
|                                   |
|o3 = {{1, 2, 3}, {0, 1, 2}, {0, 1}}|
|                                   |
|o3 : List                          |
+-----------------------------------+

Caveat
======

If the input is not a shellable simplicial complex, the new complex will not be
shellable. The function does not check whether the input is shellable.

See also
========

  * randomShelling -- produces a random chain of
    shellable complexes
  * idealChainFromShelling -- Produces chains of
    ideals from a shelling.
  * idealFromShelling -- Produces an ideal from a
    shelling

Ways to use randomAddition :
============================

  * "randomAddition(Ring,ZZ,List)"
  * "randomAddition(ZZ,ZZ,List)"

For the programmer
==================

The object randomAddition, is a method function (Macaulay2Doc).

randomBinomialEdgeIdeal -- Creates a binomial edge ideal from a random graph with n vertices and t edges.
*********************************************************************************************************

Synopsis
========

  * Usage:
        (I,G) = randomBinomialEdgeIdeal(n,t)
  * Inputs:
      * n, an integer (Macaulay2Doc), number of vertices
      * t, an integer (Macaulay2Doc), number of edges
  * Outputs:
      * I, an ideal (Macaulay2Doc), a random binomial edge ideal
      * G, a graph (EdgeIdeals), the graph underlying I

Description
===========

The binomial edge ideal associated to a graph G is the quadratic binomial ideal
generated by the set containing x_v*y_w-x_w-y_v for every edge (v,w) in G. This
method returns the binomial edge ideal I of a random graph G which has n
vertices and t edges.

+-----------------------------------------------------------------------------+
|i1 : randomBinomialEdgeIdeal(7, 4)                                           |
|                                                                             |
|o1 = (ideal (- x y  + x y , - x y  + x y , x y  - x y , x y  - x y ),        |
|                3 4    4 3     3 5    5 3   4 1    1 4   6 7    7 6          |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|     ------------------------------------------------------------------------|
|     Graph{edges => {{x , x }, {x , x }, {x , x }, {x , x }}})               |
|                       3   4     1   4     6   7     3   5                   |
|           ring => QQ[x ..x ]                                                |
|                       1   7                                                 |
|           vertices => {x , x , x , x , x , x , x }                          |
|                         1   2   3   4   5   6   7                           |
|                                                                             |
|o1 : Sequence                                                                |
+-----------------------------------------------------------------------------+

See also
========

  * randomGraph (EdgeIdeals) -- returns a random graph
  * binomialEdgeIdeal (BinomialEdgeIdeals) -- Binomial
    edge ideals
  * randomToricEdgeIdeal -- Creates a toric edge
    ideal from a random graph with n vertices and t edges.

Ways to use randomBinomialEdgeIdeal :
=====================================

  * "randomBinomialEdgeIdeal(ZZ,ZZ)"

For the programmer
==================

The object randomBinomialEdgeIdeal, is a
method function (Macaulay2Doc).

randomBinomialIdeal -- randomBinomialIdeal with binomials of given degrees
**************************************************************************

Synopsis
========

  * Usage:
        I = randomBinomialIdeal(L,S)
  * Inputs:
      * L, a list (Macaulay2Doc), or sequence of positive integers
      * S, a ring (Macaulay2Doc), Polynomial ring
  * Outputs:
      * I, an ideal (Macaulay2Doc), generated by random binomials
        of the given degrees

Description
===========

+-----------------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                               |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : S=kk[a..e]                                                              |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : L={3,3,4,6}                                                             |
|                                                                             |
|o3 = {3, 3, 4, 6}                                                            |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : I=randomBinomialIdeal(L,S)                                              |
|                                                                             |
|                         2     2               2           2   4             |
|o4 = ideal (a*b*d - 14b*e , b*c  - 16a*b*e, a*b e - 43c*d*e , a b*e -        |
|     ------------------------------------------------------------------------|
|        2   3                                                                |
|     42b d*e )                                                               |
|                                                                             |
|o4 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+

Caveat
======

The binomials are generated one at a time, and there is no checking to see
whether the ideal returned is minally generated by fewer elements, so the
number of minimal generators may not be what you expect.

See also
========

  * randomIdeal -- randomIdeal made from a given set of
    monomials
  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators
  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomPureBinomialIdeal, --
    randomPureBinomialIdeal with binomials of given degrees
  * randomElementsFromIdeal -- Chooses random
    elements of given degrees in a given ideal.

Ways to use randomBinomialIdeal :
=================================

  * "randomBinomialIdeal(List,Ring)"
  * "randomBinomialIdeal(Sequence,Ring)"

For the programmer
==================

The object randomBinomialIdeal, is a method function (Macaulay2Doc).

randomEdgeIdeal -- Creates an edge ideal from a random graph with n vertices and t edges.
*****************************************************************************************

Synopsis
========

  * Usage:
        (I,G) = randomEdgeIdeal(n,t)
  * Inputs:
      * n, an integer (Macaulay2Doc), number of vertices
      * t, an integer (Macaulay2Doc), number of edges
  * Outputs:
      * I, an ideal (Macaulay2Doc), a random edge ideal
      * G, a graph (EdgeIdeals), the graph underlying I

Description
===========

The edge ideal of a graph is the quadratic monomial ideal generated by x_v*x_w
for all edges (v,w) in the graph. This method returns the edge ideal I of a
random graph G which has n vertices and t edges.

+-----------------------------------------------------------------------------+
|i1 : randomEdgeIdeal(7, 4)                                                   |
|                                                                             |
|o1 = (Graph{edges => {{x , x }, {x , x }, {x , x }, {x , x }}}, monomialIdeal|
|                        3   4     1   4     6   7     3   5                  |
|            ring => QQ[x ..x ]                                               |
|                        1   7                                                |
|            vertices => {x , x , x , x , x , x , x }                         |
|                          1   2   3   4   5   6   7                          |
|     ------------------------------------------------------------------------|
|     (x x , x x , x x , x x ))                                               |
|       1 4   3 4   3 5   6 7                                                 |
|                                                                             |
|o1 : Sequence                                                                |
+-----------------------------------------------------------------------------+

See also
========

  * randomGraph (EdgeIdeals) -- returns a random graph
  * edgeIdeal (EdgeIdeals) -- creates the edge ideal of a
    (hyper)graph

Ways to use randomEdgeIdeal :
=============================

  * "randomEdgeIdeal(ZZ,ZZ)"

For the programmer
==================

The object randomEdgeIdeal, is a method function (Macaulay2Doc).

randomElementsFromIdeal -- Chooses random elements of given degrees in a given ideal.
*************************************************************************************

Synopsis
========

  * Usage:
        I = randomElementsFromIdeal(L,I)
  * Inputs:
      * L, a list (Macaulay2Doc), of integers
      * I, an ideal (Macaulay2Doc), that should be homogeneous
  * Outputs:
      * I, an ideal (Macaulay2Doc), generated by (at most) n
        homogeneous polynomials that are random linear combination of the
        generators of I, with degrees specified by the list L

Description
===========

+--------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                      |
|                                                                    |
|o1 = kk                                                             |
|                                                                    |
|o1 : QuotientRing                                                   |
+--------------------------------------------------------------------+
|i2 : S=kk[a..c]                                                     |
|                                                                    |
|o2 = S                                                              |
|                                                                    |
|o2 : PolynomialRing                                                 |
+--------------------------------------------------------------------+
|i3 : L={3,3,4,6}                                                    |
|                                                                    |
|o3 = {3, 3, 4, 6}                                                   |
|                                                                    |
|o3 : List                                                           |
+--------------------------------------------------------------------+
|i4 : I = ideal(a^3,b^3, c^3)                                        |
|                                                                    |
|             3   3   3                                              |
|o4 = ideal (a , b , c )                                             |
|                                                                    |
|o4 : Ideal of S                                                     |
+--------------------------------------------------------------------+
|i5 : J=randomElementsFromIdeal(L,I)                                 |
|                                                                    |
|             3      3   3      3     3        3      4     5      6 |
|o5 = ideal (b  - 45c , a  - 26c , a*c  + 38b*c  + 34c , b*c  - 32c )|
|                                                                    |
|o5 : Ideal of S                                                     |
+--------------------------------------------------------------------+

See also
========

  * Finding Extreme Examples -- Ways to use
    random ideals to search for (counter)-examples
  * randomIdeal -- randomIdeal made from a given set of
    monomials
  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators
  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomBinomialIdeal -- randomBinomialIdeal with
    binomials of given degrees
  * randomPureBinomialIdeal, --
    randomPureBinomialIdeal with binomials of given degrees

Ways to use randomElementsFromIdeal :
=====================================

  * "randomElementsFromIdeal(List,Ideal)"

For the programmer
==================

The object randomElementsFromIdeal, is a
method function (Macaulay2Doc).

randomIdeal -- randomIdeal made from a given set of monomials
*************************************************************

Synopsis
========

  * Usage:
        I = randomIdeal(L,m)
  * Inputs:
      * L, a list (Macaulay2Doc), or sequence of positive integers
      * m, a matrix (Macaulay2Doc), 1xn matrix of homogeneous
        polynomials in a ring S
  * Outputs:
      * I, an ideal (Macaulay2Doc), generated by random linear
        combinations of degrees given by L of the given polynomials

Description
===========

This function composes m with a random map from a free module with degrees
specified by L to the source of m.

+--------------------------------------------------------------+
|i1 : kk=ZZ/101                                                |
|                                                              |
|o1 = kk                                                       |
|                                                              |
|o1 : QuotientRing                                             |
+--------------------------------------------------------------+
|i2 : S=kk[a..e]                                               |
|                                                              |
|o2 = S                                                        |
|                                                              |
|o2 : PolynomialRing                                           |
+--------------------------------------------------------------+
|i3 : L={3,3,4,6}                                              |
|                                                              |
|o3 = {3, 3, 4, 6}                                             |
|                                                              |
|o3 : List                                                     |
+--------------------------------------------------------------+
|i4 : m = matrix{{a^3,b^4+c^4,d^5}}                            |
|                                                              |
|o4 = | a3 b4+c4 d5 |                                          |
|                                                              |
|             1       3                                        |
|o4 : Matrix S  <--- S                                         |
+--------------------------------------------------------------+
|i5 : I=randomIdeal(L,m)                                       |
|                                                              |
|             3   4    4     5        5        5      6     5  |
|o5 = ideal (a , b  + c , a*d  + 42b*d  - 27c*d  + 41d  - 2d e)|
|                                                              |
|o5 : Ideal of S                                               |
+--------------------------------------------------------------+

See also
========

  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators
  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomBinomialIdeal -- randomBinomialIdeal with
    binomials of given degrees
  * randomPureBinomialIdeal, --
    randomPureBinomialIdeal with binomials of given degrees
  * randomElementsFromIdeal -- Chooses random
    elements of given degrees in a given ideal.

Ways to use randomIdeal :
=========================

  * "randomIdeal(List,Matrix)"
  * "randomIdeal(Sequence,Matrix)"

For the programmer
==================

The object randomIdeal, is a method function (Macaulay2Doc).

randomMonomial -- Choose a random monomial of given degree in a given ring
**************************************************************************

Synopsis
========

  * Usage:
        m = randomMonomial(d,S)
  * Inputs:
      * d, an integer (Macaulay2Doc), non-negative
      * S, a ring (Macaulay2Doc), polynomial ring
  * Outputs:
      * m, a ring element (Macaulay2Doc), monomial of S

Description
===========

Chooses a random monomial.

+---------------------------------+
|i1 : setRandomSeed(currentTime())|
|                                 |
|o1 = 1671054225                  |
+---------------------------------+
|i2 : kk=ZZ/101                   |
|                                 |
|o2 = kk                          |
|                                 |
|o2 : QuotientRing                |
+---------------------------------+
|i3 : S=kk[a,b,c]                 |
|                                 |
|o3 = S                           |
|                                 |
|o3 : PolynomialRing              |
+---------------------------------+
|i4 : randomMonomial(3,S)         |
|                                 |
|        2                        |
|o4 = b*c                         |
|                                 |
|o4 : S                           |
+---------------------------------+

See also
========

  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators

Ways to use randomMonomial :
============================

  * "randomMonomial(ZZ,Ring)"

For the programmer
==================

The object randomMonomial, is a method function (Macaulay2Doc).

randomMonomialIdeal -- random monomial ideal with given degree generators
*************************************************************************

Synopsis
========

  * Usage:
        I = randomMonomialIdeal(L,S)
  * Inputs:
      * L, a list (Macaulay2Doc), or sequence of non-negative
        integers
      * S, a ring (Macaulay2Doc), Polynomial ring
  * Outputs:
      * I, an ideal (Macaulay2Doc), monomial ideal with generators
        of specified degrees

Description
===========

Choose a random ideal whose generators have the degrees specified by the list
or sequence L.

+-----------------------------------+
|i1 : kk=ZZ/101                     |
|                                   |
|o1 = kk                            |
|                                   |
|o1 : QuotientRing                  |
+-----------------------------------+
|i2 : S=kk[a..e]                    |
|                                   |
|o2 = S                             |
|                                   |
|o2 : PolynomialRing                |
+-----------------------------------+
|i3 : L={3,5,7}                     |
|                                   |
|o3 = {3, 5, 7}                     |
|                                   |
|o3 : List                          |
+-----------------------------------+
|i4 : randomMonomialIdeal(L, S)     |
|                                   |
|               2       3   6       |
|o4 = ideal (a*b , a*c*d , c e)     |
|                                   |
|o4 : Ideal of S                    |
+-----------------------------------+
|i5 : randomMonomialIdeal(5:2, S)   |
|                                   |
|                                 2 |
|o5 = ideal (a*c, a*d, a*b, c*e, c )|
|                                   |
|o5 : Ideal of S                    |
+-----------------------------------+

Caveat
======

The ideal is constructed degree by degree, starting from the lowest degree
specified. If there are not enough monomials of the next specified degree that
are not already in the ideal, the function prints a warning and returns an
ideal containing all the generators of that degree.

See also
========

  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators

Ways to use randomMonomialIdeal :
=================================

  * "randomMonomialIdeal(List,Ring)"
  * "randomMonomialIdeal(Sequence,Ring)"

For the programmer
==================

The object randomMonomialIdeal, is a method function (Macaulay2Doc).

randomPureBinomialIdeal -- randomPureBinomialIdeal with binomials of given degrees
**********************************************************************************

Synopsis
========

  * Usage:
        I = randomPureBinomialIdeal(L,S)
  * Inputs:
      * L, a list (Macaulay2Doc), or sequence of positive integers
      * S, a ring (Macaulay2Doc), Polynomial ring
  * Outputs:
      * I, an ideal (Macaulay2Doc), generated by random pure
        binomials (that is, differences of monomials without coefficients)  of
        the given degrees

Description
===========

+-------------------------------------------------------+
|i1 : kk=ZZ/101                                         |
|                                                       |
|o1 = kk                                                |
|                                                       |
|o1 : QuotientRing                                      |
+-------------------------------------------------------+
|i2 : S=kk[a..e]                                        |
|                                                       |
|o2 = S                                                 |
|                                                       |
|o2 : PolynomialRing                                    |
+-------------------------------------------------------+
|i3 : L={3,3,4,6}                                       |
|                                                       |
|o3 = {3, 3, 4, 6}                                      |
|                                                       |
|o3 : List                                              |
+-------------------------------------------------------+
|i4 : I=randomPureBinomialIdeal(L,S)                    |
|                                                       |
|                            2       2     2 3        4 |
|o4 = ideal (a*b*d - a*b*e, a b - b*e , c*d e  - a*c*e )|
|                                                       |
|o4 : Ideal of S                                        |
+-------------------------------------------------------+

Caveat
======

The binomials are generated one at a time, and there is no checking to see
whether the ideal returned is minally generated by fewer elements, so the
number of minimal generators may not be what you expect.

See also
========

  * randomIdeal -- randomIdeal made from a given set of
    monomials
  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators
  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomBinomialIdeal -- randomBinomialIdeal with
    binomials of given degrees
  * randomElementsFromIdeal -- Chooses random
    elements of given degrees in a given ideal.

Ways to use randomPureBinomialIdeal :
=====================================

  * "randomPureBinomialIdeal(List,Ring)"
  * "randomPureBinomialIdeal(Sequence,Ring)"

For the programmer
==================

The object randomPureBinomialIdeal, is a
method function (Macaulay2Doc).

randomShellableIdeal -- Produces a ideal from a random shellable simplicial complex
***********************************************************************************

Synopsis
========

  * Usage:
        I = randomShellableIdeal(R,m,k)
  * Inputs:
      * R, a ring (Macaulay2Doc), a polynomial ring
      * m, an integer (Macaulay2Doc), dimension of facets in
        shellable complex
      * k, an integer (Macaulay2Doc), the degree of the shellable
        complex
  * Outputs:
      * I, a monomial ideal (Macaulay2Doc), the
        Stanley-Reisner ideal of a random shellable complex

Description
===========

The Stanley-Reisner ideal of a shellable simplicial complex is always
Cohen-Macaulay; the converse is not true, although, to paraphrase Arnol'd,
square-free monomial ideals that have a serious reason to be Cohen-Macaulay
generally do come from shellable complexes.

The program makes a (Cohen-Macaulay) square-free monomial ideal from the
Stanley-Reisner ideal of a random shellable simplicial complex. simplicial
complex relies on the code for producing random shellable simplicial complexes;
see randomShelling for a description.

+-------------------------------------------+
|i1 : R = ZZ/101[x_0..x_4];                 |
+-------------------------------------------+
|i2 : I = randomShellableIdeal(R,2,6)       |
|                                           |
|o2 = monomialIdeal (x x , x x x , x x x x )|
|                     0 2   0 3 4   1 2 3 4 |
|                                           |
|o2 : MonomialIdeal of R                    |
+-------------------------------------------+

Caveat
======

No claim is made on the distribution of the ideal.

See also
========

  * randomShelling -- produces a random chain of
    shellable complexes
  * idealFromShelling -- Produces an ideal from a
    shelling
  * idealChainFromShelling -- Produces chains of
    ideals from a shelling.
  * randomShellableIdealChain -- Produces a
    chain of ideals from a random shelling

Ways to use randomShellableIdeal :
==================================

  * "randomShellableIdeal(Ring,ZZ,ZZ)"

For the programmer
==================

The object randomShellableIdeal, is a method function (Macaulay2Doc).

randomShellableIdealChain -- Produces a chain of ideals from a random shelling
******************************************************************************

Synopsis
========

  * Usage:
        L = randomShellableIdealChain(R,m,k)
        L = randomShellableIdealChain(R,m)
  * Inputs:
      * R, a ring (Macaulay2Doc), a polynomial ring
      * m, an integer (Macaulay2Doc), dimension of the facets in the
        shellable complex
      * k, an integer (Macaulay2Doc), the degree of the smallest
        ideal
  * Outputs:
      * L, a list (Macaulay2Doc), list of Stanley-Riesner ideals of
        the simplicial complexes of the truncations of the shelling.

Description
===========

+-----------------------------------------------------------------------------+
|i1 : R = ZZ/101[x_0..x_3];                                                   |
+-----------------------------------------------------------------------------+
|i2 : L = randomShellableIdealChain(R,1)                                      |
|                                                                             |
|o2 = {monomialIdeal (x , x ), monomialIdeal (x , x x ), monomialIdeal (x x , |
|                      0   1                   0   1 2                   0 1  |
|     ------------------------------------------------------------------------|
|     x x , x x ), monomialIdeal (x x , x x , x x x ), monomialIdeal (x x ,   |
|      0 2   1 2                   0 1   0 2   1 2 3                   0 2    |
|     ------------------------------------------------------------------------|
|     x x x , x x x ), monomialIdeal (x x x , x x x , x x x , x x x )}        |
|      0 1 3   1 2 3                   0 1 2   0 1 3   0 2 3   1 2 3          |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Caveat
======

No claim is made on the distribution of the ideal.

See also
========

  * randomShelling -- produces a random chain of
    shellable complexes
  * idealFromShelling -- Produces an ideal from a
    shelling
  * idealChainFromShelling -- Produces chains of
    ideals from a shelling.
  * randomShellableIdeal -- Produces a ideal from
    a random shellable simplicial complex

Ways to use randomShellableIdealChain :
=======================================

  * "randomShellableIdealChain(Ring,ZZ)"
  * "randomShellableIdealChain(Ring,ZZ,ZZ)"

For the programmer
==================

The object randomShellableIdealChain, is a
method function (Macaulay2Doc).

randomShelling -- produces a random chain of shellable complexes
****************************************************************

Synopsis
========

  * Usage:
        P=randomShelling(n,m)
        P=randomShelling(n,m,k)
        P=randomShelling(R,m)
        P=randomShelling(R,m,k)
  * Inputs:
      * n, an integer (Macaulay2Doc), the number of vertices
      * R, a ring (Macaulay2Doc), a polynomial ring with a variable
        for each vertex
      * m, an integer (Macaulay2Doc), the dimension of the facets
      * k, an integer (Macaulay2Doc), the number of facets (if
        omitted, the number will be n choose m+1)
  * Outputs:
      * P, a list (Macaulay2Doc), A list of lists of integers.
        Each list of integers is a facet of the complex and the order is a
        shelling.  If called with a Ring R instead of an integer n, each facet
        is represented by a square-free monomial instead of a list.

Description
===========

The function produces a list of facets of a random shellable simplicial
complex. The order of the facets is a shelling.

The algorithm works by choosing one of the previous facets at random, and
replacing one of its vertices with a new vertex chosen at random. If the choice
meets the criteria of a shelling, that facet is added to list, otherwise it is
discarded and the algorithm tries again. The first facet is chosen uniformly at
random.

The call randomShelling(n,m) produces a *complete* chain -- that is, a shelling
of the m-skeleton of the (n-1)-simplex, with the simplices listed in order, so
that any initial subsequence of length d gives a (random) shellable simplicial
complex with d facets.

The probability distribution for this random selection is presumably not the
uniform one; it would be nice to write a reversible markov chain that could be
used with the Metropolis algorithm to produce the uniform distribution, as is
done in randomSquareFreeStep, and the randomSquareFreeMonomialIdeal codes

+-----------------------------------------------------------------------------+
|i1 : P = randomShelling(6,3,10)                                              |
|                                                                             |
|o1 = {{1, 2, 4, 5}, {1, 2, 3, 5}, {0, 1, 2, 5}, {2, 3, 4, 5}, {1, 3, 4, 5},  |
|     ------------------------------------------------------------------------|
|     {0, 2, 4, 5}, {0, 2, 3, 5}, {0, 1, 2, 4}, {0, 3, 4, 5}, {0, 1, 2, 3}}   |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : Q = randomShelling(6,3)                                                 |
|                                                                             |
|o2 = {{0, 2, 3, 4}, {0, 1, 3, 4}, {0, 2, 3, 5}, {0, 1, 2, 3}, {0, 1, 3, 5},  |
|     ------------------------------------------------------------------------|
|     {0, 1, 2, 5}, {0, 1, 2, 4}, {1, 2, 3, 4}, {0, 2, 4, 5}, {0, 3, 4, 5},   |
|     ------------------------------------------------------------------------|
|     {1, 2, 4, 5}, {1, 2, 3, 5}, {0, 1, 4, 5}, {1, 3, 4, 5}, {2, 3, 4, 5}}   |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Caveat
======

No claim is made on the distribution of the random chain.

See also
========

  * randomAddition -- Adds a random facet to a shellable
    complex
  * idealChainFromShelling -- Produces chains of
    ideals from a shelling.
  * idealFromShelling -- Produces an ideal from a
    shelling
  * randomShellableIdeal -- Produces a ideal from
    a random shellable simplicial complex
  * randomSquareFreeStep -- A step in a random
    walk with uniform distribution over all monomial ideals
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators

Ways to use randomShelling :
============================

  * "randomShelling(Ring,ZZ)"
  * "randomShelling(Ring,ZZ,ZZ)"
  * "randomShelling(ZZ,ZZ)"
  * "randomShelling(ZZ,ZZ,ZZ)"

For the programmer
==================

The object randomShelling, is a method function (Macaulay2Doc).

randomSparseIdeal -- randomSparseIdeal made from a given set of monomials
*************************************************************************

Synopsis
========

  * Usage:
        I = randomSparseIdeal(B,s,n)
  * Inputs:
      * B, a matrix (Macaulay2Doc), 1xn matrix of monomials
      * s, an integer (Macaulay2Doc), positive integer, the number of
        terms in the generators of I
      * n, an integer (Macaulay2Doc), positive integer, the number of
        generators of I
  * Outputs:
      * I, an ideal (Macaulay2Doc), generated by n polynomials,
        each a random linear combination of s monomials

Description
===========

Each generator of I is formed by randomly choosing s (the sparsity) entries of
the matrix B and taking a random linear combinations with coefficients in the
(ultimate) coefficient ring of S, the ring in which the monomials lie.

+--------------------------------------------+
|i1 : kk=ZZ/101                              |
|                                            |
|o1 = kk                                     |
|                                            |
|o1 : QuotientRing                           |
+--------------------------------------------+
|i2 : S=kk[a..e]                             |
|                                            |
|o2 = S                                      |
|                                            |
|o2 : PolynomialRing                         |
+--------------------------------------------+
|i3 : L={3,3,4,6}                            |
|                                            |
|o3 = {3, 3, 4, 6}                           |
|                                            |
|o3 : List                                   |
+--------------------------------------------+
|i4 : B = matrix{{a^3,b^4,d^5,a*b*c,e}}      |
|                                            |
|o4 = | a3 b4 d5 abc e |                     |
|                                            |
|             1       5                      |
|o4 : Matrix S  <--- S                       |
+--------------------------------------------+
|i5 : I=randomSparseIdeal(B,3,2)             |
|                                            |
|             3             4                |
|o5 = ideal (a  + 35a*b*c, b  - 32a*b*c + 5e)|
|                                            |
|o5 : Ideal of S                             |
+--------------------------------------------+

See also
========

  * randomIdeal -- randomIdeal made from a given set of
    monomials
  * randomMonomialIdeal -- random monomial ideal
    with given degree generators
  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators
  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomBinomialIdeal -- randomBinomialIdeal with
    binomials of given degrees
  * randomPureBinomialIdeal, --
    randomPureBinomialIdeal with binomials of given degrees
  * randomElementsFromIdeal -- Chooses random
    elements of given degrees in a given ideal.

Ways to use randomSparseIdeal :
===============================

  * "randomSparseIdeal(Matrix,ZZ,ZZ)"

For the programmer
==================

The object randomSparseIdeal, is a method function (Macaulay2Doc).

randomSquareFreeMonomialIdeal -- random square-free monomial ideal with given degree generators
***********************************************************************************************

Synopsis
========

  * Usage:
        I = randomSquareFreeMonomialIdeal(L,S)
  * Inputs:
      * L, a list (Macaulay2Doc), or sequence of non-negative
        integers
      * S, a ring (Macaulay2Doc), Polynomial ring
  * Outputs:
      * I, an ideal (Macaulay2Doc), square-free monomial ideal
        with generators of specified degrees

Description
===========

Choose a random square-free monomial ideal whose generators have the degrees
specified by the list or sequence L.

+------------------------------------------+
|i1 : setRandomSeed(currentTime())         |
|                                          |
|o1 = 1671054276                           |
+------------------------------------------+
|i2 : kk=ZZ/101                            |
|                                          |
|o2 = kk                                   |
|                                          |
|o2 : QuotientRing                         |
+------------------------------------------+
|i3 : S=kk[a..e]                           |
|                                          |
|o3 = S                                    |
|                                          |
|o3 : PolynomialRing                       |
+------------------------------------------+
|i4 : L={3,5,7}                            |
|                                          |
|o4 = {3, 5, 7}                            |
|                                          |
|o4 : List                                 |
+------------------------------------------+
|i5 : randomSquareFreeMonomialIdeal(L, S)  |
|low degree gens generated everything      |
|                                          |
|o5 = ideal(b*d*e)                         |
|                                          |
|o5 : Ideal of S                           |
+------------------------------------------+
|i6 : randomSquareFreeMonomialIdeal(5:2, S)|
|                                          |
|o6 = ideal (a*c, b*e, c*e, b*c, d*e)      |
|                                          |
|o6 : Ideal of S                           |
+------------------------------------------+

Caveat
======

The ideal is constructed degree by degree, starting from the lowest degree
specified. If there are not enough monomials of the next specified degree that
are not already in the ideal, the function prints a warning and returns an
ideal containing all the generators of that degree.

See also
========

  * randomMonomial -- Choose a random monomial of given
    degree in a given ring
  * randomMonomialIdeal -- random monomial ideal
    with given degree generators

Ways to use randomSquareFreeMonomialIdeal :
===========================================

  * "randomSquareFreeMonomialIdeal(List,Ring)"
  * "randomSquareFreeMonomialIdeal(Sequence,Ring)"

For the programmer
==================

The object randomSquareFreeMonomialIdeal,
is a method function (Macaulay2Doc).

randomSquareFreeStep -- A step in a random walk with uniform distribution over all monomial ideals
**************************************************************************************************

Synopsis
========

  * Usage:
        M = randomSquareFreeStep(I)
        M = randomSquareFreeStep(I, AlexanderProbability => p)
        M = randomSquareFreeStep(L)
        M  = randomSquareFreeStep(L, AlexanderProbability => p)
  * Inputs:
      * I, an ideal (Macaulay2Doc), square-free monomial Ideal or
        MonomialIdeal
      * L, a list (Macaulay2Doc), {I,Igens,ISocgens} where I is a
        square-free MonomialIdeal, Igens is a List of its minimal generators,
        ISocgens is a List of the minimal generators of the socle mod I.
  * Optional inputs (Macaulay2Doc),:
      * AlexanderProbability => ..., default value .05
  * Outputs:
      * M, a list (Macaulay2Doc), {J,Jgens,JSocgens} where J is a
        square-free MonomialIdeal, Jgens is a List of its minimal generators,
        JSocgens is a List of the minimal generators of the socle mod J.

Description
===========

With probability p the routine takes the Alexander dual of I; the default value
of p is .05, and it can be set with the option AlexanderProbility.

Otherwise uses the Metropolis algorithm to produce a random walk on the space
of square-free ideals. Note that there are a LOT of square-free ideals; these
are the Dedekind numbers, and the sequence (with 1,2,3,4,5,6,7,8 variables)
begins 3,6,20,168,7581, 7828354, 2414682040998, 56130437228687557907788. (see
the Online Encyclopedia of Integer Sequences for more information). Given I in
a polynomial ring S, we make a list ISocgens of the square-free minimal
monomial generators of the socle of S/(squares+I) and a list of minimal
generators Igens of I. A candidate "next" ideal J is formed as follows: We
choose randomly from the union of these lists; if a socle element is chosen,
it's added to I; if a minimal generator is chosen, it's replaced by the
square-free part of the maximal ideal times it. the chance of making the given
move is then 1/(#ISocgens+#Igens), and the chance of making the move back would
be the similar quantity for J, so we make the move or not depending on whether
random RR < (nJ+nSocJ)/(nI+nSocI) or not; here random RR is a random number in
[0,1].

+-----------------------------------------------------------------------------+
|i1 : setRandomSeed(currentTime())                                            |
|                                                                             |
|o1 = 1671054256                                                              |
+-----------------------------------------------------------------------------+
|i2 : S=ZZ/2[vars(0..3)]                                                      |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : J = monomialIdeal"ab,ad, bcd"                                           |
|                                                                             |
|o3 = monomialIdeal (a*b, a*d, b*c*d)                                         |
|                                                                             |
|o3 : MonomialIdeal of S                                                      |
+-----------------------------------------------------------------------------+
|i4 : randomSquareFreeStep J                                                  |
|                                                                             |
|o4 = {monomialIdeal (a*b*c, a*d, b*c*d), {a*b*c, a*d, b*c*d}, {c*d, b*d, b*c,|
|     ------------------------------------------------------------------------|
|     a*c, a*b}}                                                              |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

With 4 variables and 168 possible monomial ideals, a run of 5000 takes less
than 6 seconds on a reasonably fast machine. With 10 variables a run of 1000
takes about 2 seconds.

+-----------------------------------------------------------------------------+
|i5 : setRandomSeed(1)                                                        |
|                                                                             |
|o5 = 1                                                                       |
+-----------------------------------------------------------------------------+
|i6 : rsfs = randomSquareFreeStep                                             |
|                                                                             |
|o6 = randomSquareFreeStep                                                    |
|                                                                             |
|o6 : MethodFunctionWithOptions                                               |
+-----------------------------------------------------------------------------+
|i7 : J = monomialIdeal 0_S                                                   |
|                                                                             |
|o7 = monomialIdeal ()                                                        |
|                                                                             |
|o7 : MonomialIdeal of S                                                      |
+-----------------------------------------------------------------------------+
|i8 : time T=tally for t from 1 to 5000 list first                            |
|     -- used 10.977 seconds                                                  |
|-----------------------------------------------------------------------------|
|(J=rsfs(J,AlexanderProbability => .01));                                     |
+-----------------------------------------------------------------------------+
|i9 : #T                                                                      |
|                                                                             |
|o9 = 168                                                                     |
+-----------------------------------------------------------------------------+
|i10 : T                                                                      |
|                                                                             |
|o10 = Tally{monomialIdeal () => 45                            }              |
|            monomialIdeal (a*b*c, a*b*d) => 33                               |
|            monomialIdeal (a*b*c, a*b*d, a*c*d) => 22                        |
|            monomialIdeal (a*b*c, a*b*d, a*c*d, b*c*d) => 26                 |
|            monomialIdeal (a*b*c, a*b*d, b*c*d) => 37                        |
|            monomialIdeal (a*b*c, a*b*d, c*d) => 31                          |
|            monomialIdeal (a*b*c, a*c*d) => 25                               |
|            monomialIdeal (a*b*c, a*c*d, b*c*d) => 25                        |
|            monomialIdeal (a*b*c, a*d) => 31                                 |
|            monomialIdeal (a*b*c, a*d, b*c*d) => 33                          |
|            monomialIdeal (a*b*c, a*d, b*d) => 36                            |
|            monomialIdeal (a*b*c, a*d, b*d, c*d) => 35                       |
|            monomialIdeal (a*b*c, a*d, c*d) => 47                            |
|            monomialIdeal (a*b*c, b*c*d) => 30                               |
|            monomialIdeal (a*b*c, b*d) => 39                                 |
|            monomialIdeal (a*b*c, b*d, a*c*d) => 36                          |
|            monomialIdeal (a*b*c, b*d, c*d) => 39                            |
|            monomialIdeal (a*b*c, c*d) => 24                                 |
|            monomialIdeal (a*b*c, d) => 20                                   |
|            monomialIdeal (a*b*d, a*c*d) => 35                               |
|            monomialIdeal (a*b*d, a*c*d, b*c*d) => 32                        |
|            monomialIdeal (a*b*d, b*c*d) => 33                               |
|            monomialIdeal (a*b*d, c*d) => 45                                 |
|            monomialIdeal (a*b, a*c) => 37                                   |
|            monomialIdeal (a*b, a*c*d) => 42                                 |
|            monomialIdeal (a*b, a*c*d, b*c*d) => 31                          |
|            monomialIdeal (a*b, a*c, a*d) => 29                              |
|            monomialIdeal (a*b, a*c, a*d, b*c*d) => 38                       |
|            monomialIdeal (a*b, a*c, a*d, b*d) => 28                         |
|            monomialIdeal (a*b, a*c, a*d, b*d, c*d) => 22                    |
|            monomialIdeal (a*b, a*c, a*d, c*d) => 30                         |
|            monomialIdeal (a*b, a*c, b*c) => 37                              |
|            monomialIdeal (a*b, a*c, b*c*d) => 35                            |
|            monomialIdeal (a*b, a*c, b*c, a*d) => 26                         |
|            monomialIdeal (a*b, a*c, b*c, a*d, b*d) => 33                    |
|            monomialIdeal (a*b, a*c, b*c, a*d, b*d, c*d) => 31               |
|            monomialIdeal (a*b, a*c, b*c, a*d, c*d) => 28                    |
|            monomialIdeal (a*b, a*c, b*c, b*d) => 29                         |
|            monomialIdeal (a*b, a*c, b*c, b*d, c*d) => 23                    |
|            monomialIdeal (a*b, a*c, b*c, c*d) => 26                         |
|            monomialIdeal (a*b, a*c, b*c, d) => 29                           |
|            monomialIdeal (a*b, a*c, b*d) => 28                              |
|            monomialIdeal (a*b, a*c, b*d, c*d) => 25                         |
|            monomialIdeal (a*b, a*c, c*d) => 20                              |
|            monomialIdeal (a*b, a*c, d) => 27                                |
|            monomialIdeal (a*b, a*d) => 30                                   |
|            monomialIdeal (a*b, a*d, b*c*d) => 31                            |
|            monomialIdeal (a*b, a*d, b*d) => 30                              |
|            monomialIdeal (a*b, a*d, b*d, c*d) => 25                         |
|            monomialIdeal (a*b, a*d, c*d) => 34                              |
|            monomialIdeal (a*b, b*c) => 25                                   |
|            monomialIdeal (a*b, b*c*d) => 30                                 |
|            monomialIdeal (a*b, b*c, a*c*d) => 30                            |
|            monomialIdeal (a*b, b*c, a*d) => 27                              |
|            monomialIdeal (a*b, b*c, a*d, b*d) => 32                         |
|            monomialIdeal (a*b, b*c, a*d, b*d, c*d) => 32                    |
|            monomialIdeal (a*b, b*c, a*d, c*d) => 32                         |
|            monomialIdeal (a*b, b*c, b*d) => 42                              |
|            monomialIdeal (a*b, b*c, b*d, a*c*d) => 35                       |
|            monomialIdeal (a*b, b*c, b*d, c*d) => 31                         |
|            monomialIdeal (a*b, b*c, c*d) => 24                              |
|            monomialIdeal (a*b, b*c, d) => 34                                |
|            monomialIdeal (a*b, b*d) => 41                                   |
|            monomialIdeal (a*b, b*d, a*c*d) => 43                            |
|            monomialIdeal (a*b, b*d, c*d) => 31                              |
|            monomialIdeal (a*b, c) => 32                                     |
|            monomialIdeal (a*b, c*d) => 26                                   |
|            monomialIdeal (a*b, c, a*d) => 36                                |
|            monomialIdeal (a*b, c, a*d, b*d) => 36                           |
|            monomialIdeal (a*b, c, b*d) => 38                                |
|            monomialIdeal (a*b, c, d) => 38                                  |
|            monomialIdeal (a*b, d) => 16                                     |
|            monomialIdeal (a*c*d, b*c*d) => 27                               |
|            monomialIdeal (a*c, a*b*d) => 30                                 |
|            monomialIdeal (a*c, a*b*d, b*c*d) => 34                          |
|            monomialIdeal (a*c, a*b*d, c*d) => 26                            |
|            monomialIdeal (a*c, a*d) => 32                                   |
|            monomialIdeal (a*c, a*d, b*c*d) => 39                            |
|            monomialIdeal (a*c, a*d, b*d) => 16                              |
|            monomialIdeal (a*c, a*d, b*d, c*d) => 23                         |
|            monomialIdeal (a*c, a*d, c*d) => 27                              |
|            monomialIdeal (a*c, b*c) => 21                                   |
|            monomialIdeal (a*c, b*c*d) => 24                                 |
|            monomialIdeal (a*c, b*c, a*b*d) => 24                            |
|            monomialIdeal (a*c, b*c, a*b*d, c*d) => 25                       |
|            monomialIdeal (a*c, b*c, a*d) => 37                              |
|            monomialIdeal (a*c, b*c, a*d, b*d) => 28                         |
|            monomialIdeal (a*c, b*c, a*d, b*d, c*d) => 35                    |
|            monomialIdeal (a*c, b*c, a*d, c*d) => 28                         |
|            monomialIdeal (a*c, b*c, b*d) => 28                              |
|            monomialIdeal (a*c, b*c, b*d, c*d) => 18                         |
|            monomialIdeal (a*c, b*c, c*d) => 17                              |
|            monomialIdeal (a*c, b*c, d) => 26                                |
|            monomialIdeal (a*c, b*d) => 30                                   |
|            monomialIdeal (a*c, b*d, c*d) => 23                              |
|            monomialIdeal (a*c, c*d) => 20                                   |
|            monomialIdeal (a*c, d) => 27                                     |
|            monomialIdeal (a*d, b*c*d) => 30                                 |
|            monomialIdeal (a*d, b*d) => 32                                   |
|            monomialIdeal (a*d, b*d, c*d) => 49                              |
|            monomialIdeal (a*d, c*d) => 52                                   |
|            monomialIdeal (a, b) => 27                                       |
|            monomialIdeal (a, b*c) => 13                                     |
|            monomialIdeal (a, b*c*d) => 17                                   |
|            monomialIdeal (a, b*c, b*d) => 11                                |
|            monomialIdeal (a, b*c, b*d, c*d) => 21                           |
|            monomialIdeal (a, b*c, c*d) => 12                                |
|            monomialIdeal (a, b*c, d) => 26                                  |
|            monomialIdeal (a, b*d) => 10                                     |
|            monomialIdeal (a, b*d, c*d) => 15                                |
|            monomialIdeal (a, b, c) => 38                                    |
|            monomialIdeal (a, b, c*d) => 20                                  |
|            monomialIdeal (a, b, c, d) => 31                                 |
|            monomialIdeal (a, b, d) => 34                                    |
|            monomialIdeal (a, c) => 30                                       |
|            monomialIdeal (a, c*d) => 21                                     |
|            monomialIdeal (a, c, b*d) => 26                                  |
|            monomialIdeal (a, c, d) => 37                                    |
|            monomialIdeal (a, d) => 15                                       |
|            monomialIdeal (b*c, a*b*d) => 26                                 |
|            monomialIdeal (b*c, a*b*d, a*c*d) => 26                          |
|            monomialIdeal (b*c, a*b*d, c*d) => 29                            |
|            monomialIdeal (b*c, a*c*d) => 21                                 |
|            monomialIdeal (b*c, a*d) => 29                                   |
|            monomialIdeal (b*c, a*d, b*d) => 31                              |
|            monomialIdeal (b*c, a*d, b*d, c*d) => 29                         |
|            monomialIdeal (b*c, a*d, c*d) => 47                              |
|            monomialIdeal (b*c, b*d) => 50                                   |
|            monomialIdeal (b*c, b*d, a*c*d) => 35                            |
|            monomialIdeal (b*c, b*d, c*d) => 30                              |
|            monomialIdeal (b*c, c*d) => 14                                   |
|            monomialIdeal (b*c, d) => 23                                     |
|            monomialIdeal (b*d, a*c*d) => 33                                 |
|            monomialIdeal (b*d, c*d) => 42                                   |
|            monomialIdeal (b, a*c) => 35                                     |
|            monomialIdeal (b, a*c*d) => 43                                   |
|            monomialIdeal (b, a*c, a*d) => 39                                |
|            monomialIdeal (b, a*c, a*d, c*d) => 27                           |
|            monomialIdeal (b, a*c, c*d) => 22                                |
|            monomialIdeal (b, a*c, d) => 30                                  |
|            monomialIdeal (b, a*d) => 37                                     |
|            monomialIdeal (b, a*d, c*d) => 32                                |
|            monomialIdeal (b, c) => 26                                       |
|            monomialIdeal (b, c*d) => 26                                     |
|            monomialIdeal (b, c, a*d) => 35                                  |
|            monomialIdeal (b, c, d) => 34                                    |
|            monomialIdeal (b, d) => 33                                       |
|            monomialIdeal (c, a*b*d) => 28                                   |
|            monomialIdeal (c, a*d) => 35                                     |
|            monomialIdeal (c, a*d, b*d) => 25                                |
|            monomialIdeal (c, b*d) => 23                                     |
|            monomialIdeal (c, d) => 30                                       |
|            monomialIdeal 1 => 21                                            |
|            monomialIdeal a => 10                                            |
|            monomialIdeal b => 39                                            |
|            monomialIdeal c => 20                                            |
|            monomialIdeal d => 40                                            |
|            monomialIdeal(a*b) => 35                                         |
|            monomialIdeal(a*b*c) => 26                                       |
|            monomialIdeal(a*b*c*d) => 32                                     |
|            monomialIdeal(a*b*d) => 32                                       |
|            monomialIdeal(a*c) => 26                                         |
|            monomialIdeal(a*c*d) => 38                                       |
|            monomialIdeal(a*d) => 42                                         |
|            monomialIdeal(b*c) => 14                                         |
|            monomialIdeal(b*c*d) => 29                                       |
|            monomialIdeal(b*d) => 22                                         |
|            monomialIdeal(c*d) => 43                                         |
|                                                                             |
|o10 : Tally                                                                  |
+-----------------------------------------------------------------------------+
|i11 : J                                                                      |
|                                                                             |
|o11 = {monomialIdeal (a*b, a*c, b*c, c*d), {a*b, a*c, b*c, c*d}, {b*d, a*d,  |
|      -----------------------------------------------------------------------|
|      c}}                                                                    |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+

Ways to use randomSquareFreeStep :
==================================

  * "randomSquareFreeStep(Ideal)"
  * "randomSquareFreeStep(List)"
  * "randomSquareFreeStep(MonomialIdeal)"

For the programmer
==================

The object randomSquareFreeStep, is a method function with options (Macaulay2Doc).

randomToricEdgeIdeal -- Creates a toric edge ideal from a random graph with n vertices and t edges.
***************************************************************************************************

Synopsis
========

  * Usage:
        (I, G) = randomToricEdgeIdeal(n,t)
  * Inputs:
      * n, an integer (Macaulay2Doc), number of vertices
      * t, an integer (Macaulay2Doc), number of edges
  * Outputs:
      * I, an ideal (Macaulay2Doc), a random toric edge ideal
      * G, a graph (EdgeIdeals), the graph underlying I

Description
===========

The toric edge ideal of a graph G is the kernel of the map from the polynomial
ring k[edges(G)] to the polynomial ring k[vertices G] taking an x_e to y_i*y_j,
where e = (i,j). This method returns the toric edge ideal I of a random graph G
which has n vertices and t edges.  I is the kernel of the homomorphism from
QQ[x_1..x_n] to QQ/101[e_1..e_t] which sends each vertex in the graph G to the
product of its endpoints.

+-----------------------------------------------------------------------------+
|i1 : randomToricEdgeIdeal(4,5)                                               |
|                                                                             |
|o1 = (ideal(e e  - e e ), Graph{edges => {{x , x }, {x , x }, {x , x }, {x , |
|             1 3    4 5                     3   4     1   4     1   2     2  |
|                                ring => QQ[x ..x ]                           |
|                                            1   4                            |
|                                vertices => {x , x , x , x }                 |
|                                              1   2   3   4                  |
|     ------------------------------------------------------------------------|
|     x }, {x , x }}})                                                        |
|      4     1   3                                                            |
|                                                                             |
|o1 : Sequence                                                                |
+-----------------------------------------------------------------------------+

Note that his is different than the randomBinomialEdgeIdeal!

+-----------------------------------------------------------------------------+
|i2 : randomBinomialEdgeIdeal(4,5)                                            |
|                                                                             |
|o2 = (ideal (- x y  + x y , - x y  + x y , x y  - x y , x y  - x y , x y  -  |
|                3 4    4 3     3 1    1 3   4 1    1 4   4 2    2 4   1 2    |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|     ------------------------------------------------------------------------|
|     x y ), Graph{edges => {{x , x }, {x , x }, {x , x }, {x , x }, {x ,     |
|      2 1                     3   4     1   2     1   3     2   4     1      |
|                  ring => QQ[x ..x ]                                         |
|                              1   4                                          |
|                  vertices => {x , x , x , x }                               |
|                                1   2   3   4                                |
|     ------------------------------------------------------------------------|
|     x }}})                                                                  |
|      4                                                                      |
|                                                                             |
|o2 : Sequence                                                                |
+-----------------------------------------------------------------------------+

See also
========

  * randomGraph (EdgeIdeals) -- returns a random graph
  * randomBinomialEdgeIdeal -- Creates a
    binomial edge ideal from a random graph with n vertices and t edges.

Ways to use randomToricEdgeIdeal :
==================================

  * "randomToricEdgeIdeal(ZZ,ZZ)"

For the programmer
==================

The object randomToricEdgeIdeal, is a method function (Macaulay2Doc).

regSeq -- regular sequence of powers of the variables, in given degrees
***********************************************************************

Synopsis
========

  * Usage:
        I = regSeq(L,S)
  * Inputs:
      * L, a list (Macaulay2Doc), or sequence of positive integers
      * S, a ring (Macaulay2Doc), Polynomial ring
  * Outputs:
      * I, an ideal (Macaulay2Doc), generated by the given powers
        of the variables

Description
===========

+-----------------------+
|i1 : kk=ZZ/101         |
|                       |
|o1 = kk                |
|                       |
|o1 : QuotientRing      |
+-----------------------+
|i2 : S=kk[a..e]        |
|                       |
|o2 = S                 |
|                       |
|o2 : PolynomialRing    |
+-----------------------+
|i3 : regSeq((2,3,4),S) |
|                       |
|             2   3   4 |
|o3 = ideal (a , b , c )|
|                       |
|o3 : Ideal of S        |
+-----------------------+

Caveat
======

If the number of elements of L differs from the number of variables in the
ring, the length of the regular sequence will be the minimum of the two.

Ways to use regSeq :
====================

  * "regSeq(List,Ring)"
  * "regSeq(Sequence,Ring)"

For the programmer
==================

The object regSeq, is a method function (Macaulay2Doc).

squareFree -- ideal of all square-free monomials of given degree
****************************************************************

Synopsis
========

  * Usage:
        I = squareFree(d,S)
  * Inputs:
      * d, an integer (Macaulay2Doc), positive
      * S, a ring (Macaulay2Doc), Polynomial ring
  * Outputs:
      * I, an ideal (Macaulay2Doc), all square-free monomials of
        degree d

Description
===========

+-----------------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                               |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : S=kk[a..e]                                                              |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : squareFree(3, S)                                                        |
|                                                                             |
|o3 = ideal (a*b*c, a*b*d, a*b*e, a*c*d, a*c*e, a*d*e, b*c*d, b*c*e, b*d*e,   |
|     ------------------------------------------------------------------------|
|     c*d*e)                                                                  |
|                                                                             |
|o3 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators

Ways to use squareFree :
========================

  * squareFree(ZZ,Ring) -- ideal of all
    square-free monomials of given degree

For the programmer
==================

The object squareFree, is a method function (Macaulay2Doc).

squareFree(ZZ,Ring) -- ideal of all square-free monomials of given degree
*************************************************************************

Synopsis
========

  * Function: squareFree,
  * Usage:
        I = squareFree(d,S)
  * Inputs:
      * d, an integer (Macaulay2Doc), positive
      * S, a ring (Macaulay2Doc), Polynomial ring
  * Outputs:
      * I, an ideal (Macaulay2Doc), all square-free monomials of
        degree d

Description
===========

+-----------------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                               |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : S=kk[a..e]                                                              |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : squareFree(3, S)                                                        |
|                                                                             |
|o3 = ideal (a*b*c, a*b*d, a*b*e, a*c*d, a*c*e, a*d*e, b*c*d, b*c*e, b*d*e,   |
|     ------------------------------------------------------------------------|
|     c*d*e)                                                                  |
|                                                                             |
|o3 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * randomSquareFreeMonomialIdeal, --
    random square-free monomial ideal with given degree generators

Ways to use this method:
========================

  * squareFree(ZZ,Ring) -- ideal of all
    square-free monomials of given degree