combinat
randcomb
construct a random combination
Calling Sequence
Parameters
Description
Examples
randcomb(n, m)
n
-
list or set of objects, or positive integer
m
non-negative integer
If n is a list or set, then randcomb returns a random combination of m elements of n. If n is a positive integer, a random combination of m of the first n positive integers is returned.
The command with(combinat,randcomb) allows the use of the abbreviated form of this command.
with⁡combinat,randcomb
randcomb⁡5,3
1,3,4
randcomb⁡a,b,c,d,2
a,d
randcomb⁡W,X,Y,Z,1
X
See Also
combinat[choose]
Download Help Document