Free course · Intermediate · 6 parts · ~35 min

Randomness, Inference & Simulation

Monte Carlo seasons, bootstrap intervals, permutation tests, chi-square and Bayesian updating — 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. Six 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, and update a belief the Bayesian way.

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
  • Update estimates as evidence arrives with Beta-Binomial updating
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. Six 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. Crosstabs: Build a Contingency Table to Test Home AdvantageIntermediate · ~5 minCategories cross-tabulated - the table every count-based test starts from.
  5. 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.
  6. Bayesian Updating: Learn a Win Probability Game by GameIntermediate · ~6 minBeliefs that update as evidence arrives - shooting percentages done properly.

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.