Macaulay2 » Documentation
Packages » QuaternaryQuartics :: random(List,Ideal)
next | previous | forward | backward | up | index | toc

random(List,Ideal) -- a random ring element of a given degree

Description

This function should probably be in the Core of Macaulay2.

i1 : S = ZZ/101[a..d]

o1 = S

o1 : PolynomialRing
i2 : I = ideal(a^2, a*b^3, c*d)

             2     3
o2 = ideal (a , a*b , c*d)

o2 : Ideal of S
i3 : f = random(3, I)

        3      2       2       2                           2         2
o3 = 24a  - 36a b - 30a c - 29a d + 19a*c*d + 19b*c*d - 10c d - 29c*d

o3 : S
i4 : f % I == 0 -- so f is in the ideal I

o4 = true
i5 : degree f == {3}

o5 = true

See also


The source of this document is in QuaternaryQuartics.m2:653:0.