RandomSample

WMA link


RandomSample[items]

randomly picks one item from items.

RandomSample[items, n]

randomly picks n items from items. Each pick in the n picks happens after the previous items picked have been removed from items, so each item can be picked at most once.

RandomSample[items, {$n_1$, $n_2$, ...}]

randomly picks items from items and arranges the picked items in the nested list structure described by {$n_1$, $n_2$, ...}. Each item gets picked at most once.

RandomSample[weights -> items, n]

randomly picks n items from items and uses the corresponding numeric values in weights to determine how probable it is for each item in items to get picked (in the long run, items with higher weights will get picked more often than ones with lower weight). Each item gets picked at most once.

RandomSample[weights -> items]

randomly picks one items from items using weights weights. Each item gets picked at most once.

RandomSample[weights -> items, {$n_1$, $n_2$, ...}]

randomly picks a structured list of items from items using weights weights.
Each item gets picked at most once.

RandomReal
$RandomState