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