Select Page

4.5 Probability sampling methods: Sampling with and without Replacement


Simple random sampling from a large pool of records can be done with replacement or without replacement.  When sampling is performed with replacement, it means that a single item could be randomly selected more than once in a single sample.  When sampling is performed without replacement, this means that once some particular record has been selected, it cannot be selected again.

Flipping a coin may be seen as an example of sampling with replacement.  The coin is flipped, and the result is either heads or tails.  Since the entire coin remains intact even after that flip, any subsequent flips could also result in either heads or tails.

In Python, sampling with replacement can be done using the random.choices() function.

In the example above, the numbers 1 and 4 appear twice in the list of randomly selected numbers because 1 and 4 were not removed from the ‘bag’ after being chosen the first time.

Simple random sampling without replacement would occur if a Professor decided that he needed to choose five students to run a simulation.  In order to select five students randomly, he places the names of each of the 45 members of the class in a hat, closes his eyes, and then begins selecting the names, one-by-one.  After the first selection, 44 names remain.  After the second selection, 43 remain, and so on.  As long as the names are not placed back into the hat after the selections, this is sampling without replacement.  

In Python, sampling without replacement can be done using the random.sample() function.

Most surveys are done without replacement because it is more convenient and gives more precise results. That means after a respondent has participated in a survey, that person will not be included in another survey for the same study.