Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

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

Note:

Example:
library("xplore")
randomize(11)
permutation(10,3)

Result:
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



Author: P. Cizek, 20021025 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006