 RandomElement - Maple Help

GroupTheory

 RandomElement
 produce a random element of a group
 RandomInvolution
 produce a random involution of a group
 RandomPElement
 produce a random p-element of a group
 RandomPPrimeElement
 produce a random element of a group with order relatively prime to p Calling Sequence RandomElement( G ) RandomInvolution( G ) RandomPElement( p, G ) RandomPPrimeElement( p, G ) Parameters

 G - a permutation group p - a prime number Description

 • The RandomElement( G ) command returns a randomly selected element of the group G.
 • The RandomInvolution( G ) command returns a randomly selected involution (element of order $2$) of the group G. An exception is raised if G has odd order (as in that case, G contains no involutions).
 • For a prime number p, the RandomPElement( p, G ) command returns a random element of the group G with order equal to a power of p. An exception is raised in case p does not divide the order of G.
 • For a prime number p, the RandomPPrimeElement( p, G ) command returns a random element of the group G with order relatively prime to p. An exception is raised if G is a $p$-group. Examples

 > $\mathrm{with}\left(\mathrm{GroupTheory}\right):$
 > $G≔\mathrm{Group}\left(\left\{\mathrm{Perm}\left(\left[\left[1,2\right]\right]\right),\mathrm{Perm}\left(\left[\left[1,2,3\right],\left[4,5\right]\right]\right)\right\}\right)$
 ${G}{≔}⟨\left({1}{,}{2}{,}{3}\right)\left({4}{,}{5}\right){,}\left({1}{,}{2}\right)⟩$ (1)
 > $\mathrm{RandomElement}\left(G\right)$
 $\left({1}{,}{2}\right)$ (2)
 > $\mathrm{RandomElement}\left(G\right)$
 $\left({1}{,}{3}{,}{2}\right)$ (3)
 > $G≔\mathrm{ExceptionalGroup}\left("G2\left(3\right)"\right)$
 ${G}{≔}{{G}}_{{2}}\left({3}\right)$ (4)
 > $\mathrm{RandomInvolution}\left(G\right):$
 > $g≔\mathrm{RandomInvolution}\left(G\right):$
 > $g\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}G$
 ${\mathrm{true}}$ (5)
 > $\mathrm{PermOrder}\left(g\right)$
 ${2}$ (6)
 > $G≔\mathrm{QuasicyclicGroup}\left(5,'\mathrm{form}'="multiplicative"\right)$
 ${G}{≔}{{C}}_{{{5}}^{{\mathrm{∞}}}}$ (7)
 > $g≔\mathrm{RandomElement}\left(G\right)$
 ${g}{≔}{{ⅇ}}^{\frac{{4085198}}{{9765625}}{}{I}{}{\mathrm{π}}}$ (8)
 > $g\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}G$
 ${\mathrm{true}}$ (9)
 > $G≔\mathrm{DihedralGroup}\left(5\right)$
 ${G}{≔}{{\mathbf{D}}}_{{5}}$ (10)
 > $g≔\mathrm{RandomPElement}\left(5,G\right)$
 ${g}{≔}\left({1}{,}{5}{,}{4}{,}{3}{,}{2}\right)$ (11)
 > $g\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}G$
 ${\mathrm{true}}$ (12)
 > $\mathrm{PermOrder}\left(g\right)$
 ${5}$ (13)
 > $g≔\mathrm{RandomPPrimeElement}\left(5,G\right)$
 ${g}{≔}\left({1}{,}{4}\right)\left({2}{,}{3}\right)$ (14)
 > $g\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∈\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}G$
 ${\mathrm{true}}$ (15)
 > $\mathrm{PermOrder}\left(g\right)$
 ${2}$ (16)
 > $G≔\mathrm{DihedralGroup}\left(120\right):$
 > { to 100 do PermOrder( RandomPElement( 2, G ) ) end };
 $\left\{{2}{,}{4}{,}{8}\right\}$ (17)
 > { to 100 do PermOrder( RandomPPrimeElement( 2, G ) ) end };
 $\left\{{3}{,}{5}{,}{15}\right\}$ (18)
 > { to 100 do PermOrder( RandomInvolution( G ) ) end };
 $\left\{{2}\right\}$ (19) Compatibility

 • The GroupTheory[RandomElement] command was introduced in Maple 17.