The Gilbreath principle is a card-shuffling theorem that guarantees prescribed labels in consecutive blocks after a suitable shuffle.
Start with cards whose labels repeat 1, 2, ...,
in that order, where
and
are integers. Reverse the
order of the first
cards, where
is an integer with
, and then perform a riffle
shuffle of that packet with the remaining cards, preserving
the order within each of these two packets. Each successive, nonoverlapping block
of
cards, counted from the top, then contains each label exactly
once (Diaconis and Graham 2015, p. 66; Numberphile 2016).
For ,
the initial labels can be red and black, and each successive pair after the shuffle
has one card of each color. This is Gilbreath's first principle
(Gilbreath 1958). The repeated-label version is his second principle (Diaconis and
Graham 2015, pp. 62 and 66).
After such a shuffle, the original positions of the first
output cards form a contiguous block of
positions in the original deck. A prefix of length
therefore has exactly
of each label for
. Comparing prefixes of lengths
and
proves the block property. With all
cards distinguished, allowing every
cut
and every order-preserving interleaving gives
distinct output permutations
(Diaconis and Graham 2015, pp. 68-69 and 80-81).