next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: random(Module,Module)

random(Module,Module) -- make a random module map

Synopsis

Description

i1 : R = ZZ/101[x,y];
i2 : random(R^{1,2,3},R^{1,2,3})

o2 = {-1} | -10          0        0 |
     {-2} | -36x-41y     22       0 |
     {-3} | 25x2+9xy-5y2 -35x-12y 8 |

             3       3
o2 : Matrix R  <--- R
i3 : random(ZZ^3,ZZ^6,MaximalRank=>true)

o3 = | 377538697  883747491  6123280  13127686  53715572  147057419  |
     | 42207667   98800515   684564   1467641   6005236   16440611   |
     | 3782317527 8853696170 61345207 131517802 538141788 1473273442 |

              3        6
o3 : Matrix ZZ  <--- ZZ
i4 : random(ZZ^3,ZZ^10,Density=>.3)

o4 = | 0 0 0 0 0 0 0 0 0 0 |
     | 6 0 0 4 0 0 0 0 0 8 |
     | 2 5 0 0 5 0 0 0 0 0 |

              3        10
o4 : Matrix ZZ  <--- ZZ
i5 : random(ZZ^6,ZZ^6,UpperTriangular=>true)

o5 = | 0 0 1 0 4 4 |
     | 0 0 3 6 6 0 |
     | 0 0 0 7 1 7 |
     | 0 0 0 0 4 1 |
     | 0 0 0 0 0 7 |
     | 0 0 0 0 0 0 |

              6        6
o5 : Matrix ZZ  <--- ZZ

Caveat

Over a polynomial ring, specifying MaximalRank=>true will yield a non-homogeneous matrix.

See also