Macaulay2 » Documentation
Packages » RandomIdeals :: randomElementsFromIdeal
next | previous | forward | backward | up | index | toc

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

- Usage:
    `I = randomElementsFromIdeal(L,I)`
- Inputs:
  - L, a list, of integers
  - I, an ideal, that should be homogeneous
- Outputs:
  - I, an ideal, 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.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/RandomIdeals.m2:1226:0.