Sports Betting with Python - Part 2 Betting Basics

        Let’s kick things off with some betting basics. We’ll get to the specifics of sports betting in the next post, but it’s always fundamental to see where these ideas come from. If you pay close attention and understand these core concepts then you will be able to apply them anywhere. We’re getting into some real wax-on wax-off type stuff here.

        At a fundamental level, a bet is when you risk something (money, time, pride, the ability to chose your hairstyle for the next week, etc.) with the hopes of earning something in return (money, skills, bragging rights, ruining your friends’ chances of future employability, etc.). The thing you risk losing is called the stake and the thing you gain by winning is called the payout. In the best case scenario you would stake nothing for an infinite payout. In the worst case scenario you would stake everything for absolutely no payout. Reality lies somewhere in the middle: staking something reasonable for a reasonable payout. The difference in beliefs about what is a “reasonable” stake/payout tradeoff is where the magic of a bet can occur.

        Let’s say your neighbor is a rain-dancing shaman and is about to perform their rain dance in the middle of June to bring rain to Death Valley. They claim that they are especially confident in their abilities because they just earned the rain-dancing certification from AWS. You tell them that’s not what AWS means by “using the cloud” but your neighbor insists it’s true. You decide to look up precipitation patterns in Death Valley just to make sure that deserts still don’t rain. After spending some time researching you find out that there is only about a 1% chance of rain in June. Assuming you believe that weather patterns are independent of the rain dance, you are 99% confident that it will not rain in Death Valley in June. You could keep arguing with them, or you can invite them to put their money where their mouth is. Since there is still a small chance of rain with or without dancing (and your neighbor does claim to be AWS rain-dancing certified) you aren’t quite willing to bet your entire soul on this event. Settling somewhere between $0 and your soul, you organize a bet with your neighbor. If it rains in Death Valley in June you will give your neighbor $50, if it does not your neighbor will give you $50. Seems fair right? Assuming $50 can dent your neighbor’s pocket change (or pride) this is where we get to find out about how much they really believe in their skills.

        If your neighbor jumped at the chance to take that bet and considered the $50 as good as theirs, they are implying that they think there is a higher than 50% chance of them winning the bet. If they outright refuse the bet they are implying that they have a lower than 50% chance of winning the bet. However, they may also propose a compromise. Your neighbor hasn’t completely lost the plot and recognizes that there is a decent chance of going without rain even if they nail their dance. They offer a new bet where they still stake $50 on rain in Death Valley, but only if you stake $100 against. Now we’re talking some serious cash, and this bet might bruise some peoples’ egos. Isn’t it unfair to put up more money for the same exact bet? What does this new bet imply about our neighbor’s faith in their cloud-conjuring abilities? Finally, is this bet still worth making?

        This revised bet is more than fair, in fact your neighbor just invited you to make a slam dunk. Even when you stake double what your neighbor does you’re so much more likely to win that it is still worth the reduced payout. When looking at the actual bet sizes that two individuals place we can extract an implied probabilities from both sides of the bet.

        In our first case of an even split we find that

your_stake = 50
neighbor_stake = 50
winner_payout = your_stake + neighbor_stake = 100

        Implied probabilities can be calculated using your stake divided by the total payout. This yields the following implied probabilities:

your_implied_prob = your_stake / winner_payout = 0.5 = 50%

neighbor_implied_prob = neighbor_stake / winner_payout = 0.5 = 50%

        This means that if the two of you accept the bet, you each think that 50% is a “reasonable” stake/payout tradeoff. Let’s look at how this changes with the neighbor’s revision:

your_stake = 100
neighbor_stake = 50
winner_payout = your_stake + neighbor_stake = 150
your_implied_prob = your_stake / winner_payout = 0.67 = 67%
neighbor_implied_prob = neighbor_stake / winner_payout = 0.33 = 33%

        Since you accepted this bet, you’re locking in your implied probability at a 67% chance of no rain in Death Valley. Without putting it into words, your neighbor also implied that they believe their rain dance has a 33% chance of success. This further implies that they believe their rain dance will make rain in Death Valley 33 times more likely. If you kept this same 1:2 ratio of bets on this same scenario but instead put a total of $1,500 or $15,000 on the line that would also indicate how confident the two of you are that a 33% is (or is not) a reasonable chance for rain. But wait, isn’t there a 99% chance of rain? Why is 67% a great implied probability if it’s not even close to 99%?

        An implied probability of 67% is great precisely because there is a 99% chance of rain. We can think of the implied probability of an event as a threshold or lower limit on what we think is a worthwhile bet. As soon as the terms of the bet shift to adjust your implied odds up to 99% the two of you are essentially both agreeing on exactly what is about to happen. Since you believe there is 99% chance of rain your breakeven point for this bet is 99%. When you take a bet like this again and again (assuming there truly was a 99% chance of a dry June in Death Valley) then in the end you wouldn’t lose money and you wouldn’t gain money, you would only break even. However this does mean that it would be mathematically justified to take this bet if the terms were anything better than you staking $1 for rain and your neighbor staking $99 against. You stake $99 and they stake $2? Take the bet. You stake $99 and they stake $1.50? Take the bet. You stake $67 and they stake $33? Take. The. Bet.

        Of course as the implied probability inches closer and closer to what you believe to be the breakeven point your margin of error becomes thinner and thinner. If you stake $99 and they stake $1 but there is actually a 90% chance of rain (say, due to other weather anomalies in the surrounding region) then congratulations, you just got played by your neighbor and their classic “rain dance” hustle. Clever clever. If you and your neighbor were robots (or incredibly sharp bettors) this whole interaction would look something like this:

Neighbor: I am confident in the event.

You: There is a 50% chance of the event.

Neighbor: No. There is a 33% chance in the event.

You: 33% is far too high of a chance in the event. You will now lose money. Haha. Muhahahaha.

        These are exactly the types of bets we are going to be making at scale with our Sports Betting with Python project. We will use data to make our best estimate for a reasonable breakeven point, check if there is someone willing to make a bet with an implied probability lower than our breakeven point, and finally place bets (either simulated or with cold hard cash) when we come across these opportunities. If we want to make these bets at scale we’ll need to throw in an additional variable: a middleman to offer a market of bets that is called a sportsbook. In the next post we will cover how the sportsbooks present their odds, where they take their cut, and how we can use the differences between sportsbooks markets to our advantage.

In summary:

  • A bet is when two people have different beliefs about an event and turn that difference in beliefs into a way to gain value.
  • When two people make a bet they stake something valuable so that they can receive a more valuable payout if they win.
  • When the terms of this bet are quantified in dollars an implied probability (or a believed probability) of the event occurring can be calculated for both sides of the bet.
  • One can compare this implied probability with what they feel is the true probability of the event occurring (the breakeven point) to determine whether a bet is worth placing.
Previous Post Sports Betting with Python - Part 1 Project Introduction Next Post A Fort Minor Solution to a Major Problem
Hashy Birthday!
Sept. 4, 2022, 2:57 a.m.
Sports Betting with Python - Part 1 Project Introduction
Sept. 4, 2022, 3 a.m.
Mini Martial Artists
Sept. 4, 2022, 2:58 a.m.