CoCoA:HowTo:Randomize Coefficients: Difference between revisions

From ApCoCoAWiki
Dheldt (talk | contribs)
m Randomize Coefficients moved to HowTo:Randomize Coefficients: tidying up the wiki...
m Bot: Replacing category HowTo with HowTo Old
 
(2 intermediate revisions by 2 users not shown)
Line 17: Line 17:
  -------------------------------
  -------------------------------
by [[User:Bigatti|Bigatti]] 17:25, 29 Nov 2005 (CET)
by [[User:Bigatti|Bigatti]] 17:25, 29 Nov 2005 (CET)
[[Category:CoCoA4]] [[Category:HowTo]]
 
[[Category:CoCoA4]]
[[Category:HowTo Old]]

Latest revision as of 09:43, 29 October 2020

Question

The coefficients of a "Randomized" polynomials are too big for my purposes

  Use R ::= Q[x,y,z];
  Randomized(x-yz);
2129104241yz - 2703411994x
-------------------------------

What can I do?

Answer

This function will produce a randomized polynomial with "small" random coefficients

  Define MyRandomized(F, Range)
    Return Sum([ Rand(-Range,Range)*T | T In Support(F)]);
  EndDefine;
  MyRandomized(x-yz, 4);
2yz + 6x
-------------------------------

by Bigatti 17:25, 29 Nov 2005 (CET)