Chapter 25 Exercises: Optimization Methods for Betting

Instructions: Complete all exercises in the parts assigned by your instructor. Show all work for calculation problems. For programming challenges, include comments explaining your logic and provide sample output. For analysis and research problems, cite your sources where applicable.


Part A: Conceptual Understanding

Each problem is worth 5 points. Answer in complete sentences unless otherwise directed.


Exercise A.1 --- Linear Programming Fundamentals

Explain the key properties of linear programming that make it suitable for betting allocation problems. Address (a) what "global optimality" means and why it matters (compared to local optima in non-linear problems), (b) what "sensitivity analysis" is and how shadow prices can guide a bettor's sportsbook strategy, (c) the distinction between binding and non-binding constraints and what each implies about the optimal solution, and (d) why LP is insufficient for problems where risk (variance) matters.


Exercise A.2 --- Portfolio Theory Adapted to Betting

Compare and contrast the application of Markowitz mean-variance portfolio theory to financial assets versus sports bets. Address (a) why bet returns are binary (win/loss) while financial returns are continuous, and what this implies for the covariance matrix, (b) why the holding period is different (bets resolve on a fixed date; stocks can be sold anytime), (c) why the efficient frontier for bets is typically shorter and steeper than for stocks, and (d) what happens to the optimal portfolio when you incorrectly assume bet outcomes are independent but they are actually correlated.


Exercise A.3 --- Correlation in Betting Portfolios

Identify and explain four distinct sources of correlation between sports bet outcomes. For each source, provide (a) a concrete example, (b) an estimate of the typical correlation magnitude, (c) whether the correlation is positive or negative, and (d) how ignoring this correlation would affect portfolio risk.


Exercise A.4 --- Arbitrage: Theory vs. Practice

Explain why arbitrage opportunities are rare in efficient markets but occasionally appear in sports betting. Address (a) the mathematical condition for arbitrage in a two-outcome event, (b) why cross-book arbitrage is more common than single-book arbitrage, (c) four practical challenges that make arbitrage less profitable than the mathematics suggests, and (d) why sportsbooks limit or ban arbitrage bettors and what this implies about the sustainability of an arb-only strategy.


Exercise A.5 --- Kelly Criterion Limitations

The Kelly criterion maximizes long-run bankroll growth, but most practitioners use fractional Kelly. Explain (a) why full Kelly is too aggressive when probability estimates contain errors, (b) the mathematical relationship between estimation error and optimal Kelly fraction, (c) why multi-bet Kelly with correlated outcomes is more complex than single-bet Kelly, and (d) the practical benefits of half-Kelly or quarter-Kelly in terms of drawdown reduction and psychological sustainability.


Exercise A.6 --- Multi-Objective Trade-offs

A bettor wants to maximize expected profit, minimize variance, and minimize their maximum bet at any single sportsbook (to avoid being limited). Explain (a) why these three objectives cannot all be optimized simultaneously, (b) what the Pareto frontier represents in this context, (c) the difference between the weighted-sum method and the epsilon-constraint method for computing the Pareto frontier, and (d) how a bettor should choose their preferred point on the frontier.


Exercise A.7 --- Convexity in Optimization

Explain why convexity is important in betting optimization problems. Address (a) the definition of a convex optimization problem, (b) why the Kelly criterion objective (expected log growth) is concave (and therefore its negation is convex), (c) why mean-variance portfolio optimization is convex, and (d) an example of a non-convex betting optimization problem and why it is harder to solve.


Exercise A.8 --- Shadow Prices in Betting

A linear programming solution for bet allocation reports the following shadow prices: the total exposure constraint has a shadow price of $0.04, the NFL group constraint has a shadow price of $0.06, and the NBA group constraint has a shadow price of $0.00. Interpret each shadow price in practical terms and explain (a) what the total exposure shadow price means for the bettor's bankroll strategy, (b) why the NFL shadow price is higher than the NBA shadow price, (c) what actions the bettor should take based on these shadow prices, and (d) the range of validity for shadow price interpretations.


Part B: Calculations

Each problem is worth 5 points. Show all work and round final answers to the indicated precision.


