Home Online Manual
Top
Back: genericid
Forward: randommat
FastBack:
FastForward:
Up: random_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.9.2 randomid

Procedure from library random.lib (see random_lib).

Usage:
randomid(id[,k,b]); id ideal/module, b,k integers

Return:
ideal/module having k generators which are random linear combinations of generators of id with coefficients in the interval [-b,b] (default: b=30000, k=size(id))

Note:
For performance reasons try small bound b in characteristic 0

Example:
 
LIB "random.lib";
ring r=0,(x,y,z),dp;
randomid(maxideal(2),2,9);
==> _[1]=-5x2-9xy+6y2-8xz-8yz+4z2
==> _[2]=-9xy+2y2+xz+yz-z2
module m=[x,0,1],[0,y2,0],[y,0,z3];
show(randomid(m));
==> // module, 3 generator(s)
==> [1369x-11685y,-4481y2,-11685z3+1369]
==> [-642x-13756y,25342y2,-13756z3-642]
==> [2536x-6355y,8285y2,-6355z3+2536]