How many perfect shuffles will return a full deck of cards to their original order? Divide 52 cards into 2 equal piles Shuffle by interlacing cards Keep top card fixed (Out Shuffle) 8 shuffles => original order Label the positions 0-51 Then 0->0 and 26 ->1 1->2 and 27 ->3 2->4 and 28 ->5 … in general? 0 x 25 2x f ( x) 2 x 51 26 x 51 f(x) = 2x mod 51 Minimum integer k such that 2 k x = x mod 51 for all x in {0,1,…,51} In particular, this has to hold when x = 1 Minimum integer k such that 2 k - 1= 0 mod 51 Thus, 51 divides 2 k - 1 k= 6, 2 k - 1 = 63 = (3)(3)(7) k= 7, 2 k - 1 = 127 (prime) k= 8, 2 k - 1 = 255 = (5)(51) = 0 mod 51 0 p n 1 p = position In Shuffles mod n 1, n even I ( p) 2 p 1 n odd mod n, Out Shuffles mod n 1, n even and 0 p n 1 O( p ) 2 p n odd and 0 p n 1 mod n, 8 Out Shuffles for 52 Cards In General? o (O,2n-1) = o (O,2n) o (I,2n-1) = o (O,2n) => o (O,2n-1) = o (I,2n-1) o (I,2n-2) = o (O,2n) Therefore, only need o (O,2n) 1 shuffle: O(p) = 2p mod (2n-1), 0<p<N-1 2 shuffles: O2(p) = 2 O(p) mod (2n-1) = 22 p mod (2n-1) k shuffles: Order: o (O,2n) = smallest k such that Ok(p) = p mod (2n-1) for all p between 0 and 2n Which means 2k = 1 mod (2n-1) => (2n – 1) | (2k – 1) Ok(p) = 2kp mod (2n-1) n o(O,n) o(I,n) n o(O,n) o(I,n) 2 1 2 13 12 12 3 2 2 14 12 4 4 2 4 15 4 4 5 4 4 16 4 8 6 4 3 17 8 8 7 3 3 18 8 18 8 3 6 50 21 8 9 6 6 51 8 8 10 6 10 52 8 52 11 10 10 53 52 52 12 10 12 54 52 20