5.9.1 Random permutation: randperm shuffle
The randperm command computes a random
permutation.
shuffle is a synonym for randperm.
-
randperm takes one argument:
n, an integer.
- randperm(n) returns a random
permutation of [0..n−1].
Example.
Input:
randperm(3)
Output (example):