Exercise B.1 --- LP Formulation

A bettor faces 4 bets with expected returns per dollar of (0.08, 0.05, 0.12, 0.03). Maximum individual bets are ($500, $400, $300, $600). Total exposure cannot exceed $1,200.

(a) Write out the complete LP formulation (objective function and all constraints).

(b) Without solving formally, argue which constraint(s) will be binding at the optimum.

(c) If the total exposure constraint is relaxed to $1,500, which bets would receive additional allocation and why?

(d) The bettor discovers Bet 3 has a minimum bet of $100. How does this change the LP formulation?


Exercise B.2 --- Arbitrage Calculation

Three sportsbooks offer the following decimal odds on a tennis match:

Sportsbook Player A Player B
Book 1 2.15 1.80
Book 2 2.05 1.92
Book 3 2.25 1.75

(a) Identify the best odds for each player across all books.

(b) Calculate the inverse sum. Does an arbitrage opportunity exist?

(c) If investing $1,000, calculate the optimal stake on each player and the guaranteed profit.

(d) Book 3 has a maximum bet of $300 on Player A. How does this constraint affect the arb execution?


Exercise B.3 --- Portfolio Variance Calculation

A bettor places three bets with the following characteristics:

Bet Weight True Prob Decimal Odds Variance
Bet 1 0.30 0.55 2.00 0.990
Bet 2 0.25 0.60 1.80 0.778
Bet 3 0.20 0.52 1.95 0.950

The correlation matrix is:

$$\rho = \begin{pmatrix} 1.0 & 0.15 & -0.05 \\ 0.15 & 1.0 & 0.10 \\ -0.05 & 0.10 & 1.0 \end{pmatrix}$$

(a) Compute the expected portfolio return $E[R_p] = \sum w_i \mu_i$ where $\mu_i = p_i \cdot d_i - 1$.

(b) Compute the covariance matrix from the correlation matrix and variances.

(c) Compute the portfolio variance $\sigma_p^2 = \mathbf{w}^T \Sigma \mathbf{w}$.

(d) Compute the portfolio Sharpe ratio $E[R_p] / \sigma_p$.


Exercise B.4 --- Kelly Criterion with Constraints

A bettor faces two simultaneous bets: - Bet A: probability 0.58, decimal odds 2.10 - Bet B: probability 0.55, decimal odds 1.91

The bets are independent. The maximum total exposure is 25% of bankroll.

(a) Compute the single-bet Kelly fraction for each bet.

(b) The sum of single-bet Kelly fractions exceeds the 25% constraint. Propose a proportional scaling approach to satisfy the constraint.

(c) For the scaled allocation, compute the expected return and the probability of losing money on this combined bet.

(d) Compare with a half-Kelly approach (halve both single-bet Kelly fractions). Which approach has better risk-adjusted returns?


Exercise B.5 --- Efficient Frontier Point

Given two bets with expected returns $\mu_1 = 0.10$ and $\mu_2 = 0.06$, variances $\sigma_1^2 = 1.0$ and $\sigma_2^2 = 0.8$, and correlation $\rho = 0.2$:

(a) Compute the expected return and variance for a 50/50 portfolio ($w_1 = 0.5, w_2 = 0.5$).

(b) Compute the expected return and variance for a 70/30 portfolio.

(c) Which portfolio has a higher Sharpe ratio?

(d) If the maximum weight per bet is 0.60, what is the maximum achievable expected return on the efficient frontier?


Exercise B.6 --- Three-Way Arbitrage

A soccer match has the following best odds across sportsbooks: - Home win: 3.10 (Book A) - Draw: 3.60 (Book C) - Away win: 2.50 (Book B)

(a) Calculate the inverse sum. Is there an arbitrage opportunity?

(b) For a $3,000 total investment, compute the optimal stakes on each outcome.

(c) Compute the guaranteed profit and ROI.

(d) If the draw odds drop from 3.60 to 3.40, is the arbitrage still present?


Exercise B.7 --- Multi-Objective Weighting

A bettor evaluates three allocation strategies:

