Unit 4, lesson 20

Counting and Sampling Without Replacement

How the multiplication principle, factorials, permutations and combinations count samples, when a ratio of counts is a probability, and how sampling without replacement differs from sampling with replacement.

  • Video 20
  • Events, Conditioning and Counting

A batch of 8 distinct items contains 3 marked ones, and an inspector draws 3 items at random without putting any back. What is the chance that exactly 2 of the 3 are marked? Answering by counting needs two decisions first, whether the order of the draws is part of an outcome and whether the outcomes being counted are equally likely. This lesson builds the counting rules for ordered and unordered selections, finds that chance exactly, and shows why drawing without replacement gives a different model from drawing with replacement.

Key terms

Multiplication principle

Definition Suppose a procedure is carried out in kk stages. Stage 1 has n1n_1 possible results, and for each j=2,…,kj = 2, \dots, k, stage jj has exactly njn_j possible results whatever happened at the earlier stages. Then the number of different sequences of results for the whole procedure is

n1 n2⋯nk.n_1 \, n_2 \cdots n_k .

The options available at a stage may depend on the earlier results, as long as their number does not.

In plain words Count the options at each step and multiply. A tree diagram shows why, since every branch at one level splits into the same number of branches at the next level.

Example Draw 3 items one at a time from the batch of 8 distinct items without returning them. The first draw has 8 options, the second has 7 whichever item came first, and the third has 6, so there are 8⋅7⋅6=3368 \cdot 7 \cdot 6 = 336 ordered outcomes, each a list of the first, second and third item drawn. If each item is returned before the next draw, every stage has 8 options and there are 83=5128^3 = 512 ordered outcomes, including repeats such as the same item drawn three times.

Factorial

Definition For a positive integer nn, the factorial of nn is

n!=n(n−1)⋯2⋅1,n! = n(n - 1) \cdots 2 \cdot 1,

and by definition 0!=10! = 1. Factorials are used here only for nonnegative integers. By the multiplication principle, n!n! is the number of ways to arrange nn distinct objects in a row. The value 0!=10! = 1 counts the single arrangement of no objects, the empty one. It also keeps the rule n!=n⋅(n−1)!n! = n \cdot (n - 1)! true for n=1n = 1, and it lets the counting formulas below work when no objects are left over.

In plain words A factorial counts the orders of a group of distinct objects. Dividing one factorial by a smaller one cancels the common factors and leaves a shorter product.

Example Three items A, B and C have 3!=63! = 6 orders, namely ABC, ACB, BAC, BCA, CAB and CBA. For the batch, 8!=40,3208! = 40{,}320 and 5!=1205! = 120, and the common factors cancel in

8!5!=8⋅7⋅6=336,\frac{8!}{5!} = 8 \cdot 7 \cdot 6 = 336,

the number of ordered draws of 3 items from 8.

Permutation

Definition For integers nn and kk with 0≤k≤n0 \le k \le n, a permutation of kk objects from nn distinct objects is an ordered list of kk of the objects with no object repeated. By the multiplication principle the number of such lists is

n(n−1)⋯(n−k+1)=n!(n−k)!.\begin{aligned} &n(n - 1) \cdots (n - k + 1) \\[0.4em] &\quad = \frac{n!}{(n - k)!} . \end{aligned}

The product has kk factors. For k=nk = n the formula gives n!/0!=n!n!/0! = n!, the arrangements of all the objects, which is where 0!=10! = 1 is needed. For k=0k = 0 it gives 11, the empty list. Two lists with the same objects in different orders are different permutations.

In plain words A permutation is a selection in which positions matter, such as first, second and third place, or the order in which items come off a line.

Example The 336 ordered draws of 3 items from 8 are permutations. The list (item 2, item 7, item 5) and the list (item 5, item 2, item 7) contain the same items but are two different ordered outcomes. Choosing a president, a secretary and a treasurer, three different people, from a club of 8 members also has 8!/5!=3368!/5! = 336 possible results, because the three roles can be told apart.

