← Homepage

Sampling & Bootstrapping: Dr. Maya's quest to estimate the town's average blood pressure

October 20, 2026

Author: Daniel Jordan Viray

Population, standard deviation, samples, standard error, the Central Limit Theorem, bootstrapping, confidence intervals — one story, told short, with labs to run each step. Plain words first; formal names in brackets, like this → formal term.

Meet Dr. Maya. She wants one number: the true average systolic blood pressure of all 10,000 adults in her town — the top number in "128 over 80," in mmHg. If it's creeping up, she funds screening. Everything below answers: how can she learn that number without measuring everyone — and how much should she trust the answer?

Chapter 1

The population, its average, and its spread

The population is everybody Maya cares about: all 10,000 adults. Its true average is a parameter, written μ · "mu" — fixed, but unknown to her. The standard deviation, written σ · "sigma", measures how far a typical person sits from that average. The town's hidden truth: μ ≈ 128, σ ≈ 15. Note the histogram below leans right right skew — a minority with very high readings. Remember that shape.

Measuring everyone is impossible, so Maya measures a sample of n people, picked at random so it isn't secretly all gym members selection bias. Her sample's average is a statistic, written x̄ · "x-bar"; its spread is s. Keep two pairs straight: μ vs. x̄ and σ vs. s — true vs. measured.

Try it · Lab 1

Peek at the whole town

All 10,000 adults — a picture Maya herself could never see. That's the whole problem.

Population size · N
10,000
Every adult in town
True mean · μ
—
The parameter Maya wants
True SD · σ
—
Spread of individual people
Pin this down

σ describes how much people differ from each other. The standard error in the next chapter describes how much averages differ. Mixing those two up is the #1 confusion in this topic.

Chapter 2

The histogram of averages — and the standard error

One sample of 30 might average 124 by luck; another, 133. Imagine Maya repeats her study 1,000 times and plots every x̄: that histogram is the sampling distribution — of averages, not people. Two things about it matter:

Its center is μ itself. The mean of the sample means — the expected value — equals the true average, so x̄ is an unbiased estimator: samples miss, but high and low misses cancel.

Its spread is the standard error. Yes, your guess was right: the SD of the sample means is the standard error · SE, and there's an exact recipe:

SE = σ / √nThe standard deviation of the sampling distribution is equal to the standard error, which is equal to σ / √n — and therefore we can calculate σ, the population standard deviation.

The SE is the typical size of your error — and it turns one guess into an honest range: x̄ ± about 2·SE is a 95% confidence interval · CI. If Maya's study gives x̄ = 131, she reports roughly 126 to 136 — a method that captures the truth ~95% of the times it's used coverage.

Why is the histogram a bell? The Central Limit Theorem

The town is skewed, yet the histogram of averages is a bell. That is the Central Limit Theorem · CLT: as n grows, the sampling distribution of the mean becomes approximately normally distributed, centered at μ, with spread σ/√n — whatever shape the population has (decent by n ≈ 30 for mild skew). Averaging smooths away the weird shape; that's what licenses the ±2·SE math. At n = 1 there's no averaging, so the "sampling distribution" is just the skewed population itself.

Try it · Lab 2 — the heart of the story

Build a sampling distribution yourself

Each click repeats the whole study: n fresh adults, one average, into the histogram. Try n = 1, 30, 100 — the center never moves; only the width obeys σ/√n.

Studies run
0
Each = one fresh sample of n adults
Mean of the sample means
—
Should hover at μ ≈ 128
SD of the sample means
—
The standard error, measured
Formula · σ/√n
—
What theory predicts
Chapter 3

Handfuls vs. spoonfuls: Maya's two knobs

Stay with Maya's setup from Chapter 2: she draws a sample of n = 30 adults, records its mean x̄, then repeats the whole thing — say B = 500 times. She ends up with a list of 500 sample means, and that list is her sampling distribution. Two separate knobs built that list, and they do completely different jobs:

What Maya reads off her list of 500 means: the mean of the list is her estimate of the population mean μ — the high and low sample means cancel, so it lands near 128. The standard deviation of the list is the standard error, and she runs the formula backwards to recover the population standard deviation: σ ≈ SE × √n ≈ 2.7 × √30 ≈ 15. One list, both parameters.

The catch: σ is unknown, so she has to measure the SE — and that measurement depends on B

Keep two words straight: true vs. measured. The true standard error never changes with B. With n = 30 it's σ/√30 ≈ 2.74, whether B is 2 or 200. That's a fact about the town and n.

But if σ is unknown — Maya's real case — she doesn't get to see 2.74. She has to estimate it from the SD of her list of means empirical SD of the sampling distribution. And that estimate absolutely depends on B:

So: B doesn't change the standard error. B changes how well she can measure the standard error when σ is unknown. With B = 2 she basically doesn't know the SE at all, even though it exists.

Can she trade — smaller n, bigger B?

It depends what the B samples are for:

One-line version: n determines the uncertainty; B determines how accurately she can estimate that uncertainty from her list.

Chapter 4

Bootstrapping: your one sample plays the town

