How Isaac Newton could help you beat the casino at roulette

How Isaac Newton could help you beat the casino at roulette

Graham Kendall, University of Nottingham

Imagine walking into a casino with a computer strapped to your chest. Solenoid electromagnets thump against your body telling you where to place your bet on the roulette table. Suddenly, you start getting electric shocks. You rush to the toilet to undertake emergency repairs, hoping that the casino staff do not realise what is happening.

In the late seventies, graduate student Doyne Farmer and colleagues did just that – with purpose-built computers that could predict where a roulette ball would land. The project, described in the book The Newtonian Casino (published as The Eudaemonic Pie in the US), was, however, difficult and fraught with technical problems. The team never really found a reliable way of doing it. But decades later, is it any closer to becoming a reality?

In a game of roulette, the croupier spins a wheel in one direction and a ball in the other direction. Players then place bets on where the ball will land by choosing either a single number, a range of numbers, the colours red or black or odd or even numbers.

Our understanding of the physics behind the movement of the ball and wheel is pretty solid – governed by Newton’s laws of motion. As the ball slows, gravity takes hold and it falls into one of the numbered compartments. It is predictable when the ball will leave the rim. However once it does, the route it takes to a numbered slot is less so. This is because the ball bounces around as it strikes various obstacles.

Every roulette wheel is slightly different. Atmospheric conditions continually change and the wheel itself has features that encourage randomness – such as the size of the frets between the numbers and the diamond-shaped obstacles that intercept the ball as it falls down to the wheel. This means that you cannot predict the exact number where the ball will land. But you only need to know which area of the wheel the ball will land and you can gain a massive advantage over the casino – more than 40%. This is a huge swing from the 5.26% margin that US casinos have over players – often referred to as the house edge. In Europe it is only 2.7%, as the wheel has only one zero (a US wheel has two zeroes).

Sweaty experiments

When Farmer and his team entered the casino for the first time, two people were wearing computers. One had a computer built into his shoes, with the task of inputting data by tapping switches under the toes. This computer performed two main functions. One was to adjust parameters for each wheel before a game, such as the rate at which the ball and wheel slowed down, and the velocity of the ball when it fell off the track. They also had to determine whether the wheel exhibited any tilt.

The second job was during live play. The player with the shoe computer tapped the toe switches each time a certain point (typically the double zero) on the wheel passed by and also when the ball passed by. Using this information, the program could calculate the speed of both the wheel and the ball – thus knowing when the ball would start to fall. Knowing the relative positions of the ball and the wheel meant that a prediction could be made about where the ball would finally land. The computer then had to transmit the prediction to the person wearing the second computer. This was achieved by weak radio signals.

Shoe computer. The Eudaemonic Pie display at the Heinz Nixdorf Museum.
https://en.wikipedia.org/wiki/J._Doyne_Farmer, CC BY-SA

The second computer, strapped to someone else, received the radio signals and conveyed this information to the player by the solenoid electromagnets that thumped that player’s stomach. A code had been developed which relayed the predicted number, with the player placing bets on that number and several numbers either side to account for the randomness. In order that the casinos could not easily see what they were doing, the team altered their betting patterns slightly. For example, not betting on all the consecutive numbers.

However this never gave them the 40% advantage observed in the lab – mainly due to technological problems such as short circuits caused by sweating, wires becoming loose and lost radio connections.

It took several years for the team (which now comprised about 20 people who’d worked on the project in varying degrees) to develop an improved computer system. Both computers were now in custom-built shoes. This could protect the operator from being electrocuted but would also make it harder for the casino to detect. The other innovation was that the computers were set in resin blocks, with only the toe-operated switches and the solenoids that now drummed against the feet, being visible. This was to try and combat the problems such as loose wires and sweating.

Binion’s casino.
Ken Lund/Flickr, CC BY-SA

They then entered Binion’s casino in Las Vegas ready for an all-out assault. Once the parameters had been set, the first prediction was to bet in the third octant – which included the numbers 1, 13, 24 and 36. The ball landed in 13 and the team got paid off at 35-1. The years of work looked promising, but the solenoids eventually started to act randomly, so the accurate predictions from one computer were not being transmitted to the other. The team suspected it was due to the electronic noise present in casinos. Eventually they had no choice but to abandon the idea.

Would it work today?

