Combinatorics

As we saw in the previous lecture, there are some simple experiments that have equally likely outcomes. In these experiments, determining the probability of an event amounts to counting all the outcomes that are part of that event. This is a simple enough thing to do when there are few outcomes, but as the number of outcomes increases, we will want to count more efficiently. Techniques for counting efficiently and effectively belong to a part area of mathematics known as combinatorics.

The multiplication principle: Sometimes the outcome of an experiment can be thought of as a sequence of outcomes of smaller experiments called trials. In these cases, the number of outcomes for the experiment is the product of the number of outcomes for each trial.

For example, consider an experiment where we flip a coin 3 times. How many outcomes are possible? We can spend some time writing out all the different outcomes, $\{T,T,T\},\{T,T,H\},$ and so on. Or we can use the multiplication principle and note that there are three trials, with two outcomes each. So the number of outcomes must be $2\cdot 2 \cdot 2 = 2^3 = 8$.

Problem: Four coloured balls are placed in a bag and are pulled out one at a time. How many ways are there to pick out all 4 balls?

The number of ways to select the 4 balls in the last problem can also be thought of as the number of ways that we can put all 4 balls in order. In fact, this is how we can define the concept of a "factorial".

Definition For any non-negative integer $n\in\mathbb{N}$, $n$ factorial (written $n!$) is the number of ways to arrange the $n$ objects. We can compute $n!$ by following the recursion relation:

  1. $0! = 1$.
  2. $n! = n \cdot (n-1)!$ if $n\ne 0$.
For example, $$3! = 3\cdot 2! = 3\cdot 2 \cdot 1! = 3 \cdot 2 \cdot 1 \cdot 0! = 6$$

Example: Lotto 649 is played by picking 6 different numbers between 1 and 49. How many possible outcomes are there? What is the probability of picking all 6 numbers correctly?

Pick and Choose:

We could equivalently have asked "how many ways are there to pick 6 numbers from the set of numbers from 1-49?" Suppose we are selecting $k$ elements from a set with $n$ elements. When the order that objects are selected matters, we have $_nP_k = \frac{n!}{(n-k)!}$, which we read as $n$ pick $k$. For the Lotto 649 example, this gives \begin{align}_{49}P_{6} &= \frac{49!}{(49-6)!}\\ &= \frac{49\cdot 48 \cdot ... }{43 \cdot 42 \cdot ...}\\ & = 49\cdot 48\cdot 47 \cdot 46 \cdot 45 \cdot 44, \end{align} which we'll recognize as the total number of outcomes in the sample space.

When the order that the objects are selected doesn't matter, some of the outcomes are in a sense equivalent, and we would be over counting if we used $_n P_k$ by $k!$. We define $_n C _k = \frac{n!}{(n-k)!k!} = \frac{_nP_k}{k!}$, which we read as $n$ choose $k$. In the lotto 649 example, we have \begin{align} _{49}C_6 & = \frac{49!}{(49-6)!\cdot 6!}\\ & = \frac{49\cdot 48 \cdot 47 \cdot ...}{(43 \cdot 42 \cdot ...)(6 \cdot 5 \cdot... )}\\ &= \frac{49 \cdot 48 \cdot 47 \cdot 46 \cdot 45 \cdot 44}{720}\\ &= 13,983,816. \end{align} This number is the number of choices available. We could have also defined each of these choices as an outcome, rather than defining the outcomes with the order accounted for. In this case, each outcome is still equally likely and the probability of selecting the correct 6 numbers is $\frac{1}{13983,816}$, exactly as we had before.

Problem: Anna has been sent to the closet to get some lightbulbs. The box she is looking in has 12 bulbs. Six of these are 60W bulbs, four are 75W, and two are 100W. If Anna picks two bulbs at random, what is the probability that she chooses:

  1. Two 100W bulbs?
  2. Two 75W bulbs?
  3. One 75W bulb and one 60W bulb?

Exercises

  • Digital passwords often have specific requirements about what kinds of characters you must use. Suppose are creating a password that is 6 characters long. How many possible passwords are there if
    1. You only use lower case letters?
    2. You use upper and lower case letters?
    3. You use lower case letters and numbers?
  • Consider Lotto 649 again. What is the probability of selecting exactly 3 correct numbers?
  • Suppose there are $n$ people in a room. Assuming that all birthdays are equally likely, what is the probability that at least two of the people have the same birthday? For what $n$ does this probability exceed 50%?