We begin with a very simple point, which is easy to get slightly wrong (Google “off-by-one error”).
In this course, we will rarely be using real numbers. We will therefore use interval notation to refer to intervals of integers:
For example, we have
The sizes of these sets are
(The first three of these are valid for , but the last is only valid for .) For example, we have
It is a common mistake to say that or , but the above examples show that this is not correct.
Here is a related observation: if we have a fence consisting of sections supported by fenceposts, then the number of posts is one more than the number of sections. Each section has a post at the right hand end, and there is one more post at the left hand end of the whole fence. (Google “fencepost error”.)
A binary sequence of length is a sequence with . We write for the set of binary sequences of length . We also write for the subset of binary sequences of length in which there are ones.
The sequence is a binary sequence of length , so . We will typically use abbreviated notation and write instead of . As there are ones in , we can also say that .
The full list of elements of is
(We have written these in dictionary order, which is good practice. It is much easier to deal with these kind of constructions if we list things in a systematic and consistent order.)
The full list of elements of is
In the above example we saw that . Of course, this can be generalised.
.
To choose an element we have choices for , choices for and so on, making choices for the sequence as a whole. ∎
Let be a finite set. We let denote the set of all subsets of . We also let denote the set of all subsets of size in .
Take . Then
We also have
We might also use more abbreviated notation:
If then .
List the elements of as . To choose a subset of , we first choose whether to include , then choose whether to include and so on. We have two choices for each , and thus choices altogether.
Here is another way to say essentially the same thing. Given a binary sequence , we define
For example, in the case , we have
(In the left hand example, we have ones in positions , and , so the set is . In the right hand example, we have ones in positions , and , so the set is .) This construction gives a one-to-one correspondence between subsets of and binary sequences, so . ∎
For a finite set , we define to be the set of sequences such that the entries are distinct elements of .
If then
If and then
In particular, we have , but is empty for .
Suppose we want to choose a sequence . Then can be any element of , so there are choices. Then can be any element of other than , so there are choices. Then can be any element other than and , so there are choices, and so on. At the last stage, can be any element of except for , so there are choices. Thus, the overall number of choices is
Note also that
In particular, we have . In the other hand, if , it is clear that we cannot have a list of distinct elements in , because has only elements; so . ∎
For integers with we define
For or we define . In this course, we will consider to be undefined for .
If , then .
If it is clear that is empty so . Suppose instead that . Every list gives a subset , and every subset of size arises in this way. However, we can reorder the list in different ways, and they all give the same subset. Thus, we have
∎
We also have .
To specify an element of , we just need to specify the positions in where the ones appear. There are subsets of size in , so . ∎
Suppose that people compete in an Olympic pie-eating competition. In how many ways can the medals be awarded? If the BBC decides to interview three of the finalists, chosen at random, in how many ways can they do that? What if there were finalists?
Let be the set of competitors, so . For the first question, we need an ordered list of three distinct medal winners (gold, then silver, then bronze), so the number of possibilities is . In more detail, there are choices for who gets the gold. When we have awarded the gold, there are choices left for who gets silver, then choices for who gets bronze. Thus, the total number of ways in which the medals can be awarded is .
For the second question, we need an unordered set of three interviewees, so the number of possibilities is . In more detail, there are possible choices for the list of people who get interviewed, in the order in which they get interviewed. But we do not care about the order, we only care about the set of interviewees. So we need to divide by the number of possible orders, which is . Thus, the number of ways to choose a set of three interviewees is .
If there were finalists, then the number of ways of awarding the medals would be , and the number of ways of choosing the interviewees would be .
In the National Lottery, six balls are drawn from a set of balls. How many possible outcomes are there?
We need to count the subsets of size in a set of size ; the answer is
The other familiar place where we see binomial coefficients is in the binomial expansion formula:
We next recall how this works.
Consider the case . We have
In the first step we have just expanded everything out in the obvious way, writing the terms in dictionary order. Each term is a product of four factors, each of which is either or . To generate all the terms, we have to make choices of whether to have a or an , giving terms altogether. In the second step, we just regroup the terms according to how many ’s appear. There is one term with no ’s, terms with one , terms with two ’s, terms with three ’s and one term with four ’s. In general, to generate a term with ’s, we just need to choose slots from in which the ’s appear, and put ones in the other slots. Thus, there are terms with ’s, and each of these contributes to the expansion. Thus, we have .
As an exercise in notation, we can write this slightly differently. Let be a subset of . Let be the term in the expansion where we take from the factors corresponding to , and from the factors corresponding to . The number of ’s is then equal to , so the product is . We get a term for every possible subset , so we get
The number of ’s in this sum is the number of subsets such that , or in other words . We therefore have as before.
For any , we have .
Put . We can rewrite this with the terms in reverse order as . Adding these two equations together, we get
The right hand side consists of terms, each of which is equal to , so the total is . It follows that as claimed. This proof can be illustrated as shown below: there are red dots above the diagonal line and blue dots below it, showing that .
Alternatively, we can give a proof by induction. For the claim is that , which is clear. For the claim is that , which is also clear. For , we can assume as an induction hypothesis that
Adding to both sides, we get
as required. ∎
For with we have .
Note that we have explicitly excluded the case . If and then the claim is that which is true. If then the claim is that which is true. If then the claim is that which is true. This just leaves the interesting case where . We will give two different proofs for this case.
The binomial coefficient is the number of subsets with . To choose such a subset, we first decide whether we want to be an element of . If we decide that should not be an element of , then we just choose to be a subset of size in , and there are possibilities for this. If we decide that we do want to be an element of , then we need to choose a further elements from to make up the rest of , and there are possibilities for this. Thus, we have possibilities for , and this must agree with the number that we obtained more directly. ∎
Recall that . On the top we have
We can also write the here as , giving . By substituting this into the definition of , we get
In the first term, we can rewrite as , and in the second term, we can rewrite as . (These are valid because we are assuming that , so .) This gives
∎
For we have .
The binomial coefficient is the number of subsets size in . To choose such a subset, we can just choose a subset of size in , and take . This gives a one-to-one correspondence between subsets of size and subsets of size , so . ∎
∎
A subset is gappy if there are no adjacent elements. In more detail, the condition is that there should not exist such that and . Similarly, we say that a binary sequence is gappy if it has no adjacent ones. We write for the set of gappy subsets with .
The set is gappy. The set is not gappy, because it contains the adjacent elements and . The full list of elements of is
so .
If then , but if then so .
We have discussed before that subsets of correspond to binary sequences, and it is clear that gappy subsets correspond to gappy sequences, so we will work with binary sequences from now on. We will also assume that , leaving the trivial case to the reader. Suppose that we have a gappy sequence . The first one in might appear in the very first position, so it need not be preceded by a zero. However, there are more ones, and by the gappy condition, each of them must have a zero immediately before it. The ones and these adjacent zeros take slots altogether, so we must have . This shows that if ; we will assume that from now on. If we delete these zeros, we get a binary sequence of length containing ones, or in other words, and element of . On the other hand, if we are given an element of , then we can get an element of by inserting zeros to the left of all the ones, except for the first one. Thus, we have a one-to-one correspondence between and , showing that .
Here are some examples of elements of , and the corresponding elements of :
∎
Suppose that a doctor’s surgery has a single row of chairs, and there are patients waiting. In how many ways can they be seated such that no two are next to each other?
The number is .
In a draw for the National Lottery (as in Problem 1.16), what is the probability that there is an adjacent pair of numbers?
We are selecting an element of at random, and we want to know the probability that it is not gappy. The total size of is . The number of gappy sets is
Thus, the number of non-gappy sets is , and the proportion of non-gappy sets is
Thus, approximately of draws will have an adjacent pair of numbers.