sample ( seq n -- seq' )
Generating random integers

Prev:randomize ( seq -- randomized )
Next:delete-random ( seq -- elt )


Vocabulary
random

Inputs and outputs
seqa sequence
nan integer
seq'a sequence


Word description
Takes n samples at random without replacement from a sequence. Throws an error if n is longer than the sequence.

Examples
USING: random prettyprint ; { 1 2 3 } 2 sample .
{ 3 2 }


Definition