Strategy E[Return] Std Dev Max Single Bet
Aggressive 0.045 0.18 $800
Balanced 0.032 0.11 $400
Conservative 0.018 0.06 $200

(a) Compute the Sharpe ratio for each strategy.

(b) Using an objective function $U = E[R] - \lambda \cdot \sigma^2$ with $\lambda = 1.0$, rank the strategies.

(c) At what value of $\lambda$ are the Aggressive and Balanced strategies equally preferred?

(d) If the bettor adds a penalty of $0.0001 per dollar of maximum single bet (to avoid sportsbook limits), recompute the utility for each strategy with $\lambda = 1.0$.


Part C: Programming Challenges

Each problem is worth 10 points. Write clean, well-documented Python code. Include docstrings, type hints, and at least three test cases per function.


Exercise C.1 --- Complete LP Solver with Sensitivity Analysis

Build a betting allocation LP solver that includes full sensitivity analysis.

Requirements: - Accept a set of bets with expected returns, maximum bet sizes, and group memberships. - Solve the LP using PuLP, maximizing expected profit subject to individual, group, and total exposure constraints. - Compute and report: optimal allocation, shadow prices for all constraints, allowable increase/decrease ranges for objective coefficients, and slack in each constraint. - Implement a "what-if" analysis that shows how the optimal allocation and profit change as each constraint bound varies over a specified range. - Demonstrate with a 12-bet example across 3 sports with realistic edges and constraints.


Exercise C.2 --- Efficient Frontier Constructor

Build a complete efficient frontier tool for betting portfolios.

Requirements: - Accept bet expected returns, a covariance matrix, and constraints (max weight, max total weight). - Compute the efficient frontier by solving the minimum-variance portfolio for a range of target returns (using cvxpy). - Identify the maximum Sharpe ratio portfolio, the minimum variance portfolio, and the maximum return portfolio. - Plot the efficient frontier with individual bets shown as points. - Compute the "diversification benefit" --- the reduction in portfolio risk from combining bets versus holding each individually. - Test with a realistic 8-bet portfolio with a non-trivial correlation structure.


Exercise C.3 --- Real-Time Arbitrage Scanner

Build an arbitrage scanner that monitors odds and detects opportunities.

