Keno Helper
Code:
Date:
Summer 2022
Why:
I was mesmerized by Keno when I was a kid. Every time my family went out to eat it seemed like there was always a TV somewhere with this “show” on. I also knew that this had something to do with the slips of paper and small pencils on each table. I was absolutely forbidden from touching them which of course only made it more interesting. As an adult I know that gamblers do not like Keno due to its low payouts. I wanted to investigate a couple of “strategies” that I had either read about or heard of.
The first is the Monte Carlo Fallacy (or the Gambler’s Fallacy). It is the idea that if some event in a game has not occurred for some time that it is “due” to happen soon. For Keno, this would be something like, “I have been watching, and 21 has not come up for the last 10 games so I will include that with my picks.”
The second is the idea of “hot” numbers. This would be something like, “I have been watching, and 42 has come up in the last 4 games! It must come up again.”
What:

I created a web scraper using JavaScript to get data from the Hot Spot website. This web scraper would output the game results in a format for a C++ class that I created. I then copy and pasted the games into my C++ program until I had a day’s worth of information. I read where my IP could potentially be blocked if I made too many requests, and if I remember correctly, at one point I was doing two requests at a time with the web scraper but no more than that. (There was a plan in place to use a proxy server to pull a huge amount of game data, however preliminary results suggested that this may not be a good use of my time.)
I then created a program in C++ that would go through different sets of games and make predictions for the next x-amount of games. Initially, I was making predictions for 10 spot (where you pick 10 numbers). However, when I did the math in an Excel sheet, I found that the best pay outs were for 4 spot. (An approximate payout of $0.66 per dollar spent. This is why gamblers generally dislike Keno. The worst was 1 spot with a payout of $0.50 per dollar spent.)
Note that there is a feature called the Bulls Eye (BE on the spreadsheet). However, from a probability perspective, it does not make sense to use this feature to increase payouts.
My first attempts looked at the past hour and then made predictions for the next hour. I had some very reassuring initial results. If I had not had these I probably would not have worked on this project for as long as I did. I forget which fallacy I was testing, but on 10 spot one of the algorithms would have made $300+ for one hour. I was thrilled. I was going to be rich! How could anyone have not done this before?
Of course, the problem is that it never happened again. Any gains made would have been lost paying for future games. This was an important lesson though. I could have been an example in Fooled by Randomness by Nassim Taleb. I can’t remember verbatim what he writes, but it goes like even in a random system there are times when it seems predictable. Which is exactly what had happened.
After varying the size of the sample games (games a prediction would be made from), and future games (games the prediction would be tested against), I was able to produce no evidence that either of the common Keno strategies mentioned above would work. Despite all my efforts I was never able to produce a consistent outcome above the $0.66 per dollar mark. This means that the second-best way to play Keno is to use a random number generator to pick numbers. I would be reluctant to use the one that Hot Spot provides for players, but maybe this could be a future project.
What is the best way to play Keno? To not play at all! From a probability perspective you will “make” more money that way.
I have included my code above if you would like to conduct this experiment for yourself. One improvement that could have been made but was not would have been putting the information for the games in a separate data file.
Back to top