The main issue in the late seventies and early eighties was that the team had to build their own computers from scratch, literally – they had to design the computer, buy all the components and get busy with a soldering iron. These days, the computers are readily available, as the following video shows.

Technology has evolved. These days, all the required processing power could be fitted into a single unit. You could imagine a system based on a mobile phone where the camera videos the ball and the wheel and image processing software extracts the relevant data so that the prediction software can calculate the final position of the ball.

But certain challenges still remain. If several people are involved, which is the best way to avoid detection, how can you work as a team and pass data? Perhaps the use of free wifi in many casinos could be a solution? Another problem is how to best hide the fact that you are trying to use an electronic device to predict where the ball will land, when you need to input data and receive the prediction. Here, suitably connected glasses may be one get around, used in tandem with toe-operated switches.

The hardest challenge, however, is the casino itself. They are certainly unlikely to simply let you have a camera pointed at the roulette wheel, especially if you are winning. If they did, they would be likely to ask you to leave and as it is often illegal to use such devices. But with a little creativity it may not be long before scientists prove they are able to outsmart casinos.

The Conversation

Graham Kendall, Professor of Operations Research and Vice-Provost, University of Nottingham

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

Postdoctoral Research in Malaysia

I was fortunate enough to recently be invited to write a piece for the (Malaysia) Star newspaper. The piece I wrote commented on the postdoctotal research culture in Malaysia.

The article starts:

In a university, academic staff are paid to do three things: research, teach and deal with administration. As universities are largely judged by the quality of their research, they need as many of the staff as possible to contribute to their research output. PhD (Doctor of Philosophy) students also carry out research ….

The article can be seen below:

Day0016b

 

 

 

 


This was also posted in LinkedIn.

We should be just a number, and we should embrace it: Extend the use of ORCID?

Delighted to receive the news today that our article entitled “We should be just a number, and we should embrace it” has been accepted for publication in The Electronic Library.

The article supports the use of unique identifiers for the scientific community.

ORCID (Open Researcher and Contributor ID) is just one example of a currently available tool. This enables authors of scientific papers to attribute a unique identifier with any papers they write so that they can be uniquely identified. This resolves the author disambiguation problem.

The article further proposes that the unique identifier could be extended to other uses within the scientific community. For example, to track reviewers, program committee memberships, conference attendance, provide author permalink etc.

The abstract of the paper is below.

The paper is not available yet, as it was only accepted today, but if you are interested in seeing the paper when it is available, leave a comment and I’ll get it to you.

Purpose – This viewpoint article supports the use of unique identifiers for the authors of scientific publications. This, we believe, aligns with the views of many others as it would solve the problem of author disambiguation. If every researcher had a unique identifier there would be significant opportunities to provide even more services. These extensions are proposed in this paper.

Design/methodology/approach – We discuss the bibliographic services that are currently available. This leads to a discussion of how these services could be developed and extended.

Findings – We suggest a number of ways that a unique identifier for scientific authors could support many other areas of importance to the scientific community. This will provide a much more robust system that provides a much richer, and more easily maintained, scientific environment.

Originality/value – The scientific community lags behind most other communities with regard to the way it identifies individuals. Even if the current vision for a unique identifier for authors were to become more widespread, there would still be many areas where the community could improve its operations. This viewpoint paper suggests some of these, along with a financial model that could underpin the functionality.


This article was also published on LinkedIn.

The unintended conseuqences of sports rules: Olympic examples sought

Liam Lenten and I recently published an article in the European Journal of Operational Research entitled “When Sports Rules Go Awry“. The essence of the article is to look at examples when sports rules had unintended consequences. For example, there are cases when it is beneficial for a team to score an own goal in a football match.

We would argue that this is an unintended consequence of the rules, as the incentives have not been well defined..

In our paper, there are many examples drawn from the Olympics. For example, and to quote from the paper:

In the initial stages of the badminton competition in the 2012 Olympics, eight women players (both South Korea teams and one team each from China and Indonesia) were disqualified from the competition. The women were charged with “not using one’s best efforts to win a match” and “conducting oneself in a manner that is clearly abusive or detrimental to the sport.” They were found guilty of trying to throw matches in order to get (perceived) easier draws in the knockout stages of the competition.

As the 2016 Olympics are in full swing in Rio, we thought that it was worth asking if there had been any examples where the rules had been abused, or they had led to unintended consequences? If you have any examples, please share them with us through the comments.