Requirements: - Implement two-way and three-way arbitrage detection with optimal stake computation. - Support configurable minimum profit thresholds and maximum bet constraints per sportsbook. - Track "near-arbs" (inverse sum between 1.00 and 1.02) as potential value indicators. - Compute the expected frequency of arbitrage given a model of odds variation (assume each book's odds are independently perturbed by a normal distribution with standard deviation of 2%). - Simulate 1,000 market snapshots for 10 events across 4 books and report: number of arbs found, average profit margin, and distribution of arb durations.


Exercise C.4 --- Constrained Multi-Bet Kelly Optimizer

Build a production-quality constrained Kelly optimizer for simultaneous bets.

Requirements: - Handle up to 20 simultaneous bets with an arbitrary correlation matrix. - Support constraints: maximum individual bet, maximum total exposure, maximum exposure per sport/league, and minimum bet size (below which the bet is not placed). - Implement both exact enumeration (for $n \leq 15$) and Monte Carlo approximation (for $n > 15$). - Compare full Kelly, half-Kelly, and quarter-Kelly allocations on the same set of bets, reporting: expected growth rate, expected return, probability of loss, worst-case loss, and maximum drawdown (estimated via simulation). - Test with a realistic 8-bet NFL Sunday slate with correlations between same-game bets.


Exercise C.5 --- Multi-Objective Betting Dashboard

Build a multi-objective optimization system that produces a comprehensive decision dashboard.

Requirements: - Implement both weighted-sum and epsilon-constraint methods for computing the Pareto frontier. - Support three objectives: maximize expected return, minimize variance, and minimize concentration (HHI). - For each point on the Pareto frontier, compute and display: allocation, expected return, standard deviation, Sharpe ratio, HHI, number of active bets, and VaR (5%). - Implement a "recommendation engine" that, given a bettor's risk tolerance (low/medium/high), selects the appropriate point on the frontier. - Test with a 10-bet slate and display a formatted dashboard showing the recommended allocation.


Part D: Analysis & Interpretation

Each problem is worth 5 points. Provide structured, well-reasoned responses.


Exercise D.1 --- Interpreting LP Output

A linear programming solver produces the following optimal allocation for an NFL Sunday slate:

Bet Edge Max Bet Optimal Bet Shadow Price
KC ML 8.2% $500 | $500 $0.082
PHI -3 5.1% $500 | $500 $0.051
DET -6.5 6.8% $500 | $300 $0.000
Over 47.5 3.2% $500 | $0 $0.000
MIA ML 4.5% $300 | $300 $0.045

Total exposure constraint: $1,600 (binding, shadow price: $0.032)

(a) Why does DET -6.5 receive only $300 despite having the second-highest edge?

(b) Why is Over 47.5 not included in the optimal allocation despite having a positive edge?

(c) The shadow price on the total exposure constraint is $0.032. Interpret this in practical terms.

(d) The shadow prices on KC ML and MIA ML equal their edges. Why is this, and what does it imply about how these bets are constrained?

(e) If the bettor could increase their limit at one sportsbook by $100, which bet's limit should they target?


Exercise D.2 --- Portfolio Optimization Results

A mean-variance optimizer produces three portfolios for the same set of 6 NBA bets:

Portfolio E[Return] Std Dev Sharpe N Active Max Weight
Min Variance 0.018 0.052 0.346 6 0.19
Max Sharpe 0.031 0.078 0.397 4 0.25
Max Return 0.042 0.145 0.290 2 0.25

(a) The Max Sharpe portfolio achieves the best risk-adjusted return but drops two bets. Why might the optimizer exclude bets with positive expected value?

(b) The Min Variance portfolio includes all 6 bets. What role are the low-edge bets playing in this portfolio?

(c) A bettor with a $10,000 bankroll and a maximum tolerable loss of $500 per day should choose which portfolio? Justify with a quantitative argument.

(d) How would increasing the maximum weight constraint from 0.25 to 0.40 change each portfolio?


Exercise D.3 --- Arbitrage Execution Challenges

An arbitrage scanner detects the following opportunity on an NBA game:

Outcome Best Odds Sportsbook Max Bet
Lakers ML 2.35 DraftKings $500
Celtics ML 1.72 FanDuel $2,000

Inverse sum: 0.9068. Guaranteed profit margin: 1.03%.

(a) Compute the optimal stakes and guaranteed profit on a $1,000 investment.

(b) The bettor places the Lakers bet first ($460 at DraftKings). Before they can place the Celtics bet, FanDuel moves the line from 1.72 to 1.65. Is the arb still profitable? Compute the new guaranteed profit (or loss).

(c) If there is a 20% chance the line moves before the second leg is placed, what is the expected profit of attempting this arb (assuming the line moves to 1.65 with 20% probability and stays at 1.72 with 80% probability)?

(d) How does this execution risk change the effective profit margin of the strategy?


Exercise D.4 --- Kelly vs. Mean-Variance

A bettor compares two allocation methods on the same set of 5 bets:

Method Total Exposure E[Return] Std Dev E[Log Growth] Worst Case
Constrained Kelly 22.3% 0.028 0.092 0.0238 -15.8%
Mean-Variance (lambda=2) 18.5% 0.024 0.071 0.0215 -11.2%

(a) Kelly optimizes expected log growth while mean-variance optimizes $E[R] - \lambda \sigma^2$. Explain conceptually why these lead to different allocations.

(b) The Kelly allocation has higher expected return but also higher worst-case loss. For a bettor with a $5,000 bankroll, which allocation is more appropriate and why?

(c) At what bankroll size would the Kelly allocation become clearly superior? Consider the relationship between bankroll size and the impact of worst-case losses.

(d) Could the mean-variance optimizer reproduce the Kelly allocation by choosing the right $\lambda$? Why or why not?


Exercise D.5 --- Multi-Objective Tradeoffs

A bettor computes the Pareto frontier for profit vs. sportsbook exposure and finds these representative points:

Point E[Profit] Max Book Exposure N Books Used
A $85 | $1,200 1
B $72 | $600 2
C $58 | $350 3
D $40 | $200 4

(a) Point A concentrates all bets at one sportsbook. Why does this maximize expected profit?

(b) A bettor has been limited at two sportsbooks in the past year. Which point should they choose, and why?

(c) Compute the "cost of diversification" --- the expected profit sacrificed by moving from Point A to Point C.

(d) If the bettor values each dollar of reduced max book exposure at $0.05 (to preserve account access), which point maximizes their utility?


Part E: Research & Extension

Each problem is worth 5 points. These require independent research beyond Chapter 25. Cite all sources.


Exercise E.1 --- History of Portfolio Theory

Research and write a brief essay (500-700 words) tracing the history of portfolio optimization from Markowitz (1952) through its application to sports betting. Cover (a) the original mean-variance framework, (b) the Capital Asset Pricing Model and its assumptions, (c) the Kelly criterion's origins in information theory (Kelly, 1956), (d) the first applications of portfolio theory to gambling and betting, and (e) modern computational tools (cvxpy, PuLP) that make these methods accessible.


Exercise E.2 --- Robust Optimization for Uncertain Edges

Research robust optimization methods that account for uncertainty in estimated probabilities. Find at least two published examples or methodological papers. For each, report (a) the type of uncertainty modeled (e.g., box uncertainty, ellipsoidal uncertainty), (b) the optimization framework used, (c) how the robust solution differs from the nominal solution, and (d) the practical implications for betting.


Exercise E.3 --- Stochastic Programming for Sequential Betting

Research stochastic programming as applied to sequential decision-making in betting. Write a 400-600 word summary explaining (a) the difference between single-stage and multi-stage optimization, (b) how a bettor's future opportunities depend on current bankroll (which depends on today's bet outcomes), (c) a published example of stochastic programming in gambling or finance, and (d) the computational challenges of solving multi-stage stochastic programs.