In the previous chapters, we pretended that Dr. Maya could repeatedly take many samples from the population to obtain her estimates of the population parameters. However, reality of the situation is that she only had enough resources to get one sample — the 30 patients she already measured, with x̄ = 131.

Reporting just "the town's mean blood pressure is 131" would be dishonest — she knows a different 30 patients would have given her 128, or 134, or 129. What she actually needs to report is:

"The town's mean is about 131, give or take about 5 — plausibly somewhere in 126 to 136."

That "give or take" margin of error is the whole product. Without it, the 131 is nearly useless for a decision, because she can't tell a real 131 from a lucky draw of a town that's really 124.

The problem

To know the give-or-take, she needs the sampling distribution — how much sample means bounce around. In the academic chapters, she got that by actually repeating the study 500 times.

She can't do that in real life. She has one clinic, one budget, one sample of 30. The study is over.

What bootstrapping does about it

Bootstrapping is a way to fake the 500 repeats using only her 30 patients:

That histogram imitates the real sampling distribution she can never see. From it she reads off the two things she actually needed:

That's it. That's the point. Bootstrapping exists to estimate uncertainty — SEs and confidence intervals — when you only get one sample.

The move: pretend her sample IS the population plug-in principle. Draw 30 from her 30 patients with replacement — a bootstrap resample can contain Mrs. Chen three times and skip Mr. Diaz (without replacement you'd get the same 30 every time: zero wobble, useless). Compute the mean, repeat 1,000 times. That histogram is the bootstrap distribution; its SD is the bootstrap standard error; its middle 95% is a bootstrap confidence interval.

How the two distributions relate — same movie, two towns

Sampling distributionBootstrap distribution
Drawn fromThe real town (10,000)Your one sample (30), treated as the town
Centered atμ, the true parameterx̄, your statistic
Its SD isThe true standard errorAn estimate of that standard error
Buildable?Almost neverYes — tonight, on your laptop

It works when your sample resembles the town. It cannot fix a bad sample — all gym members in, and the bootstrap precisely estimates the wrong thing.

Try it · Lab 3

Run Maya's actual study — then bootstrap it

Step 1: her ONE real sample. Step 2: bootstrap it. Step 3: peek at μ and grade her. Re-run: the interval should catch μ ~95% of the time.

Her sample mean · x̄
—
Her one real result
Bootstrap SE
—
Compare with s/√n ≈ —
Bootstrap 95% CI
—
Middle 95% of the bootstrap histogram
Did the CI catch μ?
—
A 95% procedure misses ~1 time in 20
Chapter 5

Two ways to compute the interval: quantiles vs. the inverse CDF

One thing bootstrapping can't do: estimate the population mean itself. Every resample is drawn from her 30 patients, whose average is 131, so the bootstrap means are centered on 131 and their average just hands her own x̄ back — the estimate of μ was always the sample mean, and no amount of resampling improves it. Bootstrapping measures how much that estimate wobbles; it never moves it.

So the one number still missing is the interval itself — the middle 95%. Chapter 2's interval was "x̄ ± 2·SE"; Chapter 4's, "the middle 95% of the histogram." Those are the two standard ways to compute a CI — both answering: where do I cut so the middle 95% stays and 2.5% falls off each end? Lab 4 below runs both on the same distribution so you can watch them agree — and, at small n, disagree.

A quantile is a cut point read off a sorted list: the 0.025 quantile has 2.5% of values at or below it (out of 100, a percentile). A cumulative distribution function · CDF · F(x) answers "what fraction is ≤ x?" The inverse CDF · quantile function · ppf · F⁻¹(p) runs it backwards: "give me the fraction p, I'll give you the x." So a quantile and an inverse-CDF value are the same thing — one read off a list, one computed from a formula.

Method 1 — Quantile (empirical) percentile method

Cuts come from your actual histogram: sort your 1,000 means, read off the 2.5th and 97.5th percentiles — numpy.quantile(means, [0.025, 0.975]). No shape assumption: lopsided histogram, lopsided cuts.

Method 2 — Inverse CDF (theoretical)

Cuts come from an ideal bell: assume the CLT bell (center = your estimate, spread = SE) and ask its inverse CDF — the cuts sit at ±1.96 SEs. Interval: estimate ± 1.96 · SE, where 1.96 is the critical value norm.ppf(0.975).

Why it matters

With a clean bell and large B, both methods give nearly the same interval — Lab 4 proves it. The value is the disagreement: diverging cuts mean the shape isn't the assumed bell (skew, heavy tails, n too small) — trust the quantile version, or swap the normal for a t distribution for a wider interval. Either way, "95%" describes the procedure: ~95% of intervals from repeated studies catch μ.

Try it · Lab 4

Same histogram, both rulers — agree, then disagree

One sampling distribution (2,000 studies), both intervals from it. Below: the CDF S-curve, read backwards at p = 0.025 and 0.975. Run n = 30, then n = 3, and watch the gap grow.

Quantile interval
—
Read off the sorted pile [empirical]
Inverse-CDF interval
—
Center ± ppf × SE: —
How far apart?
—
Biggest cut-point difference, mmHg
Did each catch μ?
—
μ ≈ 128