Permutation Enumeration

Similar documents
Counting on r-fibonacci Numbers

Logarithms APPENDIX IV. 265 Appendix

THE LUCAS TRIANGLE RECOUNTED. Arthur T. Benjamin Dept. of Mathematics, Harvey Mudd College, Claremont, CA Introduction

1. How many possible ways are there to form five-letter words using only the letters A H? How many such words consist of five distinct letters?

Combinatorics. Chapter Permutations. Reading questions. Counting Problems. Counting Technique: The Product Rule

Unit 5: Estimating with Confidence

8. Combinatorial Structures

}, how many different strings of length n 1 exist? }, how many different strings of length n 2 exist that contain at least one a 1

Shuffling Cards. D.J.W. Telkamp. Utrecht University Mathematics Bachelor s Thesis. Supervised by Dr. K. Dajani

A generalization of Eulerian numbers via rook placements

7. Counting Measure. Definitions and Basic Properties

Shuffling. Shahrzad Haddadan. March 7, 2013

Roberto s Notes on Infinite Series Chapter 1: Series Section 2. Infinite series

arxiv: v2 [math.co] 15 Oct 2018

lecture notes September 2, Sequential Choice

AMC AMS AMR ACS ACR ASR MSR MCR MCS CRS

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 12

13 Legislative Bargaining

CS3203 #5. 6/9/04 Janak J Parekh

H2 Mathematics Pure Mathematics Section A Comprehensive Checklist of Concepts and Skills by Mr Wee Wen Shih. Visit: wenshih.wordpress.

PERMUTATIONS AND COMBINATIONS

We often find the probability of an event by counting the number of elements in a simple sample space.

Counting III. Today we ll briefly review some facts you dervied in recitation on Friday and then turn to some applications of counting.

AMC AMS AMR ACS ACR ASR MSR MCR MCS CRS

Intermediate Information Structures

Grade 6 Math Review Unit 3(Chapter 1) Answer Key

General Model :Algorithms in the Real World. Applications. Block Codes

Ch 9 Sequences, Series, and Probability

PERMUTATION AND COMBINATION

Summary of Random Variable Concepts April 19, 2000

Chapter (6) Discrete Probability Distributions Examples

Counting and Probability CMSC 250

x 1 + x x n n = x 1 x 2 + x x n n = x 2 x 3 + x x n n = x 3 x 5 + x x n = x n

On the Number of Permutations on n Objects with. greatest cycle length

CHAPTER 5 A NEAR-LOSSLESS RUN-LENGTH CODER

x y z HD(x, y) + HD(y, z) HD(x, z)

Application of Improved Genetic Algorithm to Two-side Assembly Line Balancing

AS Exercise A: The multiplication principle. Probability using permutations and combinations. Multiplication principle. Example.

Procedia - Social and Behavioral Sciences 128 ( 2014 ) EPC-TKS 2013

CS 201: Adversary arguments. This handout presents two lower bounds for selection problems using adversary arguments ëknu73,

Mathematical Explorations of Card Tricks

COLLEGE ALGEBRA LECTURES Copyrights and Author: Kevin Pinegar

15 min/ Fall in New England

Compression Programs. Compression Outline. Multimedia. Lossless vs. Lossy. Encoding/Decoding. Analysis of Algorithms

X-Bar and S-Squared Charts

H(X,Y) = H(X) + H(Y X)

A RULE OF THUMB FOR RIFFLE SHUFFLING

PROJECT #2 GENERIC ROBOT SIMULATOR

3. Error Correcting Codes

Wavelet Transform. CSEP 590 Data Compression Autumn Wavelet Transformed Barbara (Enhanced) Wavelet Transformed Barbara (Actual)

COMBINATORICS 2. Recall, in the previous lesson, we looked at Taxicabs machines, which always took the shortest path home

Spread Spectrum Signal for Digital Communications

PERMUTATIONS AND COMBINATIONS

POWERS OF 3RD ORDER MAGIC SQUARES

Combinatorics and probability

CCD Image Processing: Issues & Solutions

APPLICATION NOTE UNDERSTANDING EFFECTIVE BITS

PRACTICAL FILTER DESIGN & IMPLEMENTATION LAB

A New Space-Repetition Code Based on One Bit Feedback Compared to Alamouti Space-Time Code

A Novel Three Value Logic for Computing Purposes

