riffle {partitions}R Documentation

Riffle shuffles

Description

Enumeration of riffle shuffles

Usage

genrif(v)
riffle(p,q=p)

Arguments

p, q, v

In function riffle(), integers p,q specify the length of the two increasing sequences. In function genrif(), the elements of v specify the lengths of all the increasing sequences: there are sum(v) cards in the pack

Details

A riffle shuffle is a permutation of integers 1,2,\ldots,n containing one or two rising sequences.

A generalized riffle shuffle, or r-riffle shuffle, contains at most r rising sequences. This is not implemented in the package (earlier versions included a buggy version; the difficulty is ensuring that sequences do not appear more than once).

Value

Returns a matrix of class partition with columns being riffle shuffles

Note

When we say “contains r rising sequences” we generally mean “contains at most r rising sequences”

Author(s)

Robin K. S. Hankin

See Also

parts

Examples

riffle(3,4)
genrif(1:3)

[Package partitions version 1.10-9 Index]