How a Mathematician-Magician Revealed a Casino Loophole (bbc.com) 102
It's the tale of a company manufacuring precision card-shuffling machines for casinos — and a gang of hustlers who used a hidden video camera to film the shuffler's insides. "The images, transmitted to an accomplice outside in the casino parking lot, were played back in slow motion to figure out the sequence of cards in the deck," remembers the BBC, "which was then communicated back to the gamblers inside. The casino lost millions of dollars before the gang were finally caught."
So the company turned for help to a mathematician/magician: The executives were determined not to be hacked again. They had developed a prototype of a sophisticated new shuffling machine, this time enclosed in an opaque box. Their engineers assured them that the machine would sufficiently randomise a deck of cards with one pass through the device, reducing the time between hands while also beating card-counters and crooked dealers. But they needed to be sure that their machine properly shuffled the deck. They needed Persi Diaconis.
Diaconis, a magician-turned-mathematician at Stanford University, is regarded as the world's foremost expert on the mathematics of card shuffling. Throughout the surprisingly large scholarly literature on the topic, his name keeps popping up like the ace of spades in a magician's sleight-of-hand trick. So, when the company executives contacted him and offered to let him see the inner workings of their machine — a literal "black box" — he couldn't believe his luck. With his collaborator Susan Holmes, a statistician at Stanford, Diaconis travelled to the company's Las Vegas showroom to examine a prototype of their new machine.
The pair soon discovered a flaw. Although the mechanical shuffling action appeared random, the mathematicians noticed that the resulting deck still had rising and falling sequences, which meant that they could make predictions about the card order. To prove this to the company executives, Diaconis and Holmes devised a simple technique for guessing which card would be turned over next. If the first card flipped was the five of hearts, say, they guessed that the next card was the six of hearts, on the assumption that the sequence was rising. If the next card was actually lower — a four of hearts, for instance — this meant they were in a falling sequence, and their next guess was the three of hearts. With this simple strategy, the mathematicians were able to correctly guess nine or 10 cards per deck — one-fifth of the total — enough to double or triple the advantage of a competent card-counter....
The executives were horrified. "We are not pleased with your conclusions," they wrote to Diaconis, "but we believe them and that's what we hired you for." The company quietly shelved the prototype and switched to a different machine.
The article also explains why seven shuffles "is just as close to random as can be" — rendering further shuffling largely ineffective.
So the company turned for help to a mathematician/magician: The executives were determined not to be hacked again. They had developed a prototype of a sophisticated new shuffling machine, this time enclosed in an opaque box. Their engineers assured them that the machine would sufficiently randomise a deck of cards with one pass through the device, reducing the time between hands while also beating card-counters and crooked dealers. But they needed to be sure that their machine properly shuffled the deck. They needed Persi Diaconis.
Diaconis, a magician-turned-mathematician at Stanford University, is regarded as the world's foremost expert on the mathematics of card shuffling. Throughout the surprisingly large scholarly literature on the topic, his name keeps popping up like the ace of spades in a magician's sleight-of-hand trick. So, when the company executives contacted him and offered to let him see the inner workings of their machine — a literal "black box" — he couldn't believe his luck. With his collaborator Susan Holmes, a statistician at Stanford, Diaconis travelled to the company's Las Vegas showroom to examine a prototype of their new machine.
The pair soon discovered a flaw. Although the mechanical shuffling action appeared random, the mathematicians noticed that the resulting deck still had rising and falling sequences, which meant that they could make predictions about the card order. To prove this to the company executives, Diaconis and Holmes devised a simple technique for guessing which card would be turned over next. If the first card flipped was the five of hearts, say, they guessed that the next card was the six of hearts, on the assumption that the sequence was rising. If the next card was actually lower — a four of hearts, for instance — this meant they were in a falling sequence, and their next guess was the three of hearts. With this simple strategy, the mathematicians were able to correctly guess nine or 10 cards per deck — one-fifth of the total — enough to double or triple the advantage of a competent card-counter....
The executives were horrified. "We are not pleased with your conclusions," they wrote to Diaconis, "but we believe them and that's what we hired you for." The company quietly shelved the prototype and switched to a different machine.
The article also explains why seven shuffles "is just as close to random as can be" — rendering further shuffling largely ineffective.
Bad title (Score:5, Insightful)
Not a loophole. Cryptographic flaw.
Re: (Score:1)
How did they discover the wifi buttplug? Didn't someone beat Magnus Carlsen at chess with one of those?
Re: (Score:2)
How did they discover the wifi buttplug? Didn't someone beat Magnus Carlsen at chess with one of those?
You know what's harder than beating Magnus Carlsen at chess? Talking about a rectally-enhanced chess win, with a straight face.
I heard even the porn director couldn't stop laughing long enough to make a parody of this.
Re: (Score:3)
You know what's harder than beating Magnus Carlsen at chess?
Convincing Magnus that he actually lost?
Re: Bad title (Score:1)
Re: (Score:2)
Re: (Score:3)
Not a loophole. Cryptographic flaw.
Not News For Nerds. A clickbait advertisement leading you to a paywalled article.
/. for disguising ads as news content.
Fuck paywalls, and fuck you,
make the shuffling not know what card is in there (Score:2)
make the shuffling not know what card is in there and just number the cards buy number and when it's loaded you do an quick random wash.
Re: (Score:3)
make the shuffling not know what card is in there and just number the cards buy number and when it's loaded you do an quick random wash.
The machine doesn't "know" in what order the cards are placed inside. It's only job is to shuffle the cards such that they are sufficiently mixed. Somehow, for whatever reason, it wasn't shuffling the cards enough to prevent card counters from guessing what the next drawn card might be.
I'm surprised this is even an issue because last I heard casinos were using perpetual shuffling machines. Instead of shuffling the cards then letting them be drawn, the machine continues to shuffle the cards while they are
Remember, they shelved this unit (Score:2)
Remember, they didn't use the unit being tested here. The continuously shuffling machines may be what they ended up going to instead, because a single pass machine wasn't enough.
Continuous operation sounds more expensive - more power, more wear on the mechanicals, etc...
Re: (Score:1)
Wear and tear on the shuffling machine is just part of the cost of doing business. As the story shows, the really expensive thing is letting the cards be predictable. That's why casinos replace their cards frequently; it's cheap insurance against the cards having visible wear that would let players recognize them.
Well, yes (Score:2)
Well, of course. Like I said, "a single pass machine wasn't enough" - IE it doesn't introduce enough randomness, which could allow card-counter type people to beat the house odds. With traditional card counting(and single deck operation), it's a very slim advantage to the player. With multiple decks in the boot/shuffler, that mostly goes away. If they have a method that allows them to beat card counting odds by 4X, that's serious money, thus unacceptable.
Which is why I mentioned that the machine never w
Re: make the shuffling not know what card is in th (Score:2)
I remember seeing a news report or documentary or something about how some casino somewhere did no shuffling at all at the table. There was a centralized shuffling facility and cartridges of prerandomized cards were taken to tables.
I may be imagining this, but I also remember reading something about casinos defeating card counters by not guaranteeing that a full deck was in each cartridge, only that the next draw from each cartridge was guaranteed to be random.
I imagine tactics like that may be regulated, s
Re: (Score:2)
In Australian casinos, they have a shuffling machine at the table, and they usually have at least four decks of cards in it. They shuffle every hand. It makes card counting impractical.
Re: make the shuffling not know what card is in t (Score:2)
How can the next card be random
If there is a 0% chance of some cards being drawn? That makes at least one card being overweighted against random.
Re: make the shuffling not know what card is in (Score:2)
The probability that any card is going to be drawn next is 1/52 for all draws. This is not the case for a shuffled full deck (or any finite number of full decks) because the chance of the next card being one you've already seen is zero.
Re: make the shuffling not know what card is in (Score:2)
Uh, no.
I was referring to the comment about a full deck not being included. Without a full deck, the probability of some cards being drawn is 0, since they are not in the deck, and the probability of other cards is greater than 1 in 52, since there are less than 52 cards in the deck.
Re: (Score:2)
The issue is that they take 4 complete decks, shuffle them all together, so you wind up with a mega 208 card deck, which has 4x of every card.
If you peel off the first, second, third, or fourth "proper" deck of 52 cards, you may have as many as 16x of a given card (for example 16 Aces - 4 Ace of Hearts, 4 Ace of Clubs , N4 of Ace of Spades, and 4 Ace of Diamonds).
If dealing from such a deck, every player at a 4 hand table COULD have an identical hand - it is a mathematical possibility, but exceedingly unlik
Re: (Score:2)
I imagine tactics like that may be regulated, so what flies in Indian casinos may not fly in New Jersey may not fly in Vegas
In Indian casinos a guy in a turban plays a pungi and the cards rise up out of the deck and shuffle themselves. Not sure what they do in Noo Joisy, possibly something involving bagels.
Re:make the shuffling not know what card is in the (Score:4, Informative)
The cards are packed that way to make it possible to see/check that they all are there. Practice is to slide the cards in a new deck so they all can be seen (by players, but more importantly the cameras and pit bosses). Good luck doing that quickly at a casino if they come out of the box in random order.
Re: make the shuffling not know what card is in th (Score:2)
Re: (Score:2)
Re: (Score:2)
Kills me that we're literally talking about the struggles of building a machine to counter the effectiveness of the machine that stuffs 52 cards in a box in exact order.
You would trust the manufacturer to randomly shuffle every one of their decks so that they were not predictable, something casinos struggle to do?
Suit-and-rank order is just one type of order. Any order at all makes the deck equally predictable (to card counters who bother to memorize deck orders).
I don't think you thought this through.
(Sorry to hear of your death AC.)
Re: (Score:2)
I don't understand how a machine, fed a random deck of cards, can assemble that deck into any identifiable "runs" without the machine being aware of each card's value/suit and intentionally builds those runs.
Now, feed the machine an ordered deck of cards, and I can see how a consistent mechanical process could "accidentally" create "runs".
By randomizing the cards as they enter the machine, you are literally changing the seed for the random process each time, and while there is only a finite number possible
Re: (Score:2)
Nobody said the machine would assemble it into any identifiable order. But unless you are sure that the manufacturer is creating truly random decks (which would be a bad assumption), then there can be a pattern in there which can be determined. And if there is a pattern that can be determined, then it is up to you to properly shuffle the deck to make sure it is truly random. And if you have to do that, then it doesn't really matter what the input was.
Re: (Score:3)
A complete deck of cards is printed on one sheet of card stock. As the sheet comes out of the press it moves past knives that slice it into rows and columns. The conveyor ends and the cards drop off the end into a stack. Another conveyor moves sideways to the first one and drops the stacks on top of each other. You now have a deck of cards. There is no machine that is picking cards individually and creating a deck from them. The order they appear in the deck is strictly a function of how they were lai
Re: (Score:1)
They are more there to stop the high/low counters but to combat that places are using more decks and shuffling more often.
Re: (Score:2)
It's casinos balancing their security vs what players want - and there are a lot regulars that avoid the continuous ones (granted, probably a good chunk that are trying to count - and a good chunk of those probably counting poorly anyway).
Re: (Score:2)
Isn't this "flaw" predicated by feeding the shuffler a "straight" (new) deck where the cards go in the machine in sequential order? FFS just do a quick shuffle before you feed it into the machine!
I fail to understand/the article fails to explain how you get "rising" and "falling" runs of cards from a random deck of cards unless the machine can identify each card and intentionally puts them in a certain order.
Re: (Score:2)
They're put in the machine in order to make it easier to show the casino staff the problem.
In any ordinary card game you're going to see the order in which cards were folded and dropped into the shuffler (depending on the game), so the 'seed' is known.
The goal is to build a shuffler that can actually provide a random shuffle, even with knowledge of the 'seed'.
Re: make the shuffling not know what card is in th (Score:2)
Re: (Score:2)
Print the cards on demand using an RNG.
Hopefully they won't use IBM's RANDU...
Re: (Score:2)
The intent of this exercise is to speed up the game, and printing each card on demand is not only slower, it is incredibly wasteful.
You are trying to turn a card game into a video game, albeit with printed artifacts.
Re: (Score:2)
This is actually what you like to see. (Score:5, Insightful)
"We are not pleased with your conclusions," they wrote to Diaconis, "but we believe them and that's what we hired you for."
They didn't shoot the messenger because they were unhappy with the results. They accepted them and acted upon them. That's what you want to see.
Re: (Score:2)
Re: (Score:2)
> If only Twitter had the same response to Mudge.
Mudge did a tour of duty at DHS. People say he was supposed to understand why a limited set of addresses had access to exploits in unpatched software. Apparently he didn't get it and was asked to leave. We won't really ever know if the company isn't sold.
Re: (Score:2)
> That's what you want to see.
Tens of millions of dollars can often help find clarity.
In private corporations, at least.
seven shuffles (Score:1)
Re: (Score:3, Informative)
You're describing "interleaving", which is the exact opposite of a perfect shuffle.
A perfect shuffle is when a random number of cards from one side is followed by a random number of cards from the other side, and repeated.
Every other card is the most imperfect shuffle possible, and no one uses that term to describe it.
It is akin to intentionally and meticulously looking at and placing a coin on a table facing up, then describing that action as "flipping a coin"
Re:seven shuffles (Score:5, Insightful)
This comment template is depressingly common on slashdot.
"{Whatever is being reported on} is wrong! If you think about {my own subjective misinterpretation of the reported words into something trivial I'm familiar with}, you'll quickly see that I'm right and this {very well-qualified expert} is wrong! Now I will {explain trivial details of my own misunderstanding to you, as though you're just as stupid as I am}!
Re: (Score:3)
Line up seven coins on the table. Flip all the odd coins in round 1. Flip all the even coins in round 2. Repeat, repeat. You will get original sequence. It ain't no perfect coin flip.
Get it?
Re: (Score:2)
Re: (Score:1)
Slashdot: Uh, this a a nuclear meltdown.
Expert: [laughs] Oh, meltdown. Itâ(TM)s one of those annoying buzzwords. We prefer to call it an unrequested fission surplus.
You: Well, sir, your point about nuclear hysteria is well taken. This commenter promises to be more trusting and less vigilant in the future.
Re: (Score:2)
Your definition of perfect is not what I was describing.
Is not accurate.
I was just noting that there is hidden order. Note that I never mentioned cutting the deck.
Re: (Score:2)
IN magic, this is also called a perfect shuffle, because it perfectly restores the cards to their original positions.
Now, you have learned something!
Re: (Score:2)
You're wrong. "Perfect shuffle" is a term of art in mathematics, computer architecture, magic, and card shuffling, and means a perfect interleaving. At least do a Google search before going off on your ignorant rant.
Perfect Shuffle: https://en.wikipedia.org/wiki/... [wikipedia.org]
Re:seven shuffles (Score:5, Informative)
Realize that when manually shuffling they dont' start with a sorted deck.
Basic dealer process:
1) Slide open deck to show all the cards (if a new deck)
2) "Wash" the cards - scramble them face down on the felt - trying to make sure each card touches felt at some point. This is what really randomizes the cards.
3) Stack the cards face down
4) Riffle Riffle Box Riffle (Riffle means interleave them, Box means cut the deck basically in four or so parts and randomize that order). People thing this is THE shuffle - but the Wash does much more of the work. This just make it hard to follow a card if you tried to do that during the wash.
5) Cut the deck
In a machine - it's not just doing a 1:1 interleave to inject randomness - the basic home type probably takes a random number from each side as it goes - and you can/should do multiple passes. The casino types are picking cards at random to do that ordering (Well pseudorandom because - you know - software).
Re: (Score:2)
I said that to make it easier for the reader to verify that there is indeed hidden order in 7 perfect shuffles. If you want to go thru the hassle, start with a what you believe is a random deck, and write down on paper each card in order, and then do the perfect shuffle as described above 7 times, and then compare the order to what you wrote down on paper.
As to a card shuffling machine, I would make it do my description of perfect shuffle, but do random cuts. Applies to a human shu
Re: (Score:2)
One key point that lots of commenters here do not grasp is that, unless we are talking quantum mechanics, "randomness" is a very difficult to define term. When computers became a thing in the 1950s constructing a useful pseudo-random number generator became important (Monte Carlo simulation was the first big number crunching application)./p>
Now everyone knows a PRNG is not really random (it has pseudo as its first two syllables) but for nearly all practical uses you do not need that and the RAND think
Diaconis to the rescue (Score:2, Interesting)
Trying to cheat casinos is not smart (Score:2)
Remember, they are the biggest and most competent cheaters themselves. They even managed to make their crap legal. And they know that there are a lot of morons out there that do not understand that casinos are very good at statistics and detecting cheaters.
Re: (Score:2)
Cheating is not playing by the established and known rules of the game. Casinos do not cheat.
Re: (Score:1)
Indeed. Casinos get the rules changed. But if you look reeeeally closely, I wrote that. May want to take some reading lessons....
Re: (Score:2)
Maybe you should take writing lessons. What you wrote was "Remember, they are the biggest and most competent cheaters themselves." This is pure bullshit, and nothing you wrote after that changes that fact.
Re:Trying to cheat casinos is not smart (Score:5, Informative)
Re: (Score:1)
And then you read what I wrote and realize that I pretty much wrote that....
Re:Trying to cheat casinos is not smart (Score:4, Insightful)
realize that I pretty much wrote that.
The world can only wish you were as smart as you think you are. Unless there is some mystery comment I'm missing here? Given that you've provided the same smug (and also wrong) reply to two comments in this same thread would lead me to believe otherwise. Or maybe, for those of us who just can't understand how brilliant you actually are, you could explain what you actually mean?
Re: (Score:2)
You overlooked that "cheating" has more than one definition.
Here is some, obviously much needed help: https://www.thefreedictionary.... [thefreedictionary.com]
Re: (Score:2)
And none of those definitions apply. There is no trickery or deception. There is no dishonesty. There is no 'not playing by the rules'. The rules are well established and public. The casinos play by those rules.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
no you didn't, you wrote they cheat, they are playing by the rules, cheating would be changing the odds of them winning in an underhanded/illegal way.
Nope: https://www.thefreedictionary.... [thefreedictionary.com]
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
They didn't cheat, you were just a moron. It's not the casinos job to fix your mistakes.
Re: (Score:1)
Taking a bet over the limit is also their mistake.
Re:Trying to cheat casinos is not smart (Score:5, Insightful)
I'd add that casinos can and do bar successful players who don't cheat - aka legit card counters, under the justification that anyone who wins consistently in defiance of the bad odds 'must be' cheating.
It's technically not 'cheating' in the sense of breaking a rule, because the casino has the right to bar anyone for any reason.
However I'd like to point out that casinos obviously got that provision to fly with various gaming commissions through graft, bribery, and corruption. The ending of the movie _Casino_ especially made conclude that casinos are simply an economic drag and social ill. They demonstrate regulatory capture, the corruption you allude to, and have obvious roots in organized crime.
The only reason Casinos are allowed to operate, in my opinion, is because the general public has an attitude of 'gamblers get what they deserve.' Casinos are essentially another form of social ill like fast food, quaintly allowed to operate on an elaborate framework of corruption and passing social costs on to taxpayers. 'Cheating' is too mild for what they do.
Re: (Score:3)
The only reason Casinos are allowed to operate, in my opinion, is because the general public has an attitude of 'gamblers get what they deserve.'
No, they don't. You can discharge gambling debts through bankruptcy, but not student loan debts, so gamblers do not get what they deserve, and neither do people trying to make the world a better place through education. In general, the general public is fucking stupid. It doesn't even know what it believes.
Re: (Score:2)
Hey if it were up to me I'd line up the entire department of education and every single university dean and have a good old Roman style Decimation for treason where every 10th person is beaten to death by their colleagues. For casino owners I believe a slow death by exposure and starvation would be appropriate.
Re: (Score:2)
Re: (Score:2)
Crime? If you mean the prostitutes who tend to work the c
Re: (Score:3)
Sounds like somebody had a sure fire winning strategy. Roulette or blackjack?
Obviously, and ironically, ... (Score:2)
Diaconis, a magician-turned-mathematician at Stanford University, is regarded as the world's foremost expert on the mathematics of card shuffling. Throughout the surprisingly large scholarly literature on the topic, his name keeps popping up like the ace of spades in a magician's sleight-of-hand trick.
The literature hasn't been sufficiently shuffled. :-)
Re: (Score:2)
Re: (Score:2)
Why would anyone run a game where they always lose? The House needs to win more than they lose to keep in business. Those dealers don't come free, neither does the air conditioning.
Why? (Score:2)
Re: (Score:2)
Camera inside the auto-shuffler (Score:2)
"It's the tale of a company manufacuring precision card-shuffling machines for casinos — and a gang of hustlers who used a hidden video camera to film the shuffler's insides."
This is something you'd expect to see in a movie plot. If only the Ocean's 12 & 13 writers had been this clever...
Re: (Score:2)
Rather, the shuffler had a glass side, so that players could see its inner workings, and see that it's not cheating. The hustlers hid the camera somewhere in the room pointed to the shuffler's window, and merely used it to "slow down the action" (shuffling would otherwise be too fast to follow the cards with your naked eyes).
Re: (Score:2)
If you read the article
But that is a violation of Slashdot's Code of Conduct!
Rather, the shuffler had a glass side, so that players could see its inner workings, and see that it's not cheating. The hustlers hid the camera somewhere in the room pointed to the shuffler's window ...
That would not make for nearly as cool of a movie.
Is a shuffle like an S-box in crypto? (Score:2)
I keep meaning to learn more about it. What goes into making an algorithm, and why.
The casino lost millions..... (Score:2)
.... of dollars before the gang were finally caught ... Not doing anything illegal or against the rues of the Casio ... but were banned anyway
Re: (Score:2)
Re: (Score:2)
The odds of a blackjack game are about 98% meaning the casino get's a 2% margin for hosting the game. Imagine a retailer that bought hammers for $9.80 and sold them for $10. That would be nearly impossible to turn a profit.
You might want to take a look into the profit margins of a grocery store, I think you'd be surprised how profitable they can be with margins on most items approaching 2%, and unlike a casino, their unsold inventory literally rots on the shelves if unsold.
Re: (Score:2)
Re: (Score:2)
Here's one story on grocery store profit:
https://smallbusiness.chron.co... [chron.com]
Here's an industry group's report over the past 4 decades that shows average grocery store chain (not individual store or item) profits:
https://www.fmi.org/our-resear... [fmi.org]
I said:
margins on most items approaching 2%
You said:
I have never heard of a grocery store that has 2% *gross* margin.
I note you turned the per item profit margin I said to "2% *gross* margin", those two things are not interchangeable. Grocery stores offer prepared foods (cooked chickens, pre-made salads, etc) that offer higher margins, as well as liquor, another high
Re: (Score:2)
Me: Casinos have a 2% gross margin.
You: Some grocery stores have a 2% [net/g
lol (Score:2)
Execs usually don't want you to actually find any showstopper problems, they just want something that passes while being able to show they did due diligence.
Wonder if they hired them to evaluate the machine they switched to as well.
Another way to skin the cat... (Score:2)
Re: (Score:2)
Do you think gamblers will accept a computer *literally* stacking the deck, and will trust the casinos to not do so against the gamblers interest?
Re: (Score:2)