permutations (version 1.1-2)

rperm: Random permutations

Description

Function rperm() creates a word object of random permutations. Function rcyc() creates random permutations comprising a single (group-theoretic) cycle of a specified length (r1cyc() is a low-level helper function).

Usage

rperm(n=10,r=7,moved=NA)
rcyc(n,len,r=len)
r1cyc(len,r=len)

Value

Returns an object of class word

Arguments

n

Number of permutations to create

r

Size of permutations

len

Length of cycles in rcyc() and r1cyc()

moved

In function rperm(), integer specifying how many elements can move (that is, how many elements do not map to themselves), with default NA meaning to choose a permutation at random. This is useful if you want a permutation that has a compact cycle representation

Author

Robin K. S. Hankin

See Also

size

Examples

Run this code
rperm()
as.cycle(rperm(30,9))
rperm(10,9,2)

rcyc(20,5)
rcyc(20,5,9)

Run the code above in your browser using DataLab