We would like to maintain an up to date library of examples and your help would be much appreciated.

Just for completeness, the abstract of the paper is below.

Abstract:

Mike Wright (Wright, M. OR analysis of sporting rules – A survey. European Journal of Operational Research, 232(1):1–8, 2014) recently presented a survey of sporting rules from an Operational Research (OR) perspective. He surveyed 21 sports, which consider the rules of sports and tournaments and whether changes have led to unintended consequences. The paper concludes: “Overall, it would seem that this is just a taster and there may be plenty more such studies to come”. In this paper we present one such study.

This is an interdisciplinary paper, which cuts across economics, sport and operational research (OR). We recognize that the paper could have been published in any of these disciplines but for the sake of continuity with the paper that motivated this study, we wanted to publish this paper in an OR journal. We look at specific examples where the rules of sports have led to unforeseen and/or unwanted consequences. We hope that the paper will be especially useful to sports administrators, helping them to review what has not previously worked and also encouraging them to engage with the scientific community when considering making changes.

We believe that this is the first time that such a comprehensive review of sporting rules, which have led to unexpected consequences, has been published in the scientific literature.


This post was also published on LinkedIn.

Basic Betting: The Micro Bytes Back – 25 years on

Almost 25 years ago I wrote a self-published book that tested gambling systems using programs written in GW-BASIC. I recently came across the spiral bound book and the 3.5″ floppy disc. After struggling to borrow a 3.5″ floppy disc drive I eventually manged to get the programs copied onto my desktop computer. I had a copy of the book as a Word document.

The next issue I faced was finding a way to run the GW-BASIC programs. This turned out to be surprisingly easy to solve. There is an excellent emulator that you can download, for both Mac and PCs and the programs that had been developed almost 25 years ago ran straight away.

Now I had the Word version of the book and the programs, that I could run. I am thinking about doing some minimal updates and releasing the book on a Kindle platform.

I just wonder whether it would actually be of interest to anybody? Here are a few more details.

We describe why bookmakers and casinos always win, and why this is the case. Next we present some betting systems, focusing on roulette, horse racing and football. We provide computer programs so that you can run them for yourself. The systems/programs that we present are the same that were presented in the first edition.

The programs are written in GW-BASIC. This was the predominant language back in 1993 and it is still possible to run these programs today. Although GW-BASIC is not supplied as a matter of course now, there is an excellent emulator available and we have found that it runs the programs perfectly. How to download and use the emulator is detailed on the accompanying web site, describing the process for both PCs and Macs.

The book comprises 13 chapters, following the same structure as the first edition. The first two chapters explain why bookmakers (and casinos) win. Chapters 3 to 8 present roulette systems. Chapters 9 to 11 considers football (in the UK sense), presenting three systems that we could use to predict the outcome of matches. In chapters 12 and 13 we consider horse racing. Chapters 3-13 comes with a computer program that you can run to see how good (or bad) the system is.

Some of the systems that are presented benefit from having a computer program to test it. This is especially true of the roulette systems where it is useful having a computer program simulate a roulette wheel and make, perhaps, thousands of spins. Other systems demonstrate that technology has moved on a little. Chapters 9 and 10, for example, could easily be tested using the basic functionality that is now available on a spreadsheet and if I was to implement these systems today, I would certainly use that tool rather than developing a bespoke program.

The book also has a theme that runs through it that talks about the problems of data entry, data security and the problems we may have it trying to fit all of the data on a 3.5″ floppy disc drive. These issues are no longer of concern today. Any data you require can be downloaded, either freely or through a suitable subscription. The ability to store high volumes of data is unlikely to be a concern and how do you back it up is probably covered through automated backups and/or utilizing cloud technology. I have largely left these discussions in place just to show how technology has moved on and also to provide some historical perspective.

It should be noted that we are presenting the systems for testing. I am not suggesting that the systems will make you money. Indeed, some of them will definitely lose money, which we know before even running the system. If this were not the case then bookmakers and casinos would be out of business. Your task is to decide whether any of the systems have any potential and then, perhaps, develop the ideas further into something that you are happy to test out in the real world.

I would welcome any comments.


I also published this post on LinkedIn. You can see the post here.

Is it possible to card count a blackjack computer?

The header picture is a five dollar blackjack machine in Las Vegas (at the Palazzo), and a very good game it is too. I spent quite a few hours playing it (basic strategy). I did see another version of the machine – at Monte Carlo and Mirage, and I actually prefer those machines as they seemed a little slicker, but that is purely a personal preference.

