up previous next
randomize the coefficients of a given polynomial
Randomize(V: RINGELEM): RINGELEM |
***** NOT YET IMPLEMENTED: use random *****
This function replaces the coefficients of terms of the polynomial
contained in V with randomly generated coefficients. The result is
stored in V, overwriting the original polynomial.
NOTE: It is possible that some coefficients will be replaced by
zeroes, i.e., some terms from the original polynomial may disappear in
the result.
The similar function
randomized
performs the same operation,
but returns the randomized polynomial without modifying the argument.
NOTE: every time you restart CoCoA the sequence of random numbers will
be the same (as in other programming languages). If you want total
randomness read
seed
.
Use R ::= QQ[x];
F := 1+x+x^2;
Randomized(F);
-2917104644x^2 + 3623608766x - 2302822308
-------------------------------
F;
x^2 + x + 1
-------------------------------
Randomize(F);
F;
-1010266662x^2 + 1923761602x - 4065654277
-------------------------------
|