A SELECTIVE POINTER FORWARDING STRATEGY FOR LOCATION TRACKING IN PERSONAL COMMUNICATION SYSTEMS

Modeling and solution for the ship stowage planning problem of coils in the steel industry

BOTTLENECK BRANCH MARKING FOR NOISE CONSOLIDATION

The Institute of Chartered Accountants of Sri Lanka

Technical Explanation for Counters

Zonerich AB-T88. MINI Thermal Printer COMMAND SPECIFICATION. Zonerich Computer Equipments Co.,Ltd MANUAL REVISION EN 1.

Name Class. Date Section. Test Form A Chapter Chapter 9 Infinite Series. 1 n 1 2 n 3n 1, n 1, 2, 3, Find the fourth term of the sequence

4. INTERSYMBOL INTERFERENCE

An Adaptive Image Denoising Method based on Thresholding

Novel pseudo random number generation using variant logic framework

11.11 Two-Channel Filter Banks 1/27

Lecture 4: Frequency Reuse Concepts

(2) The MOSFET. Review of. Learning Outcome. (Metal-Oxide-Semiconductor Field Effect Transistor) 2.0) Field Effect Transistor (FET)

Optimal Arrangement of Buoys Observable by Means of Radar

ELEC 350 Electronics I Fall 2014

On Parity based Divide and Conquer Recursive Functions

Data Mining the Online Encyclopedia of Integer Sequences for New Identities Hieu Nguyen

A SIMPLE METHOD OF GOAL DIRECTED LOSSY SYNTHESIS AND NETWORK OPTIMIZATION

Fingerprint Classification Based on Directional Image Constructed Using Wavelet Transform Domains

ECONOMIC LOT SCHEDULING

Final exam PS 30 December 2009

A SIMPLE METHOD OF GOAL DIRECTED LOSSY SYNTHESIS AND NETWORK OPTIMIZATION

VIII. Shell-Voicings

Density Slicing Reference Manual

sible number of wavelengths. The wave~~ngt~ ~ ~ ~ c ~ n b~dwidth is set low eno~gh to interfax One of the most im

202 Chapter 9 n Go Bot. Hint

COMPRESSION OF TRANSMULTIPLEXED ACOUSTIC SIGNALS

ETSI TS V3.4.0 ( )

Confidence Intervals. Our Goal in Inference. Confidence Intervals (CI) Inference. Confidence Intervals (CI) x $p s

Alignment in linear space

ELEC 204 Digital Systems Design

PHY-MAC dialogue with Multi-Packet Reception

Math 140 Introductory Statistics

Solution 2 Discussion:

A Math Learning Center publication adapted and arranged by. EUGENE MAIER and LARRY LINNEN

CP 405/EC 422 MODEL TEST PAPER - 1 PULSE & DIGITAL CIRCUITS. Time: Three Hours Maximum Marks: 100

Tehrani N Journal of Scientific and Engineering Research, 2018, 5(7):1-7

Introduction to Wireless Communication Systems ECE 476/ECE 501C/CS 513 Winter 2003

ETSI TS V3.1.1 ( )

COS 126 Atomic Theory of Matter

Transcription:

