An interactive introduction to probability and statistics

Chance,
Data, and Decisions

Start with what might happen. Observe what did. Then learn how evidence turns uncertainty into a calibrated decision.

9 chapters6 live experiments60+ exercises4 notebooks

model

simulate

observe

infer

check

The course

One uncertainty unlocks the next.

The sequence follows a single intellectual arc: outcomes become variables, variables form distributions, distributions generate samples, and samples support inference.

01

Sets · Venn diagrams · Counting

The grammar of uncertainty

Describe what can happen before trying to measure it.
02

Spaces · Events · Probability axioms

A measure of possibility

Build coherent models from outcomes and events.
03

Conditioning · Independence · Bayes

Information changes the space

Restrict, renormalize, and reverse the direction of evidence.
04

Random variables · CDFs · Moments

Numbers attached to outcomes

Compress experiments into quantities we can analyze.
05

Binomial · Poisson · Normal · Beta

A library of chance mechanisms

Recognize the recurring mechanisms behind familiar laws.
06

Joint laws · Marginals · Correlation

Variables together

See dependence as a whole surface, not a single number.
07

LLN · CLT · Sampling distributions

From repetition to regularity

Watch averages stabilize and bell curves emerge.
08

Estimation · Intervals · Tests

Learning from a sample

Turn random data into calibrated claims.
09

Prior · Likelihood · Posterior

Probability for unknowns

Update uncertainty and predict what comes next.
Designed for a first undergraduate courseTwo 75-minute meetings per week · algebra and introductory calculus
Download the complete 30-page packet

Interactive companion

Make randomness visible.

Every lab pairs a manipulable model with an interpretation question. Simulation is a microscope for assumptions—not a substitute for them.

01

Event lab

Shade the statement

Switch between words, symbols, and regions. Probability begins with getting the event right.

Read the region

A ∩ B: both events occur
ABincluded?0 · 0 no0 · 1 no1 · 0 no1 · 1 yes

Before computing, ask: are the outcomes ordered? Are they equally likely? Is the event inclusive or exclusive?

02

Bayes lab

Reverse the condition

A positive result is evidence, not a verdict. Watch the base rate reshape the answer.

true positivefalse positiveother

Among positive results

8.8%actually have the condition
10/10 + 99true positives / all positives
03

Distribution lab

Shape a probability law

Change the mechanism, then read its center and spread before looking at the graph.

mean4.20
variance2.73

Count successes in a fixed number of independent trials.

04

Dependence lab

Turn the correlation dial

Correlation captures linear alignment—not every form of dependence, and never causation by itself.

ρ

0.70moderate linear association
Zero correlation only means no linear trend. A curve can still be perfectly predictable.
05

Sampling lab

Repeat the sample, not the slogan

See the CLT reshape averages, then watch confidence intervals succeed and occasionally miss.

2,600 simulated sample means

center 1.00standard error 0.447

28 nominal 95% intervals · 27 cover μ

06

Bayesian lab

Watch evidence move a prior

Treat uncertainty about a proportion as a distribution, update it, then predict the next trial.

prior Beta(2,2)posterior Beta(10,4)
prior mean0.500
+
data8/10
posterior mean0.714

Posterior predictive chance of success on the next trial: 71.4%

Practice architecture

Calculate. Explain. Critique.

A complete assignment mixes technical fluency, mathematical reasoning, and model criticism.

01 · Fluency

Translate precisely

Move among words, events, tables, distributions, and formulas.

Example prompt
Find the CDF, then recover every point probability from its jumps.
02 · Reasoning

Justify the bridge

Derive results and identify exactly where assumptions enter.

Example prompt
Prove the weak law from Chebyshev’s inequality.
03 · Exploration

Stress-test a model

Simulate, visualize, compare, and diagnose a mismatch.

Example prompt
When does a Poisson approximation become convincing—and by which metric?

Computational companion

Four ready-to-run Python notebooks

Sets & BayesDistributionsJoint & CLTInference

The governing question

What would we expect to see if our model were true?

That question joins probability, simulation, estimation, testing, and posterior prediction. It also keeps inference honest.

P