I’ve written about this before (here).
When we left off, we had a formula to solve that would give the length of a single loop:
P*2N mod (C+1) = P
P is the position of a card in the loop, N is the number of shuffles, and C is the number of cards. Essentially, you take the starting position, and keep doubling it – if it goes above the number of cards in the deck, take the remainder after dividing it by (C+1). Once it hits it’s starting position again, the loop has ended.
Continue reading “Some more card shuffling”