Card Shuffling as a Dynamical System

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Mathematical Preliminaries
Chapter 8 Introduction to Number Theory. 2 Contents Prime Numbers Fermats and Eulers Theorems.
Unit 3: Probability 3.1: Introduction to Probability
Angstrom Care 培苗社 Quadratic Equation II
Statistics Part II Math 416. Game Plan Creating Quintile Creating Quintile Decipher Quintile Decipher Quintile Per Centile Creation Per Centile Creation.
1
& dding ubtracting ractions.
Sequential Logic Design
Multiplication X 1 1 x 1 = 1 2 x 1 = 2 3 x 1 = 3 4 x 1 = 4 5 x 1 = 5 6 x 1 = 6 7 x 1 = 7 8 x 1 = 8 9 x 1 = 9 10 x 1 = x 1 = x 1 = 12 X 2 1.
Division ÷ 1 1 ÷ 1 = 1 2 ÷ 1 = 2 3 ÷ 1 = 3 4 ÷ 1 = 4 5 ÷ 1 = 5 6 ÷ 1 = 6 7 ÷ 1 = 7 8 ÷ 1 = 8 9 ÷ 1 = 9 10 ÷ 1 = ÷ 1 = ÷ 1 = 12 ÷ 2 2 ÷ 2 =
We need a common denominator to add these fractions.
Math 6 SOL Review Pt Released Test 26. Which solid could not have two parallel faces? A. A. Cube B. B. Rectangular prism C. C. Pyramid D. D.
CALENDAR.
Multiplication Facts Review. 6 x 4 = 24 5 x 5 = 25.
Mean, Median, Mode & Range
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Who Wants To Be A Millionaire? Decimal Edition Question 1.
Learning to show the remainder
1 Advanced Tools for Account Searches and Portfolios Dawn Gamache Cindy Bylander.
The 5S numbers game..
1 Econ 240A Power Three. 2 Summary: Week One Descriptive Statistics –measures of central tendency –measures of dispersion Distributions of observation.
CSC 2510 Test 3 1. Give the names of the formula or rule that provides the answer for each of the following problems. Do not try to solve the problems!
Learning to Play Fun Factor! Goals: Have Fun and Learn About Factoring. Improve Math Student Interaction.
Break Time Remaining 10:00.
Division- the bus stop method
An Extra Point Quiz. Are You Smarter than a Pre-Calc Student is a game in which the first 10 questions the class is playing the game together to earn.
PP Test Review Sections 6-1 to 6-6
DIVISIBILITY, FACTORS & MULTIPLES
Briana B. Morrison Adapted from William Collins
Copyright © Cengage Learning. All rights reserved.
Discrete Mathematical Structures: Theory and Applications
© Glenn Rowe AC Lab 2 A simple card game (twenty- one)
MAT 103 Probability In this chapter, we will study the topic of probability which is used in many different areas including insurance, science, marketing,
1 Combinations & Counting II Samuel Marateck © 2009.
Cache and Virtual Memory Replacement Algorithms
Basic Probability. Frequency Theory A mathematical approach to making the notion of chance rigorous. Best applied to processes which can be repeated many.
The Fast Fourier Transform (and DCT too…)
Outline Minimum Spanning Tree Maximal Flow Algorithm LP formulation 1.
1 University of Utah – School of Computing Computer Science 1021 "Thinking Like a Computer"
Binary Values and Number Systems
Factors, Prime Numbers & Composite Numbers
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
5 Locus Contents 5.1 Introduction to Locus
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
Before Between After.
25 seconds left…...
Subtraction: Adding UP
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Datorteknik IntegerAddSub bild 1 Integer arithmetic Depends what you mean by "integer" Assume at 3-bit string. –Then we define zero = 000 one = 001 Use.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
18-Dec-14 Pruning. 2 Exponential growth How many leaves are there in a complete binary tree of depth N? This is easy to demonstrate: Count “going left”
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
& dding ubtracting ractions.
Lial/Hungerford/Holcomb/Mullins: Mathematics with Applications 11e Finite Mathematics with Applications 11e Copyright ©2015 Pearson Education, Inc. All.
Physics for Scientists & Engineers, 3rd Edition
Completing the Square Topic
Copyright Tim Morris/St Stephen's School
9. Two Functions of Two Random Variables
Data Structures Using C++ 2E
Card Shuffling How many perfect shuffles will return a full deck
Presentation transcript:

Card Shuffling as a Dynamical System Dr. Russell Herman Department of Mathematics and Statistics University of North Carolina at Wilmington How does a magician know that the eighth card in a deck of 50 cards returns to it original position after only three perfect shuffles?  How many perfect shuffles will return a full deck of cards to their original order? What is a "perfect" shuffle?   We learn about continuous systems .. We derive models by starting discrete .. We simulate using discrete … here we start discrete and generalize to continuous .. There are many continuous models .. But we will concentrate on discrete

