Dear GAP-Forum,
Chris Charnes asked:
I need a routine that returns a polynomial of say degree 100 over GF(2) of the form: x^100 + x^a + x^b + ... + 1, where each component of (a,b,c,...) is > < 100.
Taking the following routine:
# RandomNormedPol(<Ring>,<degreerange>)
RandomNormedPol := function ( r, deg )
local f;
f := r.operations.Random;
if not IsField( r ) then
r := Field( r );
fi;
return
Polynomial( r, Concatenation( List( [ 1 .. RandomList( deg ) ], function
( i )
return f( r );
end ), [ r.one ] ) );
end;
This will do the job:
gap> k:=GF(2);; gap> RandomNormedPol(k,[100]);
Alexander Hulpke
-- Lehrstuhl D fuer Mathematik, RWTH, Templergraben 64, 52056 Aachen, Germany,
eMail: Alexander.Hulpke@math.rwth-aachen.de