Macaulay2
»
Documentation
Packages
»
random
>
random(List)
next
|
previous
|
forward
|
backward
|
up
|
index
|
toc
random(List) -- shuffle a list randomly
Synopsis
Function:
random
Usage:
random L
Inputs:
L
,
a
list
,
Optional inputs
:
Density
=>
...
,
default value 1
,
get a random map of module
Height
=>
...
,
default value 10
,
get a random homogeneous element from a graded ring
MaximalRank
=>
...
,
default value false
,
get a random map of module
UpperTriangular
=>
...
,
default value false
,
get a random map of module
Outputs:
a
list
, a new list containing the elements of
L
in a shuffled random order
Description
i1 : random toList (0 .. 12) o1 = {5, 3, 6, 8, 1, 2, 0, 9, 11, 4, 7, 12, 10} o1 : List
See also
setRandomSeed
-- set starting point for random number generator
Ways to use this method:
random(List)
-- shuffle a list randomly