Exercise E.4 --- Machine Learning for Odds Arbitrage

Research how machine learning techniques are used to identify arbitrage-like opportunities or systematically mispriced odds. Find at least two published papers or industry reports. For each, summarize (a) the ML method used (e.g., neural networks, gradient boosting), (b) the features and training data, (c) how the ML predictions were converted into betting strategies, (d) the reported profitability, and (e) any concerns about overfitting or market adaptation.


Exercise E.5 --- Regulatory Constraints on Betting Optimization

Research the regulatory landscape for sports betting in a jurisdiction of your choice. Address (a) any mandated maximum bet sizes or loss limits, (b) responsible gambling requirements that constrain optimization (e.g., deposit limits, cooling-off periods), (c) how these constraints can be incorporated into the LP/optimization framework from Chapter 25, (d) whether regulatory constraints create opportunities (e.g., by limiting competitors), and (e) ethical considerations in optimizing around responsible gambling constraints.


Scoring Guide

Part Problems Points Each Total Points
A: Conceptual Understanding 8 5 40
B: Calculations 7 5 35
C: Programming Challenges 5 10 50
D: Analysis & Interpretation 5 5 25
E: Research & Extension 5 5 25
Total 30 --- 175

Grading Criteria

Part A (Conceptual): Full credit requires clear, accurate explanations demonstrating understanding of optimization concepts and their relevance to sports betting. Partial credit for incomplete but correct reasoning.

Part B (Calculations): Full credit requires correct final answers with all work shown. Partial credit for correct methodology with arithmetic errors.

Part C (Programming): Graded on correctness (40%), code quality and documentation (30%), and test coverage (30%). Code must execute without errors.

Part D (Analysis): Graded on analytical depth, logical reasoning, and appropriate application of optimization concepts to real-world betting scenarios. Multiple valid approaches may exist.

Part E (Research): Graded on research quality, source credibility, analytical depth, and clear writing. Minimum source requirements specified per problem.


Solutions: Complete worked solutions for all exercises are available in code/exercise-solutions.py. For programming challenges, reference implementations are provided in the code/ directory.