Sampling Distributions and Simulation
If you and a friend each survey a different random sample of students, you’ll almost certainly get different answers. That’s not a mistake; it’s sampling variability, and it’s the reason statistics needs probability. A sampling distribution describes exactly how much a statistic varies from sample to sample, and you can build one just by simulating. This idea sits under every confidence interval and significance test in AP Statistics.
Key ideas
Section titled “Key ideas”Statistics vary; parameters don’t
Section titled “Statistics vary; parameters don’t”A parameter (like the population proportion or mean ) is a fixed number describing a population. A statistic (like or ) is calculated from a sample, and its value changes from one random sample to the next.
Three different distributions
Section titled “Three different distributions”It’s easy to mix these up:
| Distribution | What it shows | Example (sleep of all students at a school) |
|---|---|---|
| Population distribution | the values of the variable for every individual in the population | every student’s hours of sleep |
| Distribution of sample data | the values for the individuals in one sample | the students you surveyed |
| Sampling distribution of a statistic | the values of the statistic for all possible samples of the same size | the values from every possible sample of students |
The sampling distribution is about the statistic, not about individuals. Its centre tells you whether the statistic is biased; its spread tells you how variable the statistic is.
Simulating a sampling distribution
Section titled “Simulating a sampling distribution”You can’t usually list every possible sample, but you can approximate the sampling distribution by simulation:
- Assume a value for the parameter (for example, ).
- Use a random mechanism (a random number generator, cards, spinners) to generate a random sample of size from that population, and calculate the statistic.
- Repeat many times (hundreds or thousands) and record each value.
- Graph the values. Their distribution approximates the sampling distribution.
Using a simulation to judge a claim
Section titled “Using a simulation to judge a claim”To decide whether an observed result is surprising under some assumption, simulate assuming it’s true, and find the proportion of simulated values at least as extreme as the observed one. A small proportion means the result would rarely happen by chance if the assumption were true, which is evidence against the assumption. This proportion is an estimated p-value; it’s how significance tests work.
Randomization distributions
Section titled “Randomization distributions”In an experiment, a slightly different simulation asks: “could the random assignment alone produce a difference this big?”
- Assume the treatment has no effect, so each unit’s response would be the same whichever group it was in.
- Reshuffle: randomly reassign the observed responses to the treatment groups (same group sizes), and calculate the statistic (for example, the difference in means or proportions).
- Repeat many times.
The distribution of the reshuffled statistics is a randomization distribution. It approximates the sampling distribution of the statistic if the treatment has no effect.
The central limit theorem
Section titled “The central limit theorem”For the sample mean from a random sample of size , from a population with mean and standard deviation :
And the shape:
- If the population is normal, the sampling distribution of is normal for any .
- The central limit theorem (CLT): even if the population isn’t normal, the sampling distribution of is approximately normal when is large. The larger is, the better the approximation. AP Statistics uses as the guideline; a very skewed population may need more.
The CLT is about the sampling distribution of , not about the data. A large sample from a skewed population still looks skewed; it’s the distribution of the sample means that becomes normal. (The central limit theorem page has more examples.)
On the AP exam
Section titled “On the AP exam”Know which distribution a question is about (population, one sample, or sampling distribution). When you use a simulation, explain how it was carried out and how the result answers the question: “In the simulation, of samples had , so…”. When you use a normal model for , justify it (population normal, or by the CLT).
Worked examples
Section titled “Worked examples”Example 1: Which distribution?
Section titled “Example 1: Which distribution?”A researcher measures the time (in minutes) that each of randomly chosen customers waits at a bank. Identify the population distribution, the distribution of the sample data, and the sampling distribution of .
Solution.
- Population distribution: the wait times of all the bank’s customers.
- Distribution of sample data: the wait times the researcher recorded.
- Sampling distribution of : the mean wait times from all possible random samples of customers.
Example 2: Describing a simulated sampling distribution
Section titled “Example 2: Describing a simulated sampling distribution”The histogram above shows simulated values of for random samples of students, assuming of all students bike to school.
- (a) Describe the simulated sampling distribution.
- (b) Compare its centre and spread with the formulas from the sampling distribution of p̂.
Solution.
(a) Shape: roughly symmetric and unimodal (slightly skewed right). Centre: mean , close to . Variability: standard deviation ; most values are between about and .
(b) The formulas give and . The simulation’s mean () and standard deviation () are very close, as expected: simulation and theory describe the same sampling distribution.
Example 3: Using the simulation to judge a claim
Section titled “Example 3: Using the simulation to judge a claim”A city report says of students at a large high school bike to school. A student surveys a random sample of students and finds that bike, so . Use the simulation above to decide whether this is convincing evidence that more than of the school’s students bike.
Solution. In the simulation, which assumed , of the simulated values of were or more. So if of students really bike, a sample proportion of or more would happen in about
of random samples of , roughly sample in . That’s somewhat unusual but not very rare. It gives some evidence that more than bike, but it isn’t strong: the simulated estimate, , is just above the usual standard. The exact binomial probability, , is just below it. The two land on either side of because the simulation only estimates the probability, so the honest conclusion is that this result is right at the borderline.
Example 4: Using the CLT
Section titled “Example 4: Using the CLT”Wait times at a busy clinic are strongly skewed right, with mean minutes and standard deviation minutes.
- (a) Find the mean and standard deviation of for random samples of patients.
- (b) Find the probability that the mean wait for a random sample of patients is more than minutes.
- (c) Could you use the same method for a random sample of patients? Explain.
Solution.
(a)
(b) The population is skewed, but , so by the CLT is approximately normal.
About of samples of patients would have a mean wait over minutes.
(c) No. With from a strongly skewed population, the sampling distribution of is still noticeably skewed right (see the middle panel above), so a normal calculation could be quite inaccurate.
Common mistakes
Section titled “Common mistakes”Confusing the sampling distribution with the sample’s data. A histogram of one sample’s values is the distribution of the sample data. The sampling distribution is made of statistics, one from each of many samples.
Thinking a large sample makes the data normal. The CLT says the distribution of becomes approximately normal. The individual values in a big sample still follow the population’s shape.
Using σ instead of σ/√n. For a probability about one individual, use . For a probability about the mean of a sample, use .
Treating a simulated proportion as exact. A simulation estimates a probability. A different set of repetitions would give a slightly different answer; more repetitions give a better estimate.
Simulating under the wrong assumption. To judge a claim, simulate assuming the claim (or “no effect”) is true, not using the observed sample result.
Forgetting what “as extreme” means. Count simulated values at least as far from the assumed value as the observed one, in the direction that matters ( for “more than”, both tails for “different from”).
Practice
Section titled “Practice”1. (Warm-up) A teacher records the number of hours of sleep for each of randomly chosen students at her school. For each description, say whether it is the population distribution, the distribution of sample data, or the sampling distribution of .
- (a) A dotplot of the students’ hours of sleep.
- (b) The hours of sleep of all students at the school.
- (c) The mean hours of sleep from every possible sample of students.
Solution
(a) Distribution of sample data. (b) Population distribution. (c) Sampling distribution of .
2. (Warm-up) In the simulation on this page ( samples of , ), simulated values of were or less. Estimate when and .
Solution
3. (Warm-up) A population has mean and standard deviation . Find and for random samples of and .
Solution
For both, . For : . For : . Four times the sample size halves the standard deviation.
4. (Core) Describe how to use a random number generator to simulate one sample of students from a population in which bike to school, and how to use it to build a simulated sampling distribution of .
Solution
For each of the students, generate a random integer from to : let , , represent “bikes” (probability ) and to represent “doesn’t bike”. Count how many of the are , , or , and divide by to get . Repeat this many times (say ), recording each time, and make a histogram or dotplot of the values.
5. (Core) The masses of bags of flour from a machine are approximately normal with mean g and standard deviation g. An inspector weighs random samples of bags.
- (a) Find the probability that a single bag weighs less than g.
- (b) Find the probability that the mean of a sample of bags is less than g.
- (c) Explain why the answers are so different.
Solution
(a) .
(b) , and is normal (the population is normal):
(c) Sample means vary much less than individual bags: a single light bag is common, but a whole sample of averaging that light is unusual.
6. (Core) For the clinic in Example 4 (skewed right, , ), a student uses a normal model to find the probability that the mean wait of a random sample of patients is more than minutes, and gets . Is the normal model appropriate? Explain.
Solution
No. The population is strongly skewed and is far below , so the CLT doesn’t guarantee that is approximately normal; its sampling distribution is still skewed right. (If the wait times follow an exponential model like the one in the figure, the exact probability is about , so the normal answer of is noticeably off.)
7. (Core) A class does an experiment: students study with flashcards and study by rereading, and the flashcard group’s mean score is points higher. The class reshuffles the scores into two groups of many times, recording the difference in means each time.
- (a) What assumption does the reshuffling make?
- (b) In reshuffles, differences were or more. What does this suggest?
Solution
(a) That the study method has no effect: each student would have got the same score with either method, so any difference between the groups is due only to which students happened to be assigned to which group.
(b) If the method made no difference, a difference of or more would happen in only about of random assignments. That’s unusual, so it’s evidence that flashcards really do lead to higher scores for students like these.
8. (Challenge) Two methods of estimating a population mean are simulated. Method A’s simulated estimates have mean and standard deviation . Method B’s have mean and standard deviation .
- (a) Which method appears unbiased?
- (b) Which method would you choose, and why? Could a different sample size change your answer?
Solution
(a) Method A: its estimates are centred at about . Method B underestimates by about on average.
(b) There’s a trade-off: A is unbiased but has a lot of variability; B is biased but much more consistent. With A, estimates are typically about from ; with B, typically within about of , so about off. B is often closer. But a larger sample would reduce A’s variability (its standard deviation shrinks as grows) while B’s bias wouldn’t go away, so with enough data A becomes clearly better.
9. (Challenge) A population is strongly skewed right with mean and standard deviation . A random sample of is taken.
- (a) Find the probability that .
- (b) A friend says: “The population is skewed, so you can’t use a normal model.” Respond.
Solution
(a) . By the CLT (), is approximately normal:
(b) The normal model is for the sampling distribution of , not for the population. With , the CLT says is approximately normal even though the individual values are skewed.
Homework
Section titled “Homework”Try these independently after the practice questions. Explain how each simulation is carried out and what it shows, in context. Homework solutions are not provided on the published site.
All data in these questions are hypothetical.
Foundations
Section titled “Foundations”H1. (Foundations) A coach records the m times of randomly selected swimmers in a provincial club. Describe, in context, the population distribution, the distribution of the sample data, and the sampling distribution of the sample mean time.
H2. (Foundations) A population has mean and standard deviation . Find the mean and standard deviation of for random samples of size .
H3. (Core) For the population in H2, assume the population is normal. Find the probability that the mean of a random sample of is greater than .
H4. (Core) A game company claims that of its mystery boxes contain a rare item. A player opens boxes and finds rare items. She simulates sets of boxes, assuming the claim is true, and finds that of the simulated sets had or more rare items.
- (a) Explain how she could carry out one repetition of the simulation.
- (b) What does the simulation suggest about the company’s claim?
H5. (Core) In a simulation of sample proportions from a population with , one student uses samples of and another uses samples of . Predict the centre and standard deviation of each simulated distribution, and explain how the two histograms will look different.
H6. (Core) The weights of apples in an orchard are skewed left with mean g and standard deviation g.
- (a) Can you find the probability that a randomly chosen apple weighs more than g using a normal model? Explain.
- (b) Find the probability that the mean weight of a random sample of apples is more than g.
Challenge
Section titled “Challenge”H7. (Challenge) Explain the difference between “the sample is large, so the data are approximately normal” and “the sample is large, so the sampling distribution of is approximately normal”. Which is what the central limit theorem says?
H8. (Challenge) A simulation of for samples of size from a population with produces values with standard deviation about . Estimate . Then explain how the simulated distribution would change if were made four times as large.
H9. (Challenge) Two students simulate the sampling distribution of for and . One uses repetitions and the other uses . Explain which features of the two histograms should be similar and which should differ. Does increasing the number of repetitions make less variable?
H10. (Challenge) In an experiment, volunteers are randomly split into two groups of . In the treatment group, improve; in the control group, improve.
- (a) Describe how to build a randomization distribution for the difference in the number who improve.
- (b) In reshuffles, gave or more improvers in the treatment group. Estimate the p-value and write a conclusion at .
- (c) Why might a larger experiment be worthwhile here?