Post · 13 min read· pp. 130–137

2.1.3 Unordered Sampling without Replacement: Combinations


Video Available Video Available

Here we have a set with nn elements, e.g., A={1,2,3,....n}A=\{1, 2, 3,....n\} and we want to draw kk samples from the set such that ordering does not matter and repetition is not allowed. Thus, we basically want to choose a kk-element subset of AA, which we also call a kk-combination of the set AA. For example if A={1,2,3}A=\{1,2,3\} and k=2k=2, there are $3$ different possibilities:

  1. {1,2};
  2. {1,3};
  3. {2,3}.

We show the number of kk-element subsets of AA by

(nk).{n \choose k}.
This is read "nn choose kk." A typical scenario here is that we have a group of nn people, and we would like to choose kk of them to serve on a committee. A simple way to find (nk){n \choose k} is to compare it with PknP^n_k. Note that the difference between the two is ordering. In fact, for any kk-element subset of A={1,2,3,....n}A=\{1, 2, 3,....n\}, we can order the elements in k!k! ways, thus we can write
Pkn=(nk)×k!P^n_k={n \choose k}\times k!
Therefore,
(nk)=n!k!(n−k)!.{n \choose k}=\frac{n!}{k!(n-k)!}.
Note that if kk is an integer larger than nn, then (nk)=0{n \choose k}=0. This makes sense, since if k>nk>n there is no way to choose kk distinct elements from an nn-element set.

The number of kk-combinations of an nn-element set is given by

(nk)=n!k!(n−k)!, for 0≤k≤n.{n \choose k}=\frac{n!}{k!(n-k)!}, \textrm{ for } 0\leq k\leq n.

(nk){n \choose k} is also called the binomial coefficient. This is because the coefficients in the binomial theorem are given by (nk){n \choose k}. In particular, the binomial theorem states that for an integer n≥0n\geq 0, we have

(a+b)n=∑k=0n(nk)akbn−k.(a+b)^n=\sum_{k=0}^{n} {n \choose k} a^k b^{n-k}.

Note: There are several different common notations that are used to show the number of kk-combinations of an nn-element set including Cn,k,C(n,k),Ckn,nCkC_{n,k}, C(n,k), C^n_k, nCk, etc. In this book, we always use (nk){n \choose k}.


Example

I choose $3$ cards from the standard deck of cards. What is the probability that these cards contain at least one ace?

  • Solution
    • Again the phrase "at least" suggests that it might be easier to first find P(Ac)P(A^c), the probability that there is no ace. Here the sample space contains all possible ways to choose $3$ cards from $52$ cards, thus
      ∣S∣=(523).|S|={52 \choose 3}.
      There are $52-4=48$ non-ace cards, so we have
      ∣Ac∣=(483).|A^c|={48 \choose 3}.
      Thus
      P(A)=1−(483)(523).P(A)=1-\frac{{48 \choose 3}}{{52 \choose 3}}.

Example

How many distinct sequences can we make using $3$ letter "A"s and $5$ letter "B"s? (AAABBBBB, AABABBBB, etc.)

  • Solution
    • You can think of this problem in the following way. You have $3+5=8$ positions to fill with letters A or B. From these $8$ positions, you need to choose $3$ of them for As. Whatever is left will be filled with Bs. Thus the total number of ways is
      (83).{8 \choose 3}.
      Now, you could have equivalently chosen the locations for Bs, so the answer would have been
      (85).{8 \choose 5}.
      Thus, we conclude that
      (83)=(85).{8 \choose 3}={8 \choose 5}.

The same argument can be repeated for general nn and kk to conclude

(nk)=(nn−k).{n \choose k}={n \choose n-k}.
You can check this identity directly algebraically, but the way we showed it here is interesting in the sense that you do not need any algebra. This is sometimes a very effective way of proving some identities of binomial coefficients. This is proof by combinatorial interpretation. The basic idea is that you count the same thing twice, each time using a different method and then conclude that the resulting formulas must be equal. Let us look at some other examples.


