Card shuffles: Difference between revisions

Content added Content deleted
m (J: remove sentence which seems unnecessary with current task description)
Line 172: Line 172:
riffle=: (({.~+/)`(I.@])`(-.@]#inv (}.~+/))} ?@(#&2)@#)@]^:[</lang>
riffle=: (({.~+/)`(I.@])`(-.@]#inv (}.~+/))} ?@(#&2)@#)@]^:[</lang>


Overhand shuffle is implemented not as was described in wikipedia but as described on the talk page "the cuts are taken from the top of the deck and placed on top of the new deck". The probability of a cut occurring between each pair of cards in this overhand shuffle is proportional to the reciprocal of the square root of the number of cards in the deck.
The probability of a cut occurring between each pair of cards in this overhand shuffle is proportional to the reciprocal of the square root of the number of cards in the deck.


In other words, overhand cut breaks the deck into some number of pieces and reverses the order of those pieces.
In other words, overhand cut breaks the deck into some number of pieces and reverses the order of those pieces.