If you’ve ever been tempted by a flutter, you’ll know how bookmakers and casinos stack the odds against you. The clearest example is roulette, where there are 36 red and black numbers plus the green numbers 0 and (in the U.S.) 00. So that’s 38 possibilities in total. When betting on red or black, the odds of choosing correctly are 18/38, and a fair payout for a $1 stake is $2.111. However, the house pays only $2 and keeps the difference. In that way, it guarantees itself a profit.

A similar bias occurs in bookmakers’ odds on horse races, soccer, and every other sporting event. The bookies always ensure that the odds are in their favor. But setting these odds is harder than those for roulette because the calculations are trickier.

And that raises a tantalizing possibility. Is it possible to come up with a better way to calculate the odds, and thus beat the bookies?

Today we get an answer thanks to the work of Lisandro Kaunitz at the University of Tokyo and a few pals, who have found a way to consistently make money from the online betting market for soccer.

But their work comes with a serious caveat. Kaunitz and co say that as soon as the bookies became aware of this success, they prevented the researchers from betting further.

Gamblers have long toyed with schemes to beat the odds, but success is rare. That’s because bookmakers work hard to calculate accurate odds. They typically employ teams of statisticians to study historical data for a sport like soccer and then develop sophisticated models to determine the appropriate odds for each game.

Kaunitz and co say that as far as they know, nobody has been able to beat this system by developing superior statistical models.

But despite this sophisticated approach, there is a weakness in the way bookmakers work. It has to do with the way they hedge their bets to protect against the possibility of large payouts.

For example, when two teams play a game of soccer, the bookmakers set odds of each team recording a win, loss, or draw. Sometimes large numbers of people can bet on a particular outcome for reasons that are unrelated to the odds—that team might be more popular than expected, for example. In that case, the bookmaker is set for a large payout if that outcome occurs.

So bookmakers can hedge their bets by offering more favorable odds on the opposite outcome. In this way, they attract bets that cover at least some of the potential losses.

Kaunitz and co say this process also creates an opportunity for anybody able to spot it. The trick that the researchers have perfected is to devise a method that consistently spots odds favoring the punter rather than the bookie.

Their method is straightforward. They start by assuming that bookies themselves are good at setting odds and that the prices they offer are an accurate reflection of the real probabilities of a win, draw, or loss, plus their own margin.

In that case, a good measure of these probabilities is a simple average of the odds offered by all the bookies—a kind of wisdom of the crowd. This gives the average odds, which Kaunitz and co say is a remarkably accurate reflection of the real probabilities.

Then it is a simple matter to analyze all the odds being offered and to find the outliers. Kaunitz and co next work out how favorable the outlying odds are. If they are good enough, then the bet should pay off, at least in the long run.

And that’s exactly what Kaunitz and co have done. They built a Web crawler that gathered the odds offered by online betting companies on soccer games around the world. They calculated the average odds, found any outliers, and then worked out whether a bet would favor them or not.

Before committing any real money, the researchers tested the idea on 10 years of historical data on the closing odds and results of 479,440 soccer games played between 2005 and 2015. This simulation paid out 44 percent of the time and delivered a yield of 3.5 percent over the 10-year period. “For an imaginary stake of $50 per bet, this corresponds to an equivalent profit of $98,865 across 56,435 bets,” they say.

An important question is whether this result could have been pure chance. Could they simply have got lucky? So the team compared their results to 2,000 simulations in which they placed bets randomly on the same games. In that case, the bets paid out 39 percent of time at a return of -3.2 percent, which is equivalent to loss of $93,000.

That allowed the team to calculate the likelihood that their first result was a fluke. “The probability of obtaining a return greater than or equal to $98,865 in 56,435 bets using a random bet strategy is less than 1 in a billion,” they say.

That gave Kaunitz and co good reason to think their method would work in the real world, but there was a problem. Ordinary punters cannot always bet on closing odds, which can vary significantly from the odds given in the run-up to a game.

So Kaunitz and co decided to simulate this, too. “We decided to conduct a more realistic simulation in which we placed bets at odds available from 1 to 5 hours before the beginning of each game,” they say.

The way odds vary in the run-up to games is not publicly available, so the team created a bot that collected these odds from betting websites around the world from September 2015 to the end of February 2016. Then they tested their approach in this data set.

The results were even better. Their bets paid off 47.6 percent of the time and yielded a 9.9 percent return. “If every bet placed was $50, our strategy would have generated $34,932 in profit across 6,994 bets,” they say.

Curiously, a random betting strategy on the same data yielded a return of 0.2 percent and a profit of $825. That could be the result of the intense competition between online betting companies that sometimes offer more favorable odds to attract punters in a kind loss-leader policy.

Next, the team tried the approach using a strategy known as “paper trading,” in which they place fictitious bets using real-time data rather than historical data. This is important because it allows them to check whether the quoted odds are actually available with an online bookmaker.

Indeed, they discovered that about 30 percent of the time, the odds had changed by the time they attempted to check online. In those cases, they discarded the bet.

But the strategy was still profitable. After three months of paper trading, their bets retuned a profit of 5.5 percent, earning $1,128.50 on 407 bets of $50.

“At this point we decided to place bets with real money,” say Kaunitz and co.

So they repeated their approach over five months, using the same procedure, except that a human operator would actually place a $50 bet online after checking the odds. During that period, their bets paid off 47.2 percent of the time, and they made a profit of $957.50 over 265 bets. That’s an impressive return of 8.5 percent.

Eagle-eyed readers will notice that the number of bets they placed was significantly less than during the paper trading period. “The reason for this is that we did not have a dedicated operator betting on all available opportunities 24 hours a day and as a result we missed many of the bets that appeared,” they say.

But the smaller number of bets didn’t matter. “Our paper trading and actual betting activity confirmed the profitability of the strategy,” say Kaunitz and co.

That’s a clever approach and a fascinating result. Kaunitz and co found an Achilles’ heel in the betting industry and exploited it for their own profit.

But their story comes with a sting. “Although we played according to the sports betting industry rules, a few months after we began to place bets with actual money bookmakers started to severely limit our accounts,” say the team.

The bookies often limited the stakes they could bet or suggested a “manual inspection” of the bet before accepting it. In those circumstances, the team couldn’t make their bets.

If the bookies were choosing the bets to question at random, it shouldn’t have had any effect on the profitability of the strategy. But Kaunitz and co say this was unlikely and that the bookmakers’ actions could have severely affected them. “Under these circumstances we could not continue with our betting strategy,” they say.

Kaunitz and co are clearly unhappy: “The sports betting industry has the freedom to publicize and offer odds to their clients, but those clients are expected to lose and, if they are successful, they can be restricted from betting.”

The team points out that this kind of practice could be illegal. “Advertising goods or services with intent not to sell them as advertised, or advertising goods or services with no intent to supply reasonably expectable demand but with the intention to lure the client to buy another product (a practice often called ‘bait’ or ‘bait and switch’ advertising), is considered false advertising and carries pecuniary penalties in the U.K., Australia, and the United States of America,” say the team.

And they call on governments to properly regulate the gambling industry and to prevent this kind of practice in the future.

Whether this will work is not clear. But their results are interesting nonetheless.

Ref: arxiv.org/abs/1710.02824 : Beating the Bookies with Their Own Numbers—And How the Online Sports Betting Market Is Rigged