Example Show the following identities for non-negative integers kk and mm and nn, using combinatorial interpretation arguments.

  1. We have ∑k=0n(nk)=2n\sum_{k=0}^{n} {n \choose k}=2^n.
  2. For $0\leq k< n$, we have (n+1k+1)=(nk+1)+(nk){n+1 \choose k+1}={n \choose k+1}+{n \choose k}.
  3. We have (m+nk)=∑i=0k(mi)(nk−i){m+n \choose k}=\sum_{i=0}^{k} {m \choose i}{n \choose k-i} (Vandermonde's identity).
  • Solution
      1. To show this identity, we count the total number of subsets of an nn-element set AA. We have already seen that this is equal to $2^n$ in Example 2.3. Another way to count the number of subsets is to first count the subsets with $0$ elements, and then add the number of subsets with $1$ element, and then add the number of subsets with $2$ elements, etc. But we know that the number of kk-element subsets of AA is (nk){n \choose k}, thus we have

        $2^n$$=\textrm{Number of subsets of AA}$
        $=\sum_{k=0}^{n}\textrm{Number of kk-element subsets of AA} \hspace{70pt}$(2.1)(2.1)
        =∑k=0n(nk)=\sum_{k=0}^{n} {n \choose k}.

        We can also prove this identity algebraically, using the binomial theorem, (a+b)n=∑k=0n(nk)akbn−k(a+b)^n=\sum_{k=0}^{n} {n \choose k} a^k b^{n-k}. If we let a=b=1a=b=1, we obtain $2^n=\sum_{k=0}^{n} {n \choose k}$.

      2. To show this identity, let's assume that we have an arbitrary set AA with n+1n+1 distinct elements:

        A={a1,a2,a3,...,an,an+1}.A=\{a_1, a_2, a_3, ...,a_n,a_{n+1}\}.
        We would like to choose a k+1k+1-element subset BB. We know that we can do this in (n+1k+1){n+1 \choose k+1} ways (the left hand side of the identity). Another way to count the number of k+1k+1-element subsets BB is to divide them into two non-overlapping categories based on whether or not they contain an+1a_{n+1}. In particular, if an+1∉Ba_{n+1} \notin B, then we need to choose k+1k+1 elements from {a1,a2,a3,...,an}\{a_1, a_2, a_3, ...,a_n\} which we can do in (nk+1){n \choose k+1} different ways. If, on the other hand, an+1∈Ba_{n+1} \in B, then we need to choose another kk elements from {a1,a2,a3,...,an}\{a_1, a_2, a_3, ...,a_n\} to complete BB and we can do this in (nk){n \choose k} different ways. Thus, we have shown that the total number of k+1k+1-element subsets of an n+1n+1-element set is equal to (nk+1)+(nk){n \choose k+1}+{n \choose k}.

      3. Here we assume that we have a set AA that has m+nm+n elements:

        A={a1,a2,a3,...,am,b1,b2,...,bn}.A=\{a_1,a_2,a_3,...,a_m, b_1, b_2,...,b_n\}.
        We would like to count the number of kk-element subsets of AA. This is (m+nk){m+n \choose k}. Another way to do this is first choose ii elements from {a1,a2,a3,...,am}\{a_1,a_2,a_3,...,a_m\} and then k−ik-i elements from {b1,b2,...,bn}\{b_1, b_2,...,b_n\}. This can be done in (mi)(nk−i){m \choose i}{n \choose k-i} number of ways. But ii can be any number from $0$ to kk, so we conclude (m+nk)=∑i=0k(mi)(nk−i){m+n \choose k}=\sum_{i=0}^{k} {m \choose i}{n \choose k-i}.


Let us now provide another interpretation of (nk){n \choose k}. Suppose that we have a group of nn people and we would like to divide them into two groups AA and BB such that group AA consists of kk people and group BB consists of n−kn-k people. To do this, we just simply need to choose kk people and put them in group AA, and whoever is left will be in group BB. Thus, the total number of ways to do this is (nk){n \choose k}.

The total number of ways to divide nn distinct objects into two groups AA and BB such that group AA consists of kk objects and group BB consists of n−kn-k objects is (nk){n \choose k}.

Note: For the special case when n=2kn=2k and we do not particularly care about group names AA and BB, the number of ways to do this division is 12(nk)\frac{1}{2}{n \choose k} to avoid double counting. For example, if $22$ players want to play a soccer game and we need to divide them into two groups of $11$ players, there will be 12(2211)\frac{1}{2}{22 \choose 11} ways to do this. The reason for this is that, if we label the players $1$ to $22$, then the two choices

A={1,2,3,...,11} and B={12,13,14,...,22},A=\{1,2,3,...,11\} \textrm{ and } B=\{12,13,14,...,22\},
A={12,13,14,...,22} and B={1,2,3,...,11}A=\{12,13,14,...,22\} \textrm{ and } B=\{1,2,3,...,11\}
are essentially the same.

For example, we can solve Example 2.7 in the following way: We have $8$ blank positions to be filled with letters "A" or "B." We need to divide them into two groups AA and BB such that group AA consists of three blank positions and group BB consists of $5$ blank spaces. The elements in group AA show the positions of "A"s and the elements in group BB show the positions of "B"s. Therefore the total number of possibilities is (83){8 \choose 3}.

Bernoulli Trials and Binomial Distribution:

Now, we are ready to discuss an important class of random experiments that appear frequently in practice. First, we define Bernoulli trials and then discuss the binomial distribution. A Bernoulli Trial is a random experiment that has two possible outcomes which we can label as "success" and "failure," such as

  • You toss a coin. The possible outcomes are "heads" and "tails." You can define "heads" as success and "tails" as "failure" here.
  • You take a pass-fail test. The possible outcomes are "pass" and "fail."

We usually denote the probability of success by pp and probability of failure by q=1−pq=1-p. If we have an experiment in which we perform nn independent Bernoulli trials and count the total number of successes, we call it a binomial experiment. For example, you may toss a coin nn times repeatedly and be interested in the total number of heads.


Example Suppose that I have a coin for which P(H)=pP(H)=p and P(T)=1−pP(T)=1-p. I toss the coin $5$ times.

  1. What is the probability that the outcome is THHHHTHHHH?
  2. What is the probability that the outcome is HTHHHHTHHH?
  3. What is the probability that the outcome is HHTHHHHTHH?
  4. What is the probability that I will observe exactly four heads and one tails?
  5. What is the probability that I will observe exactly three heads and two tails?
  6. If I toss the coin nn times, what is the probability that I observe exactly kk heads and n−kn-k tails?
  • Solution
      1. To find the probability of the event A={THHHH}A=\{THHHH\}, we note that AA is the intersection of $5$ independent events: A≡A\equiv first coin toss is tails, and the next four coin tosses result in heads. Since the individual coin tosses are independent, we obtain

        P(THHHH)P(THHHH)=p(T)×p(H)×p(H)×p(H)×p(H)=p(T) \times p(H) \times p(H) \times p(H) \times p(H)
        =(1−p)p4=(1-p)p^4.
      2. Similarly,

        P(HTHHH)P(HTHHH)=p(H)×p(T)×p(H)×p(H)×p(H)=p(H) \times p(T) \times p(H) \times p(H) \times p(H)
        =(1−p)p4=(1-p)p^4.
      3. Similarly,

        P(HHTHH)P(HHTHH)=p(H)×p(H)×p(T)×p(H)×p(H)=p(H) \times p(H) \times p(T) \times p(H) \times p(H)
        =(1−p)p4=(1-p)p^4.
      4. Let BB be the event that I observe exactly one tails and four heads. Then

        B={THHHH,HTHHH,HHTHH,HHHTH,HHHHT}.B=\{THHHH,HTHHH,HHTHH,HHHTH,HHHHT\}.
        Thus

        P(B)P(B)=P(THHHH)+P(HTHHH)+P(HHTHH)+P(HHHTH)+P(HHHHT)=P(THHHH)+P(HTHHH)+P(HHTHH)+P(HHHTH)+P(HHHHT)
        =(1−p)p4+(1−p)p4+(1−p)p4+(1−p)p4+(1−p)p4=(1-p)p^4+(1-p)p^4+(1-p)p^4+(1-p)p^4+(1-p)p^4
        =5p4(1−p)=5p^4(1-p).
      5. Let CC be the event that I observe exactly three heads and two tails. Then

        C={TTHHH,THTHH,THHHTH,...,HHHTT}.C=\{TTHHH,THTHH,THHHTH,...,HHHTT\}.
        Thus

        P(C)P(C)=P(TTHHH)+P(THTHH)+P(THHTH)+...+P(HHHTT)=P(TTHHH)+P(THTHH)+P(THHTH)+...+P(HHHTT)
        =(1−p)2p3+(1−p)2p3+(1−p)2p3+...+(1−p)2p3=(1-p)^2p^3+(1-p)^2p^3+(1-p)^2p^3+...+(1-p)^2p^3
        =∣C∣p3(1−p)2=|C|p^3(1-p)^2.

        But what is ∣C∣|C|? Luckily, we know how to find ∣C∣|C|. This is the total number of distinct sequences that you can create using two tails and three heads. This is exactly the same as Example 2.7. The idea is that we have $5$ positions to fill with letters H or T. From these $5$ positions, you need to choose $3$ of them for Hs. Whatever is left is going to be filled with Ts. Thus the total number of elements in CC is (53){5 \choose 3}, and

        P(C)=(53)p3(1−p)2.P(C)={5 \choose 3}p^3(1-p)^2.

      6. Finally, we can repeat the same argument when we toss the coin nn times and obtain

        P(k heads and n−k tails)=(nk)pk(1−p)n−k.P(\textrm{$k$ heads and $n-k$ tails})={n \choose k}p^k(1-p)^{n-k}.
        Note that here, instead of writing P(kP(k heads and n−kn-k tails)), we can just write P(kP(k heads)).


Binomial Formula:

For nn independent Bernoulli trials where each trial has success probability pp, the probability of kk successes is given by

P(k)=(nk)pk(1−p)n−k.P(k)={n \choose k}p^k(1-p)^{n-k}.

Multinomial Coefficients:

The interpretation of the binomial coefficient (nk){n \choose k} as the number of ways to divide nn objects into two groups of size kk and n−kn-k has the advantage of being generalizable to dividing objects into more than two groups.


Example

Ten people have a potluck. Five people will be selected to bring a main dish, three people will bring drinks, and two people will bring dessert. How many ways can they be divided into these three groups?

  • Solution
    • We can solve this problem in the following way. First, we can choose $5$ people for the main dish. This can be done in (105){10 \choose 5} ways. From the remaining $5$ people, we then choose $3$ people for drinks, and finally the remaining $2$ people will bring desert. Thus, by the multiplication principle, the total number of ways is given by
      (105)(53)(22)=10!5!5!⋅5!3!2!⋅2!2!0!=10!5!3!2!.{10 \choose 5} {5 \choose 3} {2 \choose 2}=\frac{10!}{5! 5!} \cdot \frac{5!}{3! 2!} \cdot \frac{2!}{2! 0!}=\frac{10!}{5! 3! 2!}.

This argument can be generalized for the case when we have nn people and would like to divide them to rr groups. The number of ways in this case is given by the multinomial coefficients. In particular, if n=n1+n2+...+nrn=n_1+n_2+...+n_r, where all ni≥0n_i\geq 0 are integers, then the number of ways to divide nn distinct objects to rr distinct groups of sizes n1,n2,...,nrn_1, n_2,..., n_r is given by

(nn1,n2,...,nr)=n!n1!n2!...nr!.{n \choose n_1,n_2,...,n_r}=\frac{n!}{n_1! n_2! ... n_r!}.
We can also state the general format of the binomial theorem, which is called the multinomial theorem:
(x1+x2+⋯+xr)n=∑n1+n2+⋯+nr=n(nn1,n2,…,nr)x1n1x2n2...xrnr(2.2)(x_1 + x_2 + \cdots + x_r)^n = \sum_{n_1+n_2+\cdots+n_r=n} {n \choose n_1, n_2, \ldots, n_r} x_1^{n_1} x_2^{n_2} ... x_r^{n_r} \hspace{30pt} (2.2)
Finally, the binomial formula for Bernoulli trials can also be extended to the case where each trial has more than two possible outcomes.


Example

I roll a die $18$ times. What is the probability that each number appears exactly $3$ times?

  • Solution
    • First of all, each sequence of outcomes in which each number appears $3$ times has probability
      (16)3×(16)3×(16)3×(16)3×(16)3×(16)3\left(\frac{1}{6}\right)^3 \times \left(\frac{1}{6}\right)^3 \times \left(\frac{1}{6}\right)^3 \times \left(\frac{1}{6}\right)^3 \times \left(\frac{1}{6}\right)^3 \times \left(\frac{1}{6}\right)^3
      =(16)18.=\left(\frac{1}{6}\right)^{18}.
      How many distinct sequences are there with three $1$'s, three $2$'s, ..., and three $6$'s? Each sequence has $18$ positions which we need to fill with the digits. To obtain a sequence, we need to choose three positions for $1$'s, three positions for $2$'s, ..., and three positions for $6$'s. The number of ways to do this is given by the multinomial coefficient
      (183,3,3,3,3,3)=18!3!3!3!3!3!3!.{18 \choose 3,3,3,3,3,3}=\frac{18!}{3! 3! 3! 3! 3! 3!}.
      Thus the total probability is
      18!(3!)6(16)18.\frac{18!}{(3!)^6} \left(\frac{1}{6}\right)^{18}.

We now state the general form of the multinomial formula. Suppose that an experiment has rr possible outcomes, so the sample space is given by

S={s1,s2,...,sr}.S=\{s_1,s_2, ... ,s_r\}.
Also suppose that P(si)=piP(s_i)=p_i for i=1,2,...,ri=1,2,...,r. Then for n=n1+n2+...+nrn=n_1+n_2+...+n_r independent trials of this experiment, the probability that each sis_i appears nin_i times is given by
(nn1,n2,...,nr)p1n1p2n2...prnr=n!n1!n2!...nr!p1n1p2n2...prnr.{n \choose n_1,n_2,...,n_r} p_1^{n_1} p_2^{n_2} ... p_r^{n_r} =\frac{n!}{n_1! n_2! ... n_r!} p_1^{n_1} p_2^{n_2} ... p_r^{n_r}.