Free course · Intermediate · 10 parts · ~86 min

Randomness, Inference & Simulation

Monte Carlo seasons, bootstrap intervals, permutation tests, power, chi-square, Bayesian updating, regression to the mean — how to tell signal from luck.

The hardest question in sports analytics isn't computing a number — it's deciding whether the number means anything. Ten tutorials on exactly that: simulate a season to see how much of a standings table is luck, bootstrap a confidence interval instead of pretending you have one, test a difference by shuffling, measure how many games that test needs before it can find anything, correct a whole screen of tests instead of cherry-picking its smallest p-value, update a belief the Bayesian way, watch extreme records regress to the mean on schedule, and finish by turning a single-game edge into exact best-of-seven odds.

Everything is built from scratch with numpy — no scipy black boxes — so when a p-value comes out, you watched it being made.

What you'll be able to do

  • Simulate seasons with Monte Carlo and read the spread honestly
  • Attach uncertainty to any stat with the bootstrap
  • Test claims with permutation and chi-square tests you wrote yourself
  • Measure a test's power by simulation and size a sample honestly
  • Correct a family of tests with Bonferroni and the false discovery rate
  • Update estimates as evidence arrives with Beta-Binomial updating
  • Shrink an extreme early record toward the mean before forecasting with it
  • Turn a single-game win probability into exact playoff-series odds
Download the course bundle - every script + dataset, one ZIP

The bundle contains each part's finished script, the shared helpers, and the sample data they read, with a README listing the run order - the whole course works offline.

The syllabus

Pace: Strictly in order - each part leans on the one before. Ten sittings.

  1. Monte Carlo: How Much Does Luck Move a Season's Record?Intermediate · ~5 minBefore trusting any standings gap, see how much a coin-flip league produces.
  2. Bootstrap a Confidence Interval: Is Home-Court Advantage Real or Luck?Intermediate · ~9 minError bars from resampling - no formula memorization required.
  3. Is the Difference Real? A Permutation TestIntermediate · ~5 minThe significance test you can explain to anyone: shuffle and count.
  4. Statistical Power: How Many Games Until You Can Trust a Stat?Intermediate · ~10 minThe question before the test: how many games until a real edge can even show up?
  5. Multiple Comparisons: What Survives a 30-Test ScreenIntermediate · ~18 minOne p-value is a finding; thirty at once is a lottery - correct the count or be fooled.
  6. Crosstabs: Build a Contingency Table to Test Home AdvantageIntermediate · ~5 minCategories cross-tabulated - the table every count-based test starts from.
  7. The Chi-Square Test from Scratch: Is an NBA Floor Left-Right Symmetric?Intermediate · ~5 minIs the imbalance real? The classic test, built by hand.
  8. Bayesian Updating: Learn a Win Probability Game by GameIntermediate · ~6 minBeliefs that update as evidence arrives - shooting percentages done properly.
  9. Regression to the Mean: Why Hot Starts Cool Off, on ScheduleIntermediate · ~12 minThe slope is not 1: why every hot start cools, and exactly how far to shrink it.
  10. Best-of-Seven Math: Why Series Favor Favorites (and by How Much)Intermediate · ~11 minThe payoff: seven games amplify a single-game edge, and now you can say by exactly how much.

Check yourself

Five questions, graded on the page, nothing recorded anywhere - pick an answer and the explanation appears.

1. A permutation test answers the question…

2. A bootstrap confidence interval comes from…

3. A chi-square test compares…

4. A Beta(a, b) prior, after observing k makes in n attempts, becomes…

5. The lasting lesson of Monte Carlo season simulations is…

Where next: Machine Learning from Scratch.