randcomb - Maple Help

combinat

 randcomb
 construct a random combination

 Calling Sequence randcomb(n, m)

Parameters

 n - list or set of objects, or positive integer m - non-negative integer

Description

 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{combinat},\mathrm{randcomb}\right)$
 $\left[{\mathrm{randcomb}}\right]$ (1)
 > $\mathrm{randcomb}\left(5,3\right)$
 $\left\{{1}{,}{3}{,}{4}\right\}$ (2)
 > $\mathrm{randcomb}\left(\left[a,b,c,d\right],2\right)$
 $\left[{a}{,}{d}\right]$ (3)
 > $\mathrm{randcomb}\left(\left\{W,X,Y,Z\right\},1\right)$
 $\left\{{X}\right\}$ (4)