Macaulay2 » Documentation
Packages » Macaulay2Doc » combinatorics » random » random(List,Module)
next | previous | forward | backward | up | index | toc

random(List,Module) -- get a random vector in the module

Description

i1 : R = ZZ/7[x,y]

o1 = R

o1 : PolynomialRing
i2 : E = End R^{-1,1}

      4
o2 = R

o2 : R-module, free, degrees {0, -2, 2, 0}
i3 : h = homomorphism random E

o3 = {1}  | 3      0 |
     {-1} | x2+3xy 0 |

             2      2
o3 : Matrix R  <-- R
i4 : h = homomorphism random(0, E)

o4 = {1}  | 2            0 |
     {-1} | -3x2+3xy+3y2 3 |

             2      2
o4 : Matrix R  <-- R
i5 : h = homomorphism random(1, E)

o5 = {1}  | 0            0      |
     {-1} | 3x3-2x2y-2y3 -2x-2y |

             2      2
o5 : Matrix R  <-- R
i6 : h = homomorphism random(-1, E)

o6 = {1}  | 0     0 |
     {-1} | 2x+3y 0 |

             2      2
o6 : Matrix R  <-- R
i7 : h = homomorphism random(-2, E)

o7 = {1}  | 0  0 |
     {-1} | -1 0 |

             2      2
o7 : Matrix R  <-- R

See also

Ways to use this method:


The source of this document is in Macaulay2Doc/functions/random-doc.m2:262:0.