Combination

Definition For integers nn and kk with 0≤k≤n0 \le k \le n, a combination of kk objects from nn distinct objects is an unordered selection of kk different objects, that is, a subset with kk elements. The number of combinations is the binomial coefficient

(nk)=n!k! (n−k)!.\binom{n}{k} = \frac{n!}{k!\,(n - k)!} .

The formula holds because each subset of size kk appears exactly k!k! times among the n!/(n−k)!n!/(n - k)! permutations, once for each of its orders. In particular (n0)=(nn)=1\binom{n}{0} = \binom{n}{n} = 1, which again relies on 0!=10! = 1.

In plain words A combination records which objects were chosen and ignores the order in which they arrived. Counting ordered lists and dividing by the number of orders of each group gives the number of groups.

Example Each set of 3 items from the batch appears 3!=63! = 6 times among the 336 ordered draws, so there are 336/6=56=(83)336 / 6 = 56 = \binom{8}{3} possible samples. To count the samples with exactly 2 marked items, choose 2 of the 3 marked items and 1 of the 5 unmarked ones. Every marked pair can go with every unmarked item, so the multiplication principle gives

(32)(51)=3⋅5=15\binom{3}{2}\binom{5}{1} = 3 \cdot 5 = 15

samples. Listing all 56 subsets confirms that 10 contain no marked item, 30 contain one, 15 contain two and 1 contains all three.

Equally likely outcomes

Definition Suppose a sample space Ω\Omega is finite and every outcome in it has the same probability 1/∣Ω∣1/\lvert \Omega \rvert, where ∣Ω∣\lvert \Omega \rvert is the number of outcomes. Then every event A⊆ΩA \subseteq \Omega has probability

P(A)=∣A∣∣Ω∣.P(A) = \frac{\lvert A \rvert}{\lvert \Omega \rvert} .

Equal likelihood is a property of the selection mechanism and of how the outcomes are described, not of the counting. A simple random sample of size nn from NN distinct objects gives every one of the (Nn)\binom{N}{n} subsets the same probability. Drawing one object at a time, each uniformly from those still available, gives every one of the N!/(N−n)!N!/(N - n)! ordered lists the same probability and produces a simple random sample. The favorable count and the total count must describe outcomes at the same level.

In plain words Dividing a favorable count by a total count is justified when the things being counted are equally likely, and without that condition the ratio has no reason to be the probability. Uniform draws without replacement can be described by ordered lists or by subsets, and in both descriptions the outcomes are equally likely. The possible values of a summary, such as the number of marked items, need not be equally likely.

Example Let AA be the event that exactly 2 of the 3 sampled items are marked. All 56 subsets of the batch are equally likely, so

P(A)=1556≈0.2679.P(A) = \frac{15}{56} \approx 0.2679 .

Counting ordered lists gives the same answer, since each of the 15 favorable subsets has 6 orders and 90/336=15/5690/336 = 15/56. The number of marked items in the sample can be 0, 1, 2 or 3, but these four values have probabilities 10/5610/56, 30/5630/56, 15/5615/56 and 1/561/56. Answering 1/41/4 because one of four possible values is favorable would be wrong. If the items are picked by convenience, so that some subsets have no chance of being chosen, nothing supports the ratio 15/5615/56.

Sampling with and without replacement

Definition In sampling with replacement, each drawn object is returned before the next draw, so every draw is made from the full population and an object can appear more than once. In sampling without replacement, a drawn object is set aside, so a sample of size nn from a finite population of NN objects contains nn different objects and requires n≤Nn \le N. The ratio n/Nn/N is the sampling fraction. Uniform draws with replacement are independent. Successive draws without replacement are dependent, because each draw removes an object and changes what the next draw can produce. If the population contains KK marked objects and a sample of size nn is drawn uniformly without replacement, the chance that it contains exactly kk marked objects is

(Kk)(N−Kn−k)(Nn)\frac{\binom{K}{k}\binom{N - K}{n - k}}{\binom{N}{n}}

