📚 Math in Society
⇩ Download ▾

10.2 Populations and Samples

Before we begin gathering and analyzing data we need to characterize the population we are studying. If we want to study the amount of money spent on textbooks by a typical first-year college student, our population might be all first-year students at your college. Or it might be:

Sometimes the intended population is called the target population, since if we design our study badly, the collected data might not actually be representative of the intended population.

Why is it important to specify the population? We might get different answers to our question as we vary the population we are studying. First-year students at the University of Washington might take slightly more diverse courses than those at your college, and some of these courses may require less popular textbooks that cost more; or, on the other hand, the University Bookstore might have a larger pool of used textbooks, reducing the cost of these books to the students. Whichever the case (and it is likely that some combination of these and other factors are in play), the data we gather from your college will probably not be the same as that from the University of Washington. Particularly when conveying our results to others, we want to be clear about the population we are describing with our data.

If we were able to gather data on every member of our population, say the average (we will define "average" more carefully in a subsequent section) amount of money spent on textbooks by each first-year student at your college during the 2009-2010 academic year, the resulting number would be called a parameter.

We seldom see parameters, however, since surveying an entire population is usually very time-consuming and expensive, unless the population is very small or we already have the data collected.

import random, statistics

random.seed(0)          # <-- CHANGE the 0 to re-roll every sample below

# A synthetic POPULATION: what 5,000 first-year students spent on textbooks.
# In real life you never get to see this list -- that is the whole point.
population = [max(0, round(random.gauss(520, 140))) for _ in range(5000)]
parameter  = statistics.mean(population)      # uses ALL the data -> a PARAMETER

SAMPLE_SIZE = 100        # <-- CHANGE ME: try 10, then 100, then 1000
N_SURVEYS   = 10         # how many different researchers each run one survey

print("PARAMETER (the truth, from all %d students): $%.2f" % (len(population), parameter))
print()
print("Ten researchers each survey %d students at random:" % SAMPLE_SIZE)
print("%-12s %12s %12s" % ("survey", "STATISTIC", "error"))
print("-" * 38)
estimates = []
for k in range(1, N_SURVEYS + 1):
    sample = random.sample(population, SAMPLE_SIZE)
    stat   = statistics.mean(sample)
    estimates.append(stat)
    print("%-12s %11.2f %+12.2f" % ("#%d" % k, stat, stat - parameter))
print("-" * 38)
print("spread of the ten statistics: $%.2f to $%.2f  (sd %.2f)"
      % (min(estimates), max(estimates), statistics.stdev(estimates)))
print()
print("None of them is 'the answer'. Every one is an estimate of $%.2f." % parameter)
print("Re-run with SAMPLE_SIZE = 1000 and the spread shrinks by about sqrt(10) ~ 3.2x.")

You are probably familiar with two common censuses: the official government Census that attempts to count the population of the U.S. every ten years, and voting, which asks the opinion of all eligible voters in a district. The first of these demonstrates one additional problem with a census: the difficulty in finding and getting participation from everyone in a large population, which can bias, or skew, the results.

There are occasionally times when a census is appropriate, usually when the population is fairly small. For example, if the manager of Starbucks wanted to know the average number of hours her employees worked last week, she should be able to pull up payroll records or ask each employee directly.

Since surveying an entire population is often impractical, we usually select a sample to study;

We will discuss sampling methods in greater detail in a later section. For now, let us assume that samples are chosen in an appropriate manner. If we survey a sample, say 100 first-year students at your college, and find the average amount of money spent by these students on textbooks, the resulting number is called a statistic.

Adapted from Math in Society by David Lippman, hosted on LibreTexts (math.libretexts.org) and licensed under CC BY-SA 3.0. Changes were made. License: CC-BY-SA-3.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.