Enumeration of riffle shuffles
genrif(v)
riffle(p,q=p)
Returns a matrix of class partition
with columns being
riffle shuffles
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
Robin K. S. Hankin
A riffle shuffle is a permutation of integers 1,2,...,n1,2,...,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).
riffle(p,q)
returns all riffle shuffles with rising
sequences of 1:p
and (p+1):q
genrif(v)
returns all riffle shuffles with rising
sequences having lengths the entries of v
, the deck being
numbered consecutively
parts