AI Grounds

Open AI Grounds on a desktop

These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.

Guided discovery

Sampling & Sample Size Lab

Compare estimates from repeated samples.

The ideal model selects each population record with equal probability on every independent draw, with replacement: records can repeat. These fixed toy sources use reproducible simulated samples. Population details start hidden.

Show more or fewer observations from the same prepared sample, without resampling it. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

Select another prepared sample from the same source at the same size. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

Showing sample 1 of 20, with 4 observations from Bounded values. Population records and mean are hidden until you reveal them.

20 sample estimates

Each row is one sample mean, not an individual observation. A double ring marks the selected sample. The population reference stays hidden until revealed.

SampleMean13.000023.500035.000044.500054.500064.000075.000086.000095.5000103.0000116.0000126.0000136.5000147.5000153.5000163.0000174.5000182.5000196.0000205.0000258Sample mean

Twenty observed means range from 2.5000 to 7.5000. This is a finite illustrative batch. The horizontal scale uses this source’s full value range 2–8; changing Sample size does not shrink the axis or the source.

Sample mean

Statistic from the selected observations.

3.0000

12 / 4

Population mean

Fixed source parameter, initially unknown.

Hidden

Reveal population to compare

Absolute error

Selected estimate’s distance from truth.

Hidden

|sample mean − population mean|

Sample 1: total 12 / size 4 = mean 3.0000. Population mean and error remain hidden.

Recent individual observations: 6, 2, 2, 2. This selected sample’s individual values range from 2 to 6. These are observations, not averages.

Exact means of the 20 samples
All samples use the same source and size 4; selected sample is labelled.
SampleTotalMean
1 · selected123.0000
2143.5000
3205.0000
4184.5000
5184.5000
6164.0000
7205.0000
8246.0000
9225.5000
10123.0000
11246.0000
12246.0000
13266.5000
14307.5000
15143.5000
16123.0000
17184.5000
18102.5000
19246.0000
20205.0000
Model assumptions and reproducible sampling

A population parameter describes the source; a sample statistic estimates it. The ideal independent, fixed-source, equal-record model uses replacement, so repeated values are expected and sample size can exceed the number of source records. This is not sampling without replacement or a census. All supplied sources are bounded and have finite means.

A seed-1309 deterministic 32-bit generator creates 20 nonoverlapping blocks of 1000 positions each. Sample number selects a block; Sample size reveals its prefix. Next sample chooses the next block, stopping at 20; the exact editor can revisit any prepared block. Changing source remaps those same positions. Finite pseudorandom illustrations are not proof of independence, randomness, monotone improvement or exact finite estimates.

Larger independent samples from a fixed bounded source tend to reduce mean-estimate variability. A particular sample or larger prefix can still be worse, and the original observations do not contract around their mean. Biased sampling, formal sampling distributions, standard error and confidence intervals require later lessons.

Berkeley SticiGui · Samples, statistics and populations
Berkeley SticiGui · Expected sample means