Card shuffles: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: added the REXX computer programming language.)
(Modified task description)
Line 1: Line 1:
[[Category:Games]]
[[Category:Games]]


{{draft task|Games}}
{{draft task|Games}}{{clarified-review}}


There are many techniques that people use to shuffle [[Playing cards|cards]] for card games. Some are more effective than others.
There are many techniques that people use to shuffle [[Playing cards|cards]] for card games. Some are more effective than others.
Line 16: Line 16:
One iteration of the riffle shuffle is defined as:
One iteration of the riffle shuffle is defined as:
# Split the deck into two piles
# Split the deck into two piles
# Merge the two piles by alternating taking one card from the top or bottom (the same throughout the whole merge) of each pile
# Merge the two piles by taking one card from the top of either pile in proportion to the number of cards remaining in the pile. To start with the probability for both piles will be 26/52 (50-50), then 25/51-26/51 etc etc as the riffle progresses.
# The merged deck is now the new "shuffled" deck
# The merged deck is now the new "shuffled" deck