RMT 2012 Power Roud Rubric February 18, 2012 Permutatio Eumeratio 1 (a List all permutatios of {1, 2, 3} (b Give a expressio for the umber of permutatios of {1, 2, 3,, } i terms of Compute the umber for = 5 Solutio to Problem 1: (a (1, 2, 3, (1, 3, 2, (2, 1, 3, (2, 3, 1, (3, 1, 2, (3, 2, 1 (b!, For = 5 there are 120 permutatios 2 (a Compute the compositio σ τ of permutatios σ = (1, 5, 4, 3, 6, 2 ad τ = (2, 4, 6, 3, 1, 5 (b Compute the iverse of (3, 1, 4, 2 ad the iverse of (2, 4, 6, 3, 1, 5 (c Show that (σ τ 1 = τ 1 σ 1 for all permutatios σ ad τ of {1, 2,, } Solutio to Problem 2: (a (2, 1, 3, 6, 5, 4 (b (2, 4, 1, 3, (5, 1, 4, 2, 6, 3 (c It is eough to show that τ 1 σ 1 is iverse of (σ τ It ca be prove to be (τ 1 σ 1 (σ τ = τ 1 (σ 1 σ τ = τ 1 τ = 1 3 (a Suppose that a process shuffles a deck of σ ito τ Which permutatio will be produced whe (1, 2,, is shuffled by that process? Justify Solutio to Problem 3: (a τ σ 1 Sice a permutatio µ chages σ to µ σ, µ should be τ σ 1 i order for µ σ to be τ 4 For ay radom shuffle, show that the trasitio probability from σ to τ is same as from 1 to τ σ 1 Solutio to Problem 4: As i Problem 3, the permutatio µ = τ σ 1 which chages σ ito τ also chages 1 ito τ σ 1 5 (a List the ascets ad descets of (9, 2, 7, 6, 3, 1, 8, 4, 5 (b Compute the umber of permutatios of {1, 2, 3} with exactly oe descet (c There are 11 permutatios of {1, 2, 3, 4} with exactly two ascets List them No explaatios required Solutio to Problem 5: (a Ascets at 2, 6, 8; descets at 1, 3, 4, 5, 7 (b 4 They are (1, 3, 2, (2, 1, 3, (2, 3, 1, (3, 1, 2 (c (1, 2, 4, 3, (1, 3, 2, 4, (1, 3, 4, 2, (1, 4, 2, 3, (2, 1, 3, 4, (2, 3, 1, 4, (2, 3, 4, 1, (2, 4, 1, 3, (3, 1, 2, 4, (3, 4, 1, 2, (4, 1, 2, 3 6 Prove the symmetry property of Euleria umbers: = k k 1 Solutio to Problem 6: We fid a bijectio (oe-to-oe correspodece betwee the permutatios with k ascets ad the permutatios with k 1 ascets Ideed, if a permutatio σ = (σ(1, σ(2,, σ( has k ascets, the it has k 1 descets because each positio i < is either a ascet or a descet Reversig the permutatio swaps ascets ad descets, so therefore the permutatio (σ(, σ( 1,, σ(1 has k 1 ascets ad k descets

RMT 2012 Power Roud Rubric February 18, 2012 7 Prove that the Euleria umbers satisfy the recurrece 1 1 = (k + 1 + ( k k k k 1 Solutio to Problem 7: Cosider ay permutatio σ of {1, 2,, } with k ascets We have σ(i = for some 1 i, ad removig this σ(i yields a permutatio σ of {1, 2,, 1} with either k or k 1 ascets Every permutatio of {1, 2,, } with k ascets is therefore built from a permutatio of {1, 2,, 1} with k or k 1 ascets by isertig There are ow two cases Give a permutatio of {1, 2,, 1} with k 1 ascets, we gai a ascet by isertig oly whe we do so at a descet or at the ed of the permutatio There are k 1 descets, so this produces k permutatios of {1, 2,, } with k ascets Similarly, give a permutatio of {1, 2,, 1} with k ascets, we wat to preserve the umber of ascets whe isertig To do this, the isertio must happe at oe of the k ascets, or at the begiig of the permutatio This produces k + 1 permutatios of {1, 2,, } with k ascets Combiig these two cases yields the desired recurrece 8 Usig the recurrece for Euleria umbers, compute a table of Euleria umbers Iclude k for 0 k 6 Solutio to Problem 8: 0 1 2 3 4 5 6 0 1 1 1 0 2 1 1 0 3 1 4 1 0 4 1 11 11 1 0 5 1 26 66 26 1 0 6 1 57 302 302 57 1 0 9 Prove Worpitzky s Idetity: x = k ( x + k To esure that the biomial coefficiet makes sese, assume that x is a iteger ad x 1 Solutio to Problem 9: We prove this by iductio Firstly, otice that i the case = 0, we have 0 ( x 0 0 = 1 = x 0 Now, assume that x = ( x+k k We will use this to prove Worpitzky s idetity for + 1 We compute usig the recurrece for Euleria umbers: +1 ( +1 + 1 x + k ( +1 x + k ( x + k = (k + 1 + ( k + 1 k + 1 k + 1 k 1 + 1 ( x + k ( x + k + 1 = (k + 1 + ( k k + 1 k + 1 ( [ x + k = (k + 1 x + k + ( k x + k + 1 ] k + 1 + 1 ( [ ] x + k x + x ( x + k = = x = x x = x +1 k + 1 k This completes the iductio 1 This actually works i greater geerality We ca defie geeralized biomial coefficiets ( a b for ay real umbers a ad b, ad Worpitzky s idetity holds i this more geeral cotext

RMT 2012 Power Roud Rubric February 18, 2012 10 Recall the defiitio of the iverse of a permutatio from the text before problem 2 Show that the umber of risig sequeces of a permutatio σ is equal to oe more tha the umber of descets of σ 1 That is, show #{risig sequeces of σ} = #{descets of σ 1 } + 1 Solutio to Problem 10: If k ad k + 1 are i the same risig sequece, the their positios σ 1 (k ad σ 1 (k + 1 must satisfy σ 1 (k < σ 1 (k + 1 This meas that k + 1 starts a ew risig sequece if σ 1 (k > σ 1 (k + 1, ie if σ 1 has a descet at positio k Also, there is a additioal risig sequece that starts at 1; this does ot correspod to a descet Hece, the umber of risig sequeces of σ is oe more tha the umber of descets of σ 1 The Gilbert-Shao-Reeds shuffle 11 Compute (o explaatios required: (a ( 7 3,2,2, (b ( 8 2,2,2,2, ad (c ( 100 99,1,0,0,0 Solutio to Problem 11: (a 210 (b 2520 (c 100 12 Take a stack of three cards labeled 1, 2, 3 from bottom to top ad apply the GSR shuffle oce Cosider the resultig pile, from bottom to top, as a permutatio of 1, 2, 3 (a Are ay permutatios impossible to get? If so, which oe(s? (b Compute the probability of puttig (i 0, (ii 1, (iii 2, (iv 3 cards ito the left pile durig the cut (c Compute the probability of the fial permutatio beig (i 3, 1, 2, (ii 1, 2, 3 No explaatios required Solutio to Problem 12: (a Yes, 3, 2, 1 oly (b (i 1/8, (ii 3/8, (iii 3/8, (iv 1/8 (c (i 1/8, (ii 1/2 13 (a I the geeral case with cards, why do the give probabilities of cuttig 0, 1,, cards ito the left pile always actually add up to 1? That is, show that ( 0 2 + ( 1 2 + + ( 2 = 1 (b Take a stadard deck of 52 cards ad perform oe GSR shuffle Show that the probability of cuttig 0 cards ito oe of the piles is less tha oe i oe trillio (10 12 Solutio to Problem 13: (a Ca be doe by quotig biomial theorem Alteratively, for a set S of elemets, ( ( 0 + 1 + + ( couts the subsets of S, which is 2 2 (b 2 < 1 52 2 = 1 48 16 < 1 12 10 12 14 (a Take a 4-card deck ad perform oe 3-shuffle Compute the probability that after the cuttig stage, the pile sizes will be 1, 1, 2 i some order

RMT 2012 Power Roud Rubric February 18, 2012 (b Now suppose the same 4-card deck has already bee cut ito piles of size 1, 1, 2 from left to right (so the leftmost pile has the card umbered 1, the middle pile has card 2, ad the rightmost pile has cards 3 ad 4 Perform the droppig stage (i How may permutatios of 1, 2, 3, 4 are possible results? (ii Compute the probability (give this iitial cut that the fial permutatio is 2, 3, 4, 1 (iii Compute the probability that it is 3, 2, 4, 1 No explaatios required Solutio to Problem 14: (a 4/9 (b (i 12 (ii 1/12 (iii 1/12 15 (a Prove that the probabilities we ve give for every possible way to cut the cards durig the cuttig stage really do add up to 1 (b Take a -card deck which has already bee cut ito a piles of size j 1,, j a After the droppig stage, how may permutatios of 1,, are possible? Justify (c Prove that, give this iitial cut, every permutatio of 1,, which is possible after the droppig stage occurs with equal probability Show that therefore every possible path of operatio, from deck to cut piles to fial fial permutatio, occurs with probability exactly 1/a Coclude that the trasitio probability of the GSR a-shuffle from 1 to σ is the same as the umber of paths leadig to σ divided by a Refer to the defiitios after problem 3 Solutio to Problem 15: (a Similar to Problem 13a Possible solutios are quotig the multiomial theorem, explaiig the combiatorial meaig, or workig with iductio o a (b ( The order of the cards withi each pile caot chage, so they ca be cosidered idistiguishable (c Iduct o Clear whe all piles 0 Give some possible permutatio, suppose WLOG the first card comes from pile 1 The probability of this permutatio is the j1 times the probability of the permutatio with the first card removed give piles of size j 1 1, j 2,, j a, which by the iductive hypothesis is 1/ ( ( 1 j 1 1,,j a This is 1/ as desired (Alteratively, directly compute that regardless of droppig order, the umerator must be j 1! j a! ad the deomiator must be! 16 (a A maximum etropy a-shuffle is ay shuffle i which you cut a -card deck ito a (possibly empty piles ad the drop cards from the piles oe by oe, with the stipulatio that every possible path from deck to piles to fial permutatio should be equally likely Prove that the oly way to satisfy this property is to use the same probabilities as i the GSR a-shuffle (b A sequetial a-shuffle works as follows First you cut a -card deck ito a piles accordig to the GSR probability distributio (ie gettig piles of size j 1,, j a occurs with probability ( The you shuffle pile 1 ad 2 together usig the droppig stage of the stadard GSR 2-shuffle Havig doe this, you shuffle the combied pile with pile 3, take the result ad shuffle with pile 4, ad so o util you have oly oe pile left Prove that the probability of gettig ay particular permutatio at the ed is the same as with the stadard a-shuffle (c A iverse a-shuffle works as follows Take your -card deck ad, dealig from the bottom, place each card o oe of a piles uiformly at radom (that is, choose each pile with probability 1/a Oce you re doe, stack the piles together i order from left to right (i Show that iverse a-shuffle is ot equivalet to the stadard a-shuffle i geeral by exhibitig a permutatio of 4 cards reachable by a iverse 2-shuffle which is ot reachable by a stadard 2-shuffle Justify

RMT 2012 Power Roud Rubric February 18, 2012 (ii Show that the trasitio probability from σ to τ of the iverse a-shuffle is the same as the trasitio probability τ to σ of the stadard a-shuffle Refer to the defiitios after problem 3 Solutio to Problem 16: (a Give a deck cut ito piles of size j 1,, j a, there are ecessary ( outcomes which must be equally likely Therefore the probability of gettig piles of size j 1,, j a must be proportioal to ( (b It is eough to show that the sequetial a-shuffle also satisfies the property of 15(c: every possible permutatio occurs with equal probability give the iitial cut, as it characterizes the maximum etropy a-shuffle Cosider the relative locatio of cards i pile 1 ad 2 After shufflig piles 1 ad 2 together, the order of the cards withi those piles does ot chage aymore Thus, the shufflig of piles 1 ad 2 together is uiquely determied if the fial permutatio is give Similarly, i each of the 2-shuffles i the sequece we must follow a specific path to reach the fial permutatio Thus the probability for all permutatios should be same (c (i 2413 is the uique aswer (ii For the stadard a-shuffle, we showed that the trasitio probability of a permutatio is the umber of possible paths to the permutatio divided by a It is easy to see that this is also true for the iverse a-shuffle Hece it suffices to show that the path from σ to the set of piles P to τ exists uder the iverse a-shuffle if ad oly if the path from τ to P to σ exists uder the stadard a-shuffle I a iverse shuffle, the path (σ, P, τ is possible if ad oly if mergig P gives the target permutatio τ ad the cards i each pile of P are i order withi σ But i the stadard shuffle, the path (τ, P, σ is possible if ad oly if mergig P gives the origial permutatio τ ad the cards i each pile of P are i order withi σ The two coditios coicide exactly 17 (a Prove that a iverse a-shuffle followed by a iverse b-shuffle gives rise to permutatios with the same probabilities as a iverse ab-shuffle (This is called the product rule (b Explai why this property of a a-shuffle followed by a b-shuffle beig the same as a ab-shuffle must also hold whe carryig out the stadard (AKA maximal etropy ad sequetial forms of the GSR shuffle Justify rigorously Solutio to Problem 17: (a Label each card with two umbers accordig to the piles it laded i durig the a-shuffle ad the b-shuffle Those cards with the same label form a pile i a ab-shuffle (b Let P a (σ τ ad P a (σ τ be the trasitio probabilities from σ to τ for the stadard a- shuffle ad iverse a-shuffle respectively The probability of obtaiig τ from σ after a a-shuffle ad a b-shuffle is give by P a (σ µp b (µ τ µ where the sum is take over all permutatios µ Meawhile problem 16(c gives P a (σ µ = P a (µ σ, so this sum is the same as µ P a (µ σp b (τ µ Now this ca be iterpreted as the probability of obtaiig σ from τ after a iverse b-shuffle ad iverse a-shuffle, ad accordig to 17(a this is the same as P ab (τ σ Applyig problem 16(c agai gives P ab (τ σ = P ab (σ τ, ad the proof follows 18 (a Suppose σ is a permutatio with r risig sequeces Prove that the trasitio probability from 1 to σ for GSR a-shuffle of a -card deck is ( a+ r a

RMT 2012 Power Roud Rubric February 18, 2012 (b Use this to give aother proof of Worpitzky s idetity (c Use part a of this problem ad Problem 17 to show that if we repeat a a-shuffle k times o the same deck, the probability of ay oe permutatio σ appearig after the last shuffle approaches 1/! as k approaches ifiity Solutio to Problem 18: (a We eed to cout the umber of differet ways to cut the deck ito piles which have σ as a possible resultig permutatio We will make a 1 cuts which ca be i ay of + 1 locatios i the deck The risig sequeces determie r 1 of these cuts, but the remaiig a r ca be assiged arbitrarily This gives ( a+ r ways i which the deck ca be cut There are a possible fial permutatios (coutig repeats, givig the desired probability (b It is easy to see usig a double iductio proof that the umber of permutatios with r risig sequeces equals r 1 Thus, usig the symmetry property of of Euleria umbers, 1 = 1 ( a+ r a r=0 r 1 = 1 ( a+ r r = 1 ( a+k a r=0 k where k = r (c The probability is ( a k + r a r=0 1 a k where r is the umber of risig sequeces of σ This is ( a k + r a k ( a k + 1 r a k 1! ad each multiplicative factor ca be rewritte as 1 + i r, which approaches 1 as k approaches a k Thus the whole expressio approaches 1/! Perfect shuffles 19 Compute (o explaatio eeded (a I(O(I(0, 1, 2, 3, 4, 5, (b the order of O o 8 cards, ad (c O k (0, 1, 2, 3, 4, 5, 6, 7 for all k 1 Solutio to Problem 19: (a 5, 3, 4, 1, 2, 0 (b 3 (c k 0 (mod 3 : 0, 1, 2, 3, 4, 5, 6, 7 k 1 (mod 3 : 0, 4, 1, 5, 2, 6, 3, 7 k 2 (mod 3 : 0, 2, 4, 6, 1, 3, 5, 7 20 (a Prove that after oe out-shuffle of 2 cards, the card umbered j has moved to positio 2j (mod 2 1 (b Prove that the order of a i-shuffle o 2 cards is the same as the order of a out-shuffle o 2 + 2 cards (c Prove that the order of a out-shuffle o 2 cards is the least positive iteger k such that 2 k 1 (mod 2 1 (d Compute the order of a out-shuffle o 52 cards Solutio to Problem 20: (a For j 1, j moves to 2j, immediately before j + That is, j + moves to 2j + 1 = 2(j + (2 1

RMT 2012 Power Roud Rubric February 18, 2012 (b Add a card to the begiig ad ed; ow each out-shuffle o the 2 + 2 cards is just a i-shuffle o the middle 2 cards with two ghost cards at the ed that ever move (c This follows from part a (d 8 21 (a Take a deck of 2 m cards ad umber them as usual Prove that if a card s umber has biary represetatio a m a m 1 a 0, after oe out-shuffle, that card has moved to positio a m 1 a 0 a m (b What do m i-shuffles do to 2 m cards? Justify Solutio to Problem 21: (a Follows from j 2j (mod 2 m 1, sice the a m 1 2 m 1 (mod 2 m 1 (b Reverses them This is clearest from the perspective of a out-shuffle o 2 m + 2 cards, i which the jth card goes to 2 m j (mod 2 m + 1, or j (mod 2 m + 1 22 Give a deck of 2 cards umbered as usual ad k {0, 1,, 2 1}, state ad prove a algorithm cosistig oly of i- ad out- shuffles for brigig the card umbered 0 to the kth positio i the deck (Hit: cosider the biary expasio of k Solutio to Problem 22: Iterpret 1 as i ad 0 as out i the aforemetioed biary expasio (with the left-most digit beig 1 ad perform the resultig operatios from left to right The umber 0 starts out i the 0 th positio, ad the first i-shuffle takes it to the 1 st positio Note that if your card is at positio j, for j ot too large, a out-shuffle takes it to 2j ad a i-shuffle takes it to 2j + 1 so each operatio you do pushes the biary expasio of j to the left ad sticks a appropriate 0 or 1 i the uits digit You ever have to mod out because this process does t overshoot