Visualizing Sports Betting with Python; Evolution of a Bankroll Over Time With +EV Betting

I think there is a lack of eloquent visual representations online of how someone wins / loses money over time with sports betting.

I’ve used a basic Python script to simulate the evolution of a sports bettor’s bankroll over time and aim to use it to show how players will win or lose money over time, depending on their betting strategy. I describe how most sports bettors lose money, and show how +EV betting or promo hunting is profitable for most. I write with the expectation you are new to most information here. If the phrases like Kelly criterion or positive expected value have any meaning to you, I would just skip to the figures below.

The mathematical and computational underpinnings of what we do here are the modeling of a stochastic process best described as a discrete-time random walk. Among many other things these have important implications in financial modeling and this lecture from a University of Leicester economics course provides a summary.

Assumptions for below:

  • Your starting account balance is $1000
  • Your unit size is $10 (you place $10 on each bet)
  • We somehow know the true probability for the outcomes of sporting events
  • We place 500 bets

Reality for >90% of players: Losing money in the long run (two-sided lines of -110 / -110 for an event whose true probability is 0.5)

You are betting on an event which is truly, unambiguously, 50/50 (e.g., the coin toss at the Super Bowl) and your sportsbook offers two-sided lines of -110 / -110. In other words, as is the case with any bet, if you pick wrong you lose your entire staked amount. If you win, you profit ~90% of your stake. This is effectively what every sportsbook offers and how every casual gambler plays.

Bankroll of 10 different players over the course of 500 bets.

The exact numbers depend very much on the sportsbook and the market you are betting on. Some markets have much more generous lines. Main lines are much more liquid than player props, and sportsbooks are much more confident in their NFL main lines than, say, Major League Table Tennis games props, and will offer better odds accordingly. The first few paragraphs on BettorOdds’ write-up describe this better than I will.

Simulated for 10 different players, you can see the natural ebb and flow of a bankroll. There is a natural variance and some players “get hot” but in the long run, the loss of money is inevitable when the odds are -110 (i.e., your profit on winning bets is 90% of your stake). Put in more statistically sound terms — you will lose money when placing bets with negative expected value.

I ran it over 500 iterations, much to the dismay of my laptop’s CPU. I’d love to do more but I’m at a coffee shop and my laptop is on battery. Anyway– note that almost every bettor loses money in the long run. The occasional gambler will find luck and find himself up over a short period of time — the simulation indicated by the orange line finished at a bankroll of $1002 after 500 bets. All others were down some significant amount. Despite some brief stretch of luck found by orange, over infinitely many iterations (bets), every bettor will lose money. This is the multi-billion dollar investment thesis of Las Vegas sportsbooks and we are certain it is true from practice as well as probability.

A perfectly fair sportsbook who offers odds that perfectly reflect the true probability of events occurring

Bankroll of 10 different players over the course of 500 bets.

This theoretical sportsbook does not wish to make any money, but only provide liquidity to the betting market. In the long run, your return on investment will tend towards zero and averaged over many simulations, your bankroll will remain near its starting balance… well, probably. Kind of. Not really. Below the image I will take a quick detour on random walks in stochastic processes— I would ignore this and skip to the next image if that sounds boring.

In reality what I describing above is an unbiased random walk, and there is a small but non-zero chance that variance wipes out your bankroll entirely. In other words, you go on an exceedingly cold streak that wipes out your bankroll entirely, and now you are broke with no possibility of recovery. It may be easier to imagine this if your account balance is $100 and your bet size is $50. Lose your first two bets and it’s over. Even if you work your way up to a $200 balance, lose 4 bets in a row and it’s over. It’s not hard to imagine a coin landing on heads 4 times in a row. If you flip the coin 10,000 times, the probability approaches 1.

This phenomenon is described as “gambler’s ruin” and there are mathematical tools for describing the probability that you are broke after t bets, with some starting bankroll n. Or the probability that you reach a certain account balance after t bets without being ruined. A real-life gambler, if he is playing responsibly, assigns his bet size to some percent of his bankroll such that losing money in the long run won’t entirely bankrupt him but slowly tick down his bankroll closer and closer to zero with each loss.

The mathematical underpinnings of this are beyond the scope of my knowledge but I think should be well within the reach of undergraduate probability classes. See this lecture from an MIT course on probability in computer science. There is a LibreText chapter on Introductory Probability which describes it in section 12.1.

Sportsbook offers line of +110 for an event whose true probability is 0.5:

Bankroll of 10 different players over the course of 500 bets.

Sportsbook offers line of +130 for an event whose true probability is 0.5:

Bankroll of 10 different players over the course of 500 bets.

As you will basically never find lines this good without boosts / promos, this is effectively promo betting or promo hunting; taking a normal -110 / -110 main line and applying a 50% boost to it. Even if you randomly choose sides, hitting 50% of these bets will lead to positive returns. You have some wiggle room and do not even need to hit half of them.

There will never be a main line or prop bet whose line strays this far from the true odds for more than a few minutes. There are computers and humans who will hammer the bet until the sportsbook either removes it or lowers its odds to minimize risk.

How can we say we know the true probability for a sporting event?

I will write this part later– I wanted to publish the graphics today

Thanks!

  • This simulation uses the following Python libraries:
    • NumPy (https://numpy.org/): Developed and maintained by the NumPy community
    • Matplotlib (https://matplotlib.org/): Developed and maintained by the Matplotlib development team
    • Pillow (https://python-pillow.org/): Developed and maintained by the Pillow contributors.
  • Grinstead and Snell’s Introduction to Probability was helpful.
  • This lecture from a University of Leicester economics course was helpful.