Introduction History of the Faro Shuffle The Perfect Shuffle Mathematical Models of Perfect Shuffles Dynamical Systems – The Logistic Model Features of Dynamical Systems Shuffling as a Dynamical System In this talk we will review some of the history and mathematics of the perfect shuffle. We will explore models of the perfect shuffle of a deck of arbitrary size, leading to a discrete dynamical system. In particular, we will look at the dynamics of the doubling map and the logistic map as a way of introducing standard notions from nonlinear dynamics, such as fixed points, periodic orbits, symbolic dynamics and chaos. This talk will be at a level accessible by undergraduates and is meant as an introduction to discrete dynamical systems via card shuffling

A Bit of History

History of the Faro Shuffle Cards Western Culture - 14th Century Jokers – 1860’s Pips – 1890’s added numbers First Card tricks by gamblers Origins of Perfect Shuffles not known Game of Faro 18th Century France Named after face card Popular 1803-1900’s in the West

The Game of Faro Decks shuffled and rules are simple (fâr´O) [for Pharaoh, from an old French playing card design], gambling game played with a standard pack of 52 cards. First played in France and England, faro was especially popular in U.S. gambling houses in the 19th Century. Players bet against a banker (dealer), who draws two cards–one that wins and another that loses–from the deck (or from a dealing box) to complete a turn. Bets–on which card will win or lose– are placed on each turn, paying 1:1 odds. Columbia Encyclopedia, Sixth Edition. 2001 Players bet on 13 cards Lose Slowly! Copper Tokens – bet card to lose “Coppering”, “Copper a Bet” Analysis – De Moivre, Euler, …

The Game Wichita Faro http://www.gleeson.us/faro/ http://www.bcvc.net/faro/rules.htm

Perfect (Faro or Weave) Shuffle Problem: Divide 52 cards into 2 equal piles Shuffle by interlacing cards Keep top card fixed (Out Shuffle) 8 shuffles => original order What is a typical Riffle shuffle? What is a typical Faro shuffle?

See! Period 2 @ 18 and 35!

History of Faro Shuffle 1726 – Warning in book for first time 1847 – J H Green – Stripper (tapered) Cards 1860 – Better description of shuffle 1894 – How to perform Koschitz’s Manual of Useful Information Maskelyne’s Sharps and Flats – 1st Illustration 1915 – Innis – Order for 52 Cards 1948 – Levy – O(p) for odd deck, cycles 1957 – Elmsley – Coined In/Out - shuffles

Mathematical Models

A Model for Card Shuffling Label the positions 0-51 Then 0->0 and 26 ->1 1->2 and 27 ->3 2->4 and 28 ->5 … in general? Ignoring card 51: f(x) = 2x mod 51 Recall Congruences: 2x mod 51 = remainder upon division by 51

The Order of a Shuffle Minimum integer k such that 2 k x = x mod 51 for all x in {0,1,…,51} True for 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(21) k= 7, 2 k - 1 = 127 k= 8, 2 k - 1 = 255 = 5(51)

Generalization to n cards

The Out Shuffle

The In Shuffle

Representations for n Cards In Shuffles Out Shuffles

Order of Shuffles 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)

o (O,2n) = Order for 2n Cards One 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: Ok(p) = 2kp mod (2n-1) Order: o (O,2n) = smallest k for 0 < p < 2n such that Ok(p) = p mod (2n-1) Or, 2k = 1 mod (2n-1) => (2n – 1) | (2k – 1)

The Orders of Perfect Shuffles 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 Demonstration

Another Model for 2n Cards Label positions with rationals Out Shuffle Example: Card 10 of 52: x = 9/51 In Shuffle Example: Card 10 of 52: x = 9/51

Shuffle Types All denominators are odd numbers.

Doubling Function

Discrete Dynamical Systems First Order System: xn+1 = f (xn) Orbits: {x0, x1, … } Fixed Points Periodic Orbits Stability and Bifurcation Chaos !!!!

The Logistic Map Discrete Population Model Competition Pn+1 = a Pn Pn+1 = an P0 a>1 => exponential growth! Competition Pn+1 = a Pn - b Pn2 xn = (a/b)Pn, r=a/b => xn+1 = r xn(1 - xn), xne[0,1] and re[0,4]

Example r=2.1 Sample orbit for r=2.1 and x0 = 0.5

Example r=3.5

Example r=3.56

Example r=3.568

Example r=4.0

Iterations More Iterations