When playing the machine, the question I had was “There are all these people using phones whilst playing blackjack, what is to stop them running an app and card counting?

After looking at the rules, I realised how the casinos have this covered. The computer uses four packs of cards (so 208 cards), and shuffles after 80 cards have been dealt. If you know anything about physical blackjack you’ll know that penetration is around 75%. That is about 75% of the cards are dealt before the cards are shuffled. Although casinos usually use six or eight decks in their shoes, if they used four decks, they would deal about 156 cards before they shoe was shuffled.

The fact that they shuffle when round 38% (80*100)/208)) of the cards have been dealt effectively makes card counting irrelevant. At least, I think it does, I have not done the maths, but it certainly means that any card counting strategy is not as effective if 156 cards were dealt before a shuffle.

But you can’t blame the casinos. The machines fill a need. There are players that want to play blackjack for $5 a hand, whereas all the tables (at least in many of the casinos on the Las Vegas strip) have a starting minimum of $10. Presumably, it is not cost effective to open a physical table with a $5 minimum and so a computer meets that need. At least it does if you don’t have to have somebody man it, which you would if you had to monitor for card counters.

So, whilst it is interesting to look at the card counting potential, it is also good that the casinos, even the higher class casinos, are willing to offer a $5 blackjack game.

As an aside, if I was to offer one suggestion to the manufacturers, I would change the video a little. Not sure how many times I saw the same cocktail waitress with a try of the same drinks and how many times I saw the guy in the red suit (he’s there now, as is the cocktail waitress!) walk up to the bar, look around and then walk off. I saw these images hundreds of times (as they repeat every thirty seconds or so). It can’t be that hard to make the video more interesting?

As a further aside, you might be interested in a paper I wrote on blackjack a few years ago.


I also published this post on LinkedIn.

When Sports Rules Go Awry: How TheConversation led to a collaborative paper

Whilst looking through Conversation articles I came across an article entitled “When scoring an own-goal is the only way to win” by Liam Lenten.

By coincidence, I had just read another article about an analysis of sporting rules from the perspecive of Operations Research, written by a good friend of mine – Mike Wright from Lancaster.

The two articles had some similaraties and, after reading Mike Wright’s article I was already planning to write a follow up. Reading Liam’s Conversation article I posted some comments and he was kind enough to respond.

One thing led to another and we agreed to write a paper together.

I am pleased to report that this article (“When Sports Rules Go Awry“) has just been accepted in the European Journal of Operational Research.

The abstract of the paper reads:

Mike Wright (Wright, M. OR analysis of sporting rules – A survey. European Journal of Operational Research, 232(1):1–8, 2014) recently presented a survey of sporting rules from an Operational Research (OR) perspective. He surveyed 21 sports, which consider the rules of sports and tournaments and whether changes have led to unintended consequences. The paper concludes: “Overall, it would seem that this is just a taster and there may be plenty more such studies to come”. In this paper we present one such study.

This is an interdisciplinary paper, which cuts across economics, sport and operational research (OR). We recognize that the paper could have been published in any of these disciplines but for the sake of continuity with the paper that motivated this study, we wanted to publish this paper in an OR journal. We look at specific examples where the rules of sports have led to unforeseen and/or unwanted consequences. We hope that the paper will be especially useful to sports administrators, helping them to review what has not previously worked and also encouraging them to engage with the scientific community when considering making changes.

We believe that this is the first time that such a comprehensive review of sporting rules, which have led to unexpected consequences, has been published in the scientific literature.

When Sports Rules Go Awry is really a review of where sporting rules have been introduced by sports administrators, but which have led to unintended consequences. For example, when it is sensible to score an own goal. The paper has several tanking (the act of deliberately dropping points or losing a game in order to gain some other advantage) examples.

We hope that the paper will be of interest to anybody who likes sports, as well as sports administrators.

It is pleasing to note that TheConversation was instrumental in making this paper happen. If it were not for them, I would have been unaware of Liam’s work. The paper may have still be written (either by Liam or me) but it would not have been as good as the paper that has now been accepted.


If you are interested, you can see my Conversation articles here and Liams articles are here.


This post also appeared on the University of Nottngham blog pages.

AlphaGo: Computers and Game Playing: A Very Timely Lecture

