Randpoly - Maple Help

Randpoly

random polynomial over a finite field

Randprime

random monic prime polynomial over a finite field

 Calling Sequence Randpoly(n, x) mod p Randpoly(n, x, alpha) mod p Randprime(n, x) mod p Randprime(n, x, alpha) mod p

Parameters

 n - non-negative integer x - name alpha - RootOf p - integer

Description

 • Randpoly(n, x) mod p returns a polynomial of degree n in the variable x whose coefficients are selected at random from the integers mod p.
 • Randprime(n, x) mod p returns a random monic irreducible polynomial of degree $0 in the variable x over the integers mod p where p must be a prime integer.
 • The optional third argument alpha specifies a representation for the finite field $\mathrm{GF}\left({p}^{k}\right)$.  The field extension alpha is specified by a RootOf a monic univariate polynomial of degree k which must be irreducible.
 • Thus Randprime(n, x, alpha) mod p creates a random monic irreducible polynomial of degree $0 in the variable x over $\mathrm{GF}\left({p}^{k}\right)$.

Examples

 > $\mathrm{Randpoly}\left(4,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${{x}}^{{4}}{+}{x}$ (1)
 > $\mathrm{Randprime}\left(4,x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${{x}}^{{4}}{+}{x}{+}{1}$ (2)
 > $\mathrm{alias}\left(\mathrm{\alpha }=\mathrm{RootOf}\left({y}^{2}+y+1\right)\right):$
 > $f≔\mathrm{Randpoly}\left(2,x,\mathrm{\alpha }\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${f}{≔}{{x}}^{{2}}{+}{\mathrm{\alpha }}{+}{x}$ (3)
 > $\mathrm{Factor}\left(f\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${{x}}^{{2}}{+}{\mathrm{\alpha }}{+}{x}$ (4)
 > $g≔\mathrm{Randprime}\left(2,x,\mathrm{\alpha }\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${g}{≔}{\mathrm{\alpha }}{}{x}{+}{{x}}^{{2}}{+}{1}$ (5)
 > $\mathrm{Irreduc}\left(g\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}2$
 ${\mathrm{true}}$ (6)