[back] [prev] [next] [index] [root]

 


RandomElt

Computes a "random" element of a given order.

Syntax:

alpha := RandomElt(R [, l | b, deg | degl]);

element
  alpha  
of o
ring
  R  
may be an order, an ideal, Z, a module, a polynomial algebra or an function field order.
list
  l  
of integers
integer
  b  
equivalent to l := [-b..b]
integer
  deg  
degree of a random element of the
  polynomial algebra R  
list
  degl  
of positive integers

Description:

A "random" element aplpha with coefficients in l will be returned (by default l := [-20,20]). Of course, it is not possible to do a truly random element from an infinite set. If R is a polynomial algebra, and you want to create a random element with a certain degree deg, then you also have to give l or b as a parameter to RandomElt. If deg is a list, then the degree of alpha will be an element of deg. If R is a function field order, then deg is the range of the degree of the coefficients of \alpha, and l the range of coefficients of these coefficients (only for absolute extensions in the moment). By default the degree is an integer between 0 and 20.


Example:

kash> o := Order(Z, 5, 3);
Generating polynomial: x^5 - 3

kash> RandomElt(o);
[19, 11, 5, -6, -18]
kash> RandomElt(o, 100);
[-29, 86, 87, 22, -77]
kash> RandomElt(o, [-1,1]);
> [-1, -1, -1, -1, 1]


<- back[back] [prev] [next] [index] [root]