What's going on with the math?


What then about a perfect shuffle that is based on a mod that is not a prime. It turns out that the shuffle inherits color groups of the same size as each of the prime factors. Then the remaining cards divide into groups of the size that is the least common multiple of the inherited groups.

Lets look again at the example of 20 cards. They are shuffling in mod 21. The factors of 21 are 3 and 7. So the perfect shuffle will inherit the same size color groups as a shuffle of 2 and 6 cards. (Remember the mod used is always one larger than the number of cards used.)

A glance at the chart of the color groups for prime modulos from the previous page tells us that a shuffle in...

  • mod 3 (2 cards) forms 1 color group of size 2
  • mod 7 (6 cards) forms 2 color groups of size 3
This accounts for 8 of the 20 cards, leaving 12 more. The last 12 cards are divided into groups the size of the least common multiple of the groups already determined (size 2 and 3). The least common multiple of 2 and 3 is 6, so the 12 cards form 2 color groups of size 6.

Indeed another look at the picture will confirm that a shuffle of 20 cards has

  • 1 color group of size 2
  • 2 color groups of size 3
  • 2 color groups of size 6

Lets look at one more example, a shuffle of 114 cards.

The cards are shuffling in mod 115. The prime factors of 115 are 5 and 23. From the prime modulo table

  • mod 5 (4 cards) forms 1 color groups of size 4
  • mod 23 (22 cards) forms 2 color groups of size 11
The least common multiple of 4 and 11 is 44, so the 88 remaining cards are divided into to groups of 44. My scarf is based on 114 cards. You can see
  • 1 color group of size 4 (white)
  • 2 color groups of size 11 (pink and green)
  • 2 color groups of size 44 (blue and purple)
What if the modulo has more than two prime factors?

If there are 3 or more different prime factors the process works the same way. Color groups from shuffles the size of the factors are inherited and the remaining cards are divided into groups the size of the least common multiple of the sizes of all the inherited groups.

But what if the factors of the modulo include a factor more than once?

Continue
Page 1 2 3 4 5


Home
What is a perfect shuffle anyway?
See more perfect shuffle scarves
Knit your own perfect shuffle scarf.
Who came up with this brilliant idea?
Find out more