On a recent episode of The Math Factor podcast, they discussed a very simple
game. Start with a deck of some number of cards and a round table of
some number of people (preferably more than one of each). The dealer
deals one card to each player (going around clockwise starting with the
player on the dealer's left) until all cards are dispersed. The
last person to get a card is the new dealer. The new dealer picks up
the cards she has been dealt and deals those out in the same manner.
Play continues until someone has all of the cards.

Because each position can only come from one parent position

and can only lead to one child position

, you are guaranteed that
you will always get back to the starting state if you play long enough.
Someone else may win before that, but you are guaranteed that you will
never get into a loop where no one will win. Or, I should say, that
is so long as no one misdeals.

It turns out that for two players with 52 cards, the game should
take 12 turns if everyone deals correctly. But, I wanted to explore
all of the possible loops you could get into with a misdeal. There
are 15 different loops altogether. Each is summarized by one row
of this image:

A dot in the zero-th column means that the first dealer has
0 cards and the other player has 52 - 0 cards.
Similarly, a dot in the n-th column (starting the counting with zero)
means that at some point in the cycle, the first dealer would have
n cards and the other player would have 52 - n cards. The dot
is blue if the first dealer has the deal and red if the second player
has the deal.

With a different number of cards, situations arise where
the first-dealer has n cards and the deal but later has n cards
but not the deal. Those would be depicted as yellow in my scheme.
But, that doesn't occur with 52 cards. Try two players and 2 cards
to see how it could come up.

**( Things one can tell from the picture...Collapse )**
**( Code that generated thisCollapse )**