Macaulay2 » Documentation
Packages » Macaulay2Doc » combinatorics » random » randomElement
next | previous | forward | backward | up | index | toc

randomElement -- select a random element of a list

Description

i1 : randomElement toList (0 .. 12)

o1 = 11

In the near future, this will also be the behavior of random(List).

See also

Ways to use randomElement:

  • randomElement(List)

For the programmer

The object randomElement is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/random-doc.m2:266:0.