world series betting strategy

september 18, 2024

We're tackling the problem proposed by Elwyn Berlekamp (i think?)

You are a broker; your job is to accommodate your client’s wishes without placing any of your personal capital at risk. Your client wishes to place an even $1,000 bet on the outcome of the World Series, which is a baseball contest decided in favor of whichever of two teams first wins 4 games. That is, the client deposits his $1,000 with you in advance of the series. At the end of the series, he must receive from you either $2,000 if his team wins, or nothing if his team loses.

No market exists for bets on the entire World Series. However, you can place even bets, in any amount, on each game individually. What is your strategy for placing bets on the individual games in order to achieve the cumulative result demanded by your client?

Foundation

For the sake of this problem, we can assume every game will be equal in probability, 50% chance that the desired team wins and 50% the other team wins.

Reading the problem, we can lay some foundation. First, we can use some state system (which will be useful later) to denote what stage the series is in. In this case, (i,j)(i,j) can represent the ii wins until the client's team wins the series and jj wins until the opposing team wins. Default starting state is (4,4)(4,4).

Example: (3,4)(3,4) means the client's team has won 1 game, and the opposing team has yet to win a game.

We want to come up with some P(i,j)P(i,j) that will be the probability of the client's team winning starting from the state (i,j)(i,j).

P(i,j)=0.5P(i1,j)+0.5P(i,j1)P(i,j) = 0.5 * P(i-1,j) + 0.5 * P(i,j-1)

Since this is a recursive formula, if we plug any (i,j)(i,j) into the formula, such that i>0i > 0 and j>0j > 0, it will create "subproblems" that will eventually be broken down to the base cases P(0,j)=1P(0,j) = 1 and P(i,0)=0P(i,0) = 0.

How did we derive this formula? Well, here we used something called the Law of Total Probability to derive it. The first term is in the case that the client's team wins (one less win necessary for winning the series), and the second term is in the case that the opposing team wins (one less win necessary for winning the series).

We will also say that S(i,j)=P(i,j)$2000S(i,j) = P(i,j) * \$2000 is the expected payout for the state (i,j)(i,j). If it helps, imagine most sportbooks will allow you to cash your play during the series, so you can bet on the outcome of the series, and you want to have the appropriate payout on hand at any point.

Setting up the equations

We know that when the client team wins a game, then the on-hand capital, CC, will be

C+B=S(i1,j)C + B = S(i-1,j)

and when the opposing team wins a game, then the on-hand capital, CC, will be

CB=S(i,j1)C - B = S(i,j-1)

where BB is the amount of bet on each game.

To find a equation that satisfies the above equations, we can use the following equations:

{C+B=S(i1,j)CB=S(i,j1)\begin{cases} C + B = S(i - 1, j) \\ C - B = S(i, j - 1) \end{cases}

Subtract the second equation from the first equation to get

(C+B)(CB)=S(i1,j)S(i,j1)(C + B) - (C - B) = S(i - 1, j) - S(i, j - 1)

Simplify a bit to get

2B=S(i1,j)S(i,j1)2B = S(i - 1, j) - S(i, j - 1)

B(i,j)=S(i1,j)S(i,j1)2B(i,j) = \frac{S(i - 1, j) - S(i, j - 1)}{2}

Now, we can plug this into the first equation to get

C=S(i1,j)S(i1,j)S(i,j1)2C = S(i - 1, j) - \frac{S(i - 1, j) - S(i, j - 1)}{2}

C(i,j)=S(i1,j)+S(i,j1)2C(i,j) = \frac{S(i - 1, j) + S(i, j - 1)}{2}

These two functions will give us the on-hand capital we should have and the bet we should place at any given (i,j)(i,j).

Trying the solution

Quickly progammed a python script to test the solution.

import random

def p(i,j):
    if i == 0:
        return 1
    elif j == 0:
        return 0
    else:
        return 0.5*p(i,j-1) + 0.5*p(i-1,j) 
    
def s(i,j):
    return 2000 * p(i,j)

def b(i,j):
    return (s(i-1,j) - s(i,j-1))/2

def simulate():
    capital = 1000
    i,j = 4, 4
    game_number = 1

    while i > 0 and j > 0:
        current_bet = b(i,j)
        if current_bet > capital:
            current_bet = capital
        
        outcome = random.choice(['win','lose'])

        if outcome == 'win':
            capital += current_bet
            i -= 1
            outcome_str = "Win"
        else:
            capital -= current_bet
            j -= 1
            outcome_str = "Loss"

        print(f"Game {game_number}: State ({i + (1 if outcome == 'W' else 0)}, {j + (1 if outcome == 'L' else 0)}), "
              f"Bet: ${current_bet:.2f}, Outcome: {outcome_str}, New Capital: ${capital:.2f}")
        
        game_number += 1

    if i == 0:
        print("Client's team has won the series.")
        print(f"Final Capital: ${capital:.2f}")
    else:
        print("Client's team has lost the series.")
        print(f"Final Capital: ${capital:.2f}")

simulate()

And it works! Run it as much as you want, you'll see no matter how the series ends, the capital will always be $0 or $2000 by the end of the simulation.