A population is the entire group of individuals about whom you want to draw conclusions. In contrast, a sample is the subset of the same entire group.
Example 1 of sample and population
You would like to study if students like online courses at your university. Suppose your university has 10K students; thus, these 10K students are the population.
If you randomly choose 200 students, out of the 10K students, these 200 students are the sample.
Example 2 of sample and population
Suppose that a Math course has 11 students. If you want to see how these students perform in a Math exam, these 11 students are the population.
If you randomly select 5 of them to calculate the mean (instead of all 11 of them), these 5 students are the sample.
Why use samples, instead of populations?
A sample can be used to make inferences about the population. There are a few reasons we choose to use a sample rather than the whole population.
1. Save time
Surveying or measuring everyone in a population can be time-consuming. For instance, in the first example, if a researcher chooses to survey the whole population of all 10K students about their opinions, it will take a lot of time. Thus, sampling can help save researchers time by using a sample to infer the population.
2. Save money
Using a sample rather than the whole population in data collection can help save money in a lot of situations. It makes sense that the number of people/objects a researcher contacts/measures is directly related to the cost of a study.
3. Unfeasible situations
Samples can help deal with situations where collecting data from the whole population is unfeasible or practically impossible. For instance, if a biologist wants to understand the average tree height in the Amazon forest, it would be unfeasible for the biologist to measure every tree in Amazon.