Library: | xplore |
See also: | order rank sort |
Quantlet: | permutation | |
Description: | generates randomly p permutations of {1,...,n} |
Usage: | ps = permutation(n,p) | |
Input: | ||
n | integer scalar, size of permutations | |
p | integer scalar, number of generated permutations | |
Output: | ||
ps | n x p matrix, each column represents a permutation |
library("xplore") randomize(11) permutation(10,3)
Contents of ps [ 1,] 1 9 6 [ 2,] 3 6 10 [ 3,] 2 10 1 [ 4,] 4 3 7 [ 5,] 9 8 3 [ 6,] 5 2 9 [ 7,] 10 4 8 [ 8,] 7 1 4 [ 9,] 8 7 5 [10,] 6 5 2