Today (14:00, 07 Mar 2016 in F1A09 at the University of Nottingham Malaysia Campus) I am giving a two hour lecture on Computers and Game Playing.

This lecture could not have come at a better time.

At the end of January, Google’s DeepMind reported that AlphaGo had beaten the top European Go player (Fan Hui) 5-0. This was probably about ten years earlier than most people expected a computer to defeat a human expert at Go. This You Tube video gives a very good overview of the achievement.

 

This development is, in my view and the view of many others, one of the most significant landmarks since Gary Kasparov was defeated by Deep Blue in May 1997.

The defeat of Fan Hui has generated so much interest that the World’s best player (Lee Sedol) has agreed to play AlphaGo in March (9th – 15th) 2016.

My lecture is nicely sandwiched between the recent defeat and the upcoming match against the current best player in the world.

In the lecture I will still cover the material that I need to get across (such as mini-max, alpha-beta search) but it would be remiss of me not to talk about the recent successes of AlphaGo and the technologies that have led to this remarkable achievement.

Indeed, in my next lecture, I will be talking about Deep Blue (Chess), Chinook (Checkers) and Blondie24 (Checkers), where some of the methodologies that led to their successes will be discussed. No doubt AlphaGo will also get a mention and, by then, we should have some more knowledge about it it has performed against Lee Sedol.

It’s a great time to be a student who is interested in game playing and artificial intelligence!

Finally, a plug. I am the Editor-in-Chief of the IEEE Transactions of Computational Intelligence and AI in Games (TCIAIG) and we would welcome any articles that are motivated by the recent successes in Go.

Christmas 2015: Advent calendar of research

In the run up to Christmas I have been posting each day that is (loosely) related to Research and Knowledge Exchange, and is also Christmas related.

I thought it worthwhile just summarsing them here so that you can take a look at them from from one easily accessible place.

  1. Deck the halls with research stories
  2. The Christmas Present Problem: It’s Hard – NP-Hard
  3. Packing Santa’s Sleigh
  4. How will Santa deliver all those presents this Christmas?
  5. The 12 days of Pascal’s triangular Christmas
  6. Brian Cox: Can Santa travel faster than the speed of light?
  7. Five tricks retailers will use to make you shop this Christmas
  8. Problems with your wi-fi? It could be your Christmas lights!
  9. Santa is really a Travelling Salesman
  10. How do Christmas TV adverts keep your attention
  11. Have a go at solving this Christmas cryptographic problem
  12. How does electricity usage change on Christmas day?
  13. Is your oven big enough for the turkey
  14. How will (retail) Christmas compare to 2014?
  15. Should shops open on Christmas day?
  16. Could your Christmas decorations be a hazard to planes?
  17. How Christmas lights helped guerrillas put down their guns
  18. Program your own Christmas Tree
  19. Festive spices and their intoxicating history
  20. What makes a Christmas gift good?
  21. The appeal of the Christmas song
  22. Buying Christmas presents is a real dilemma
  23. Wisdom of the Crowds at the Graduate School Christmas Party
  24. Magical Mathematics: The Mathematical Ideas That Animate Great Magic Tricks

Wisdom of the Crowds at the Graduate School Christmas Party

In 1906 Francis Galton was at a country fair and there was a guess the ox competition. He took all 787 guesses and took the average. This was 1,197 pounds. The actual weight? 1.198 pounds! In effect the wisdom of the crowds gave a perfect answer. This was the start of The Wisdom of the Crowds.Wisdom of the Crowds

Our Graduate School held its Christmas Party yesterday (18th Dec 2015) and they were kind enough to invite me. When I got there, I noticed that there was a jar of sweets, inviting people to guess how many sweets were in the jar. This reminded me of the story above.

When the competition ended, the person who had the closest guess would win the jar of sweets.

The jar held 149 sweets. The closest guess (by Oppong Kyekyeku) was 130; nineteen away – but good enough to win the prize.

When we looked at all the entries (see below), we found we had 22 entries, with an average of 152 (actually 152.409). That is just three away.

To be honest, with such a small sample size, I was surprised that the wisdom of the crowds (well small gathering) had beaten every other guess and had got within four of the right answer.

Francis Bacon would have been proud!

(This post also appeard on the University of Nottingham Research and Knowledge Exchange blog)

 

20151218_155857 20151218_155510 20151218_155922Graduate School - Gues the number of sweets