How to use Sampling & Bootstrap — CLT Explorer (with steps) effectively
What this calculator does
Simulate samples from common distributions, inspect the sampling distribution of the mean, and compare bootstrap percentile, t, and normal confidence intervals. The fixed seed makes each run reproducible for lessons and review.
Input meaning
Choose the population distribution first, then set sample size, number of bootstrap resamples, statistic, and seed. Larger samples and more resamples usually stabilize the display, but they also take more browser work and can hide the effect of small-sample variation.
Use-case sequence
Start with a small sample and a fixed seed so students can reproduce the same dots, histogram, and interval. Change only sample size or resample count next, then compare how the sampling distribution and interval width move.
Common mistakes to avoid
- Comparing two runs after changing the distribution and sample size at the same time.
- Treating one bootstrap interval as proof that the true parameter is inside it.
- Using too few resamples and over-reading noisy percentile endpoints.
- Forgetting that CLT behavior depends on sample size and the population shape.
Interpretation guidance
Use bootstrap intervals to discuss resampling uncertainty and the CLT view to discuss how sample means become more regular. Keep the seed in shared URLs when you need classmates or reviewers to see the same simulated sample.
Controls
Results summary
- Point estimate
- —
- Sample mean
- —
- Sample median
- —
- Sample standard deviation
- —
- n / B
- — / —
- Theoretical mean / σ
- — / —
-
Bootstrap percentile
—
-
t approximation (mean)
—
-
Normal approximation (proportion)
—
How it's calculated
- Initialise the LCG (a=1664525, c=1013904223, m = 2^32) with seed so the sampling stream is reproducible.
- Draw n= observations from and evaluate the selected statistic .
- Resample B= times, take Type-1 quantiles, and report the chosen intervals ().
- For the CLT explorer, use seed with K= standardised sample means, summarised as mean/variance ≈ .
Histograms
Bootstrap distribution
Shows the sampling distribution of the statistic across bootstrap replicates and highlights the CI span.
CLT standardised means
Overlaying N(0,1) reveals how quickly the empirical mean and variance approach 0 and 1 respectively.
FAQ
Why use the Type-1 percentile?
It uses floor((B−1)p) order statistics so the interval endpoints are transparent to students, mirroring textbook bootstrap explanations.
What benefits does the fixed LCG bring?
The same parameters as our probability simulator (a=1664525, c=1013904223, m = 2^32) guarantee identical samples for a given seed, which is ideal for lesson plans, handouts, and remote verification.
How many bootstrap resamples should I use?
Use a smaller B value while teaching or exploring, then increase B when you want smoother interval endpoints. More resamples reduce simulation noise but do not fix a poor sample or a mismatched model.
How is bootstrap different from the CLT view?
Bootstrap resamples the observed data to approximate uncertainty around a statistic. The CLT view shows how sample means behave across repeated samples from a population model as sample size grows.
Can I reproduce the same random sample later?
Yes. The fixed LCG and seed make the simulated draws repeatable. Keep the seed and settings in the shared URL when you need the same histogram, interval, and step list for a class or review.