Randomizing a deck of cards


I like the card game bridge and play in local duplicate club tournaments about twice a week. Depending on the game or the preference of the director, the hands that are played are either shuffled and dealt by the players at the beginning of the session or are hands that have been previously generated by a computer and arranged by a dedicated card sorter.

In bridge, each of the four players starts with 13 cards and if the deck of cards has been completely randomized before being dealt, the distribution of the four suits (in any order) can vary from somewhat even distributions such as 4-4-3-2 (21.6% probability) to the next most likely 5-3-3-2 (15.5%), 5-4-3-1- (12.9%). 5-4-2-2- (10.6%), 4-3-3-3 (10.5%) and then starts dropping sharply until it gets to 9-3-1-0 (0.01%). More skewed distributions are even rarer. (The Official Encyclopaedia of Bridge (1984))

A common refrain that I hear from players at the table is that they feel that the hands that are generated by the computer tend to have more skewed distributions than the ones shuffled and dealt at the table. They think that whoever is in charge of the computer that generates the hands tend to program it that way in order to provide greater challenge. I heard this so often that I became curious if this was the case and looked it up to see if there was anything to this bit of bridge folklore.

It turns out that the American Contract Bridge League expressly prohibits tinkering with the settings to create more skewed distributions. The hands that are generated by the computer are thus purely random.

Rumors circulate about how computer dealt hands are more distributional than seen at a Club game.  First, neither the ACBL Director In Charge, nor anyone else involved with making boards are allowed to pick and choose hands based on certain characteristics. The master ACBL computer which “deals” hands for all tourneys in North America is based on random numbers to ensure the hands are truly random. So the ACBL files sent to the Director receives hands that closely represent hand patterns you would find in bridge tables. This may seem surprising since some Club players seem to encounter flatter hands, as opposed to wilder distribution with computer-generated hands. Why is this true?

So are the players mistaken in their gut sense that the computer generates hands that are more skewed? No, it turns out that they are right, but for a very different and interesting reason than what they think, dealing with the counter-intuitive nature of randomness.

It turns out that if one starts with a completely randomized deck of cards, the hands that are generated have the distributions listed with the above probabilities. But the hands that are created with decks shuffled at the table tend to be ‘flatter’ (i.e., have more even distributions) because it is hard to create a completely randomized deck by shuffling.

This turns out to be an interesting mathematical problem with many applications where the results have been published in journals and books. Most people attempt to create a randomized deck by the so-called ‘riffle-shuffle’ or ‘faro’ method, where you split a deck into two and then holding each half in a hand you interleave them, as shown in the video below. However this only begins to produce randomization after five such shuffles and gets close to complete randomization only if you repeat it at least 11 or 12 times. The authors of the study say that seven shuffles is sufficient to produce approximate randomization for most (but not all) purposes. But most people only do it once and the more conscientious may do it three times but I have never seen anyone do it more than that. Magicians take advantage of the fact that a riffle shuffle does not randomize a deck for some of their tricks.

Interestingly, the seemingly primitive method known as ‘smooshing’ (where you just spread the cards on the table and then randomly move them around with your hands before bringing them back together, takes between 30-60 seconds but, although looking childish, produces more randomization than a few riffle-shuffles. You can also improve the randomness by not dealing the deck of cards in the same pattern (i.e,, say entirely clockwise or counter-clockwise) but by alternating (one round clockwise, the next round counter-clockwise, and so on)

Randomness often does not look quite like what we expect. If you ask people to write down a long sequence of heads H and tails T that they think should look as if it was randomly generated by (say) tossing a coin (like HHTHTT…), professional statisticians can almost always tell if the sequence was generated by a human who simply wrote it down or by a truly randomized method such as actually tossing coins. This is because humans think that randomness means somewhat even distributions and will avoid long consecutive strings of H’s or T’s while a randomly generated sequence will contain them. In other words, a more even distribution is a sign of non-randomness, not the opposite.

Hence the bridge players are right to think that computer-generated hands have more skewed distribution but are wrong in attributing it to the computer program being adjusted to not be random. It is the decks shuffled by people that are not properly randomized and hence produce flatter distributions than the randomly generated computer hands.

Comments

  1. Dunc says

    And of course, a perfect faro shuffle is absolutely predictable, and can be used to deterministically reorder a deck -- a fact which is used in some card tricks.

Leave a Reply

Your email address will not be published. Required fields are marked *