Fixed Points f(x*) = x* Logistic Map - Cobwebs x* = r x*(1-x*) => x* = 0 or x* = 1 – 1/r Logistic Map - Cobwebs

Periodic Orbits for f(x)=rx(1-x) x1 = r x0(1- x0) and x2 = r x1(1- x1) = x0 Or, f 2 (x0) = x0 Period k - smallest k such that f k (x*) = x* Periodic Cobwebs

Stability Fixed Points Periodic Orbits Bifurcations |f’(x*)| < 1 |f’(x0)| |f’(x1)| … |f’(xn)| < 1 Bifurcations

Bifurcations r1 = 3.0 r2 = 3.449490 ... r3 = 3.544090 ... r4 = 3.564407 ... r5 = 3.568759 ... r6 = 3.569692 ... r7 = 3.569891 ... r8 = 3.569934 ...

Itineraries: Symbolic Dynamics For G (x) = 4x ( 1-x ) Assign Left “L” and Right “R” Example: x0 = 1/3 x0 = 1/3 => “L” x1 = 8/9 => “LR” x2 = 32/81 => “LRL” x3 = … => “LRL …” Example: x0 = ¼ { ¼, ¾, ¾, …}=>” LRRRR…” Subscripts, itinerary.mws???? Periodic Orbits “LRLRLR …”, “RLRRLRRLRRL …”

Shuffling as a Dynamical System S(x) vs S4(x)

Demonstration

Iterations for 8 Cards

S3(x) vs S2(x) S3(x) vs S2(x) How can we study periodic orbits for S(x)?

Binary Representations 0.10112=1(2-1)+0(2-2)+1(2-3)+1(2-4) = 1/2 + 1/8 + 1/16 = 10/16 = 5/8 xn+1 = S(xn), given x0 Represent xn’s in binary: x0 = 0.101101 Then, x1 = 2 x0 – 1 = 1.01101 – 1 = 0.01101 Note: S shifts binary representations! Repeating Decimals S(0.101101101101…) = 0.011011011011… S(0.011011011011…) = 0.110110110110…

Periodic Orbits Period 2 Period 3 Maple Computations 0.102, 0.012, 0.112 = ? Period 3 0.1002, 0.0102, 0.0012 = ? 0.1102, 0.0112, 0.1012 = ? Maple Computations

Card Shuffling Examples 8 Cards – All orbits are period 3 52 Cards – Period 2 50 Cards – Period 3 Orbit (Cycle) Recall: Period 2 - {1/3, 2/3} Period 3 – {1/7, 2/7, 4/7} and {3/7, 6/7, 5/7} Out Shuffles – i/(N-1) for (i+1) st card {1/7, 2/7, 4/7} and {3/7, 6/7, 5/7} and {0/7, 7/7} 1/3 = ?/51 and 2/3 = ?/51 1/7 = ?/49

Finding Specific t-Cycles Period k: 0.000 … 0001 2-t + (2-t)2 + (2-t) 3 + … = 2-t /(1- 2-t ) Or, 0.000 … 0001 = 1/(2t -1) Examples Period 2: 1/3 Period 3: 1/7 In general: Select Shuffle Type Rationals of form i/r => (2t –1) | r Example r = 3(7) = 21 Out Shuffle for 22 or 21 cards In Shuffle for 20 or 21 cards Demonstration

Other Topics Cards Nonlinear Dynamical Systems Alternate In/Out Shuffles k- handed Perfect Shuffles Random Shuffles – Diaconis, et al “Imperfect” Perfect Shuffles Nonlinear Dynamical Systems Discrete (Difference Equations) Systems in the Plane and Higher Dimensions Continuous Dynamical Systems (ODES) Integrability Nonlinear Oscillations MAT 463/563 Fractals Chaos Lyupanov exponents .. Period 3 => chaos, stability issues and other types of riffle shuffles

Summary History of the Faro Shuffle The Perfect Shuffle – How to do it! Mathematical Models of Perfect Shuffles Dynamical Systems – The Logistic Model Features of Dynamical Systems Symbolic Dynamics Shuffling as a Dynamical System

References K.T. Alligood, T.D. Sauer, J.A. Yorke, Chaos, An Introduction to Dynamical Systems, Springer, 1996. S.B. Morris, Magic Tricks, Card Shuffling and Dynamic Computer Memories, MAA, 1998 D.J. Scully, Perfect Shuffles Through Dynamical Systems, Mathematics Magazine, 77, 2004

Websites Thank you ! http://i-p-c-s.org/history.html http://jducoeur.org/game-hist/seaan-cardhist.html http://www.usplayingcard.com/gamerules/briefhistory.html http://bcvc.net/faro/ http://www.gleeson.us/faro/ Thank you !