Monthly Archives: February 2017

Here’s the best way to shuffle a pack of cards – with a little help from some maths

Graham Kendall, University of Nottingham

Shuffling a pack of cards isn’t as easy as you think, not if you want to truly randomise the cards. Most people will give a pack a few shuffles with the overhand or riffle methods (where the pack is split and the two halves are interweaved). But research has shown this isn’t enough to produce a sufficiently random order to make sure the card game being played is completely fair and to prevent people cheating. The Conversation

As I wrote in a recent article about card counting, not having an effective shuffling mechanism can be a serious problem for casinos:

Players have used shuffle tracking, where blocks of cards are tracked so that you have some idea when they will appear. If you are given the option to cut the pack, you try and cut the pack near where you think the block of cards you are tracking is so that you can bet accordingly. A variant on this is to track aces as, if you know when one is likely to appear, you have a distinct advantage over the casino.

Card Counting and Shuffle Tracking in Blackjack.

So how can you make sure your cards are well and truly shuffled?

To work out how many ways there are of arranging a standard 52-card deck, we multiply 52 by all the numbers that come before it (52 x 51 x 50 … 3 x 2 x 1). This is referred to as “52 factorial” and is usually written as “52!” by mathematicians. The answer is so big it’s easier to write it using scientific notation as 8.0658175e+67, which means it’s a number beginning with 8, followed by 67 more digits.

To put this into some sort of context, if you dealt one million hands of cards every second, it would take you 20 sexdecillion, or 20,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000, years to deal the same number of hands as there are ways to arrange a deck of cards.

You would think that it would be easy to get a random order from that many permutations. In fact, every arrangement is, in a sense, random. Even one where the cards are ordered by suit and then rank could be considered random. It is only the interpretation we put on this order that would make most people not consider it random. This is the same as the idea that the lottery is less likely to throw up the numbers one to six, whereas in reality this combination is just as probable as any other.

In theory, you could shuffle a deck so that the cards emerged in number order (all the aces, followed by all the twos, followed by all the threes and so on), with each set of numbers in the same suit order (say spades, hearts, diamonds and clubs). Most people would not consider this random, but it is just as likely to appear as any other specific arrangement of cards (very unlikely). This is an extreme example but you could come up with an arrangement that would be seen as random when playing bridge because it offered the players no advantage, but wouldn’t be random for poker because it produced consistently strong hands.

But what would a casino consider random? Mathematicians have developed several ways of measuring how random something is. Variation distance and separation distance are two measures calculated by mathematical formulas. They have a value of 1 for a deck of cards in perfect order (sorted by numbers and suits) and lower values for more mixed arrangements. When the values are less than 0.5, the deck is considered randomly shuffled. More simply, if you can guess too many cards in a shuffled deck, then the deck is not well shuffled.

The Best (and Worst) Ways to Shuffle Cards – Numberphile.

Persi Diaconis is a mathematician who has been studying card shuffling for over 25 years. Together with and Dave Bayer, he worked out that to produce a mathematically random pack, you need to use a riffle shuffle seven times if you’re using the variation distance measure, or 11 times using the separation distance. The overhand shuffle, by comparison, requires 10,000 shuffles to achieve randomness.

“The usual shuffling produces a card order that is far from random,” Diaconis has said. “Most people shuffle cards three or four times. Five times is considered excessive”.

But five is still lower than the number required for an effective shuffle. Even dealers in casinos rarely shuffle the required seven times. The situation is worse when more than one deck is used, as is the case in blackjack. If you are shuffling two decks, you should shuffle nine times and for six decks you need to shuffle twelve times.

Shuffle like a casino dealer.

Many casinos now use automatic shuffling machines. This not only speeds up the games but also means that shuffles can be more random, as the machines can shuffle for longer than the dealers. These shuffling machines also stop issues such as card counting and card tracking.

But even these machines are not enough. In another study, Diaconis and his colleagues were asked by a casino to look at a new design of a card shuffling machine that the casino had built. The researchers found that the machine was not sufficiently random, as they simply did not shuffle enough times. But using the machine twice would resolve the problem.

So next time you’re at a casino, take a look at how many times the dealers shuffle. The cards may not be as random as you think they are, which could be to your advantage.

Graham Kendall, Professor of Computer Science and Provost/CEO/PVC, University of Nottingham

This article was originally published on The Conversation. Read the original article.

Why you should care about the rise of fake journals and the bad science they publish

Graham Kendall, University of Nottingham

There are more academic publishers out there than ever before. In 2014 there was an estimated 28,100 active scientific journals, but while the large majority of these journals are highly respected, there has also been a sharp rise in the number of predatory journals.

These are journals without a readership, that cannot really be thought of as being part of the scientific archive as they have done away with the “peer review” process. This is a process where scientists evaluate the quality of other scientists’ work. By doing this, they aim to ensure the work is rigorous, coherent, uses past research and adds to what we already know.

Predatory journals often don’t even bother to read the submitted paper, but just accept it. It might be an extreme example but one paper was accepted that repeated the phrase “Get me off your f**king mailing list” 863 times.

Fake journals make their money by charging a publication fee to the authors – anything from £100 to £1,000 a paper. They separate researchers from their money with little, or nothing, in return. And exist to make a profit without having any commitment to the scientific process – even plagiarising papers that have already been published.

Publishing in these journals, can not only have a negative effect on an academic’s career, but it can also mean that the academic community, as well as the general public, could be duped – with any old results being printed. And if this work is then cited elsewhere, then the non-reviewed research could propagate even further, and might be accepted as fact.

Seemingly legitimate

As somebody experienced in scientific publishing – with over 200 published peer reviewed articles, as well as being an editor-in-chief of one journal and an associate editor of nine others, I have seen first hand many of the techniques predatory journals use to make themselves look credible. This includes using logos that are similar to more established journals, using recognised academics on the advisory or editorial board (often without their knowledge) and claiming high impact factors.

They also tend to actively promote themselves through email campaigns, have nonexistent peer review which speeds up time to publication and also have affordable publication fees when compared to legitimate open access journals.

Roger Byard from the University of Adelaide in Australia has investigated the subject and found that:

There were 18 [predatory journals] in 2011, 477 at the end of 2014, and 923 in 2016 with the majority of those charging article publishing charges. The journals were found to be located in India, along with Nigeria, Iran, Turkey, Malaysia, and Pakistan.

In fact, it has been suggested that there are more “British Journal of …” based in Pakistan than there are in the United Kingdom.

And things could be about to get even worse because up until recently, the scientific community used to have a gatekeeper that maintained a list of predatory journals – but it has now disappeared.

The blacklist

Academic Jeffrey Beall ran a website, which was a “critical analysis of scholarly open-access publishing”. But if you go to this site now, you will see that it is empty. He also stopped tweeting earlier this year. As yet, he has not said why he stopped.

Jeffrey Beall in conversation about predatory journals.

The website that was maintained by Beall listed more than 900 predatory journals. And while an archive of Beall’s website is available, it will no longer be updated.

There are many people in the scientific community that will mourn the passing of this resource and many would argue that there is a need for a service such as this in order to to monitor scientific integrity.

Until then, the scientific community needs to be vigilant against predatory journals. They add no value to the scientific record, and do not add anything to the CV of a scientist – it may even harm it. They are also taking money which could be used for more productive research.

Scientists should be encouraged to check before submitting to a journal that it is legitimate, and if a paper gets accepted very quickly and the journal asks for money the alarm bells should start ringing.

Graham Kendall, Professor of Computer Science and Provost/CEO/PVC, University of Nottingham

This article was originally published on The Conversation. Read the original article.