up previous next
RandomLinearForm    --    random linear form in polynomial ring


Syntax
RandomLinearForm(R: RING, n: INT): RINGELEM
RandomLinearForm(R: RING): RINGELEM

Description
The first function returns a non-zero random linear form in the polynomial ring R, with integer coefficients in the range -n..n.

The second function is for polynomial rings R with finite characteristic p, it returns a random linear form with integer coefficients in the range 0..p-1.

NOTE: If the ring has weighted degrees, the weights are ignored: consider applying HomogCompt to the linear form produced.

Example
/**/ R ::= ZZ/(101)[a,b,c,d,e,f];
/**/ RandomLinearForm(R, 1);
-a -c +d -e -f
/**/ RandomLinearForm(R);
49*a +37*b +36*c +12*d -37*e +34*f

See Also