for integers kk with 0≤k≤K0 \le k \le K and 0≤n−k≤N−K0 \le n - k \le N - K. This is hypergeometric counting. With replacement, the count of marked objects follows a binomial model with success probability K/NK/N on every draw instead.

In plain words Replacement resets the population before every draw. Without replacement the population shrinks, and when it holds both marked and unmarked objects its mix changes with every draw, so later chances depend on earlier results. The two models agree for a single draw, and their probabilities are close when the sampling fraction is small, but for a sample of 3 from 8 they differ.

Example Let MjM_j be the event that draw jj is marked. Without replacement the first draw is marked with probability 3/83/8, and the chance for the second draw depends on the result of the first,

P(M2∣M1)=27,P(M2∣M1c)=37.\begin{gathered} P(M_2 \mid M_1) = \frac{2}{7}, \\[0.4em] P(M_2 \mid M_1^c) = \frac{3}{7}. \end{gathered}

So the draws are dependent. By the law of total probability the second draw is still marked with probability 38⋅27+58⋅37=2156=38\tfrac38 \cdot \tfrac27 + \tfrac58 \cdot \tfrac37 = \tfrac{21}{56} = \tfrac38, the same chance as for the first draw. With replacement the draws are independent, and the single unmarked draw can come first, second or third, each order with probability (3/8)2(5/8)(3/8)^2(5/8). So the event AA of exactly 2 marked items now has

P(A)=3(38)258=135512≈0.2637,\begin{aligned} P(A) &= 3 \left(\tfrac38\right)^2 \tfrac58 \\[0.4em] &= \frac{135}{512} \approx 0.2637, \end{aligned}

close to but not equal to the value 15/56≈0.267915/56 \approx 0.2679 without replacement.

Check yourself

  1. A club of 10 members elects a president and a vice president, who must be different people. How many results are possible? How many two-person committees without roles can be formed from the same 10 members?
Show the answer

By the multiplication principle there are 10⋅9=9010 \cdot 9 = 90 ways to fill the two roles. A committee without roles is a combination, and each committee corresponds to 2!=22! = 2 ordered choices, so there are 90/2=45=(102)90/2 = 45 = \binom{10}{2} committees.

  1. For the batch of 8 items with 3 marked, find the probability that none of the 3 selected items is marked, first by counting subsets and then by following the draws one at a time. Why is (5/8)3(5/8)^3 not the answer?
Show the answer

There are (53)=10\binom{5}{3} = 10 samples made only of unmarked items, so the probability is

(53)(83)=1056=528≈0.1786.\frac{\binom{5}{3}}{\binom{8}{3}} = \frac{10}{56} = \frac{5}{28} \approx 0.1786 .

Following the draws, the first is unmarked with probability 5/85/8, and given that the earlier draws were unmarked, the second and third are unmarked with probabilities 4/74/7 and 3/63/6. Their product is 60/336=5/2860/336 = 5/28, the same value. The number (5/8)3=125/512≈0.2441(5/8)^3 = 125/512 \approx 0.2441 is the answer for sampling with replacement, where every draw again faces 5 unmarked items out of 8 and the draws are independent. Without replacement, each unmarked draw lowers the share of unmarked items left, from 5/85/8 to 4/74/7 and then 3/63/6, so the chance is smaller.

  1. Someone finds the chance of exactly 2 marked items in the sample as 15/33615/336, reasoning that 15 samples are favorable and 336 draws are possible. What went wrong?
Show the answer

The numerator counts unordered subsets, while the denominator counts ordered lists, so the two counts describe outcomes at different levels. Each favorable subset corresponds to 3!=63! = 6 ordered lists, which gives 90 favorable ordered lists and the probability 90/336=15/56≈0.267990/336 = 15/56 \approx 0.2679. The value 15/33615/336 is 6 times too small. Counting at either level works, as long as the numerator and the denominator use the same one.

How this lesson connects