Contents/ Part X · Sampling & Data Collection/ Chapter 63

Probability Sampling Methods

When every unit has a known, non-zero chance of selection, the sample is representative and its error is calculable. Four workhorse methods, simple random, stratified, cluster, and systematic, trade precision against cost in different ways.

⏱️ ~16 min read
🐍 Notebook included
📊 Chapter 63

Why We Sample argued that representativeness is everything. Probability sampling is how you guarantee it: give every unit a known, non-zero chance of selection, and chance, not convenience or judgment, decides who is in.

P(in) > 0
In probability sampling every unit has a known, non-zero probability of being chosen. That single property makes the sample representative on average and lets you quantify the sampling error. Methods differ in how they assign those probabilities.
🎲
Four methods, one population

The notebook runs all four on the same 100,000-person population (mean income $55,862) at the same sample size n = 500, so their precision is directly comparable. Each is unbiased; what differs is the spread.

1

Simple Random Sampling (SRS)

The purest method: every possible sample of size n is equally likely, like drawing names from a hat. SRS is unbiased and is the benchmark every other method is measured against.

SRS: every unit has the same chance, P = n/N selected at random (rose), no pattern SE = $789 unbiased · the baseline all other methods judged against this

In the notebook, 2,000 SRS samples of 500 people center exactly on the true mean, with a standard error of $789. SRS needs a complete list of the population (a sampling frame) and can be costly to reach scattered units, the practical motivation for the methods that follow.

2

Stratified Sampling

Divide the population into strata, internally similar groups (regions, age bands, customer tiers), and sample each one separately, usually in proportion to its size. Because each stratum is homogeneous, the between-group differences stop adding noise, and precision jumps.

Sample every stratum in proportion, then combine North · 40% South · 30% East · 20% West · 10% each region contributes its fair share STANDARD ERROR (n = 500) SRS $789 Stratified $400 74% less variance, same n

The numbers are striking: stratified sampling cuts the standard error from $789 to $400, a 74% reduction in variance, simply by guaranteeing each region appears in the right proportion. Stratified sampling never does worse than SRS, and the more the strata differ, the larger the gain. The cost is that you must know the strata in advance.

3

Cluster Sampling

When reaching scattered individuals is expensive, cluster sampling picks a few whole groups, city blocks, schools, clinics, and surveys everyone inside them. It is cheap to run, but it pays in precision.

Pick a few whole clusters, survey everyone in them chosen chosen two whole clusters surveyed in full SE = $7,847 ~10× noisier than SRS at the same n cheap to reach, but similar within a cluster

With the same 500 units, cluster sampling's standard error balloons to $7,847, roughly ten times SRS. The reason: people in one cluster resemble each other, so 100 neighbors carry far less information than 100 independent draws. You accept cluster sampling when the cost savings outweigh the precision loss, and you often recover some precision by sampling more clusters with fewer units each.

4

Systematic Sampling & the Periodicity Trap

Systematic sampling takes every k-th unit after a random start (k = N/n). It is simple to administer, every 200th customer, and on a randomly ordered list it behaves just like SRS. The danger is a hidden cycle.

Every k-th unit: fine on a shuffled list, dangerous on a cycle random order: every k-th ≈ SRS (SE $794) periodic list: step lands on the same value every time all picks share one value → estimate $30,000 vs true $60,000

On a shuffled list the notebook's systematic estimate has a standard error of $794, essentially identical to SRS. But on a list that cycles with period k, every selected unit shares the same value and the estimate collapses to $30,000 against a true $60,000. The fix is simple: shuffle the list, or check it for periodic structure (seasonal data, alternating records) before stepping through it.

5

Probability Sampling in Machine Learning & AI

These methods are everyday tools in machine learning, usually under different names. Splitting data, balancing classes, and cross-validation are all probability sampling in disguise.

Method (this chapter)In ML / AI it becomesWhy it helps
Simple random samplingRandom train / test splitan unbiased estimate of generalization
Stratified samplingStratified split & stratified k-foldkeeps class proportions in every fold, lower-variance metrics
Proportional allocationClass-balanced batchesrare classes still appear each batch
Cluster samplingGroup-aware splits (GroupKFold)keeps related rows (same user) together to avoid leakage
Systematic samplingStrided sampling of streams / logscheap subsampling, watch for periodicity
🤖
Why this matters for AI research

The single most common split, train_test_split, is SRS, and its stratify= option is stratified sampling, indispensable when a class is rare so every fold keeps the same balance. Reducing evaluation variance with stratified k-fold is exactly the stratification win from section 2. The cluster idea returns as group-aware splitting: if many rows belong to the same user, splitting them randomly leaks information across train and test, so you sample whole groups instead. And the periodicity trap reappears whenever you subsample time-ordered logs with a fixed stride. The vocabulary changes; the principles do not.

🐍

Run all four methods in Python

The companion notebook builds a 100,000-person stratified population, then runs simple random, stratified, cluster, and systematic sampling 2,000 times each, comparing their standard errors and reproducing the periodicity trap, all at the same sample size.

📓 View Notebook (code & outputs) ▶ Open in Colab ⬇ View / Download on GitHub

View opens the rendered notebook instantly (no setup). Open in Colab runs & edits it live in your browser. To run locally, install numpy, pandas, and matplotlib and launch jupyter notebook.

🎓 Key Takeaways

  • Probability sampling gives every unit a known, non-zero chance of selection, making the sample representative and the error calculable.
  • SRS is the unbiased benchmark (SE $789 here); it needs a full sampling frame.
  • Stratified sampling cut the SE to $400 (74% less variance) by representing each group in proportion; it never beats worse than SRS.
  • Cluster sampling is cheap but noisy (SE $7,847) because units within a cluster are alike.
  • Systematic sampling matches SRS on a shuffled list but fails on a periodic one; in ML these are train/test splits, stratified k-fold, and group-aware splits.
6

Practice Challenges

Five short challenges, beginner to intermediate. Try them with NumPy before checking the solutions.

1

SRS is unbiased

Draw 3,000 simple random samples of size 200 from a two-stratum population and confirm the average estimate equals the true mean.

Hint: average the sample means; they should center on the truth.
2

Stratified beats SRS

Draw stratified samples (proportional allocation, n = 200) and compare the standard error to SRS.

Hint: when strata means differ, the variance cut is large.
3

The cluster penalty

Split the sorted population into homogeneous clusters of 100, sample two clusters, and show the SE exceeds SRS at the same n.

Hint: similar units inside a cluster carry less information.
4

The periodicity trap

Build a list whose values repeat with period k and show systematic sampling (every k-th) returns a biased estimate.

Hint: each pass lands on one repeated value.
5

Proportional allocation

Verify that proportional allocation samples each stratum in proportion to its share of the population.

Hint: a stratum that is 60% of N gets 60% of the sample.
Check your work

A fully-worked solutions notebook walks through all five challenges, each verified in code. Try them yourself first, then compare.

📓 View Solutions ▶ Open Solutions in Colab ⬇ View / Download on GitHub
7

Quiz: Test Yourself

Eight quick questions on probability sampling. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved, so you can hop back to the chapter and return anytime.

🧭
Up next

These methods all rely on known selection probabilities. The Non-Probability Sampling Methods chapter turns to convenience, voluntary, quota, and snowball sampling, which are cheaper and common, but sacrifice the very property that makes error calculable.