How to choose objects from objects
Let’s say that we have 6 objects () and we want to know the number of ways of picking 4 of them (where the order doesn’t matter, so is no different from ). We can imagine writing down all of the possible permutations of the 6 objects (of which there are as we know) and then just taking the first four items. For instance, these are the first few permutations and the items in brackets are the ones that we pick as our 4:
If we pick the items in the brackets then clearly we are going to get many repetitions of the same thing. For instance, the first two items are the same (both (abcd)). Also many of the items in the brackets are the same, up to a reordering, and we said that we didn’t care about the order, so (abcd) is the same as (abdc). We know that in total there are items in the long list of permutations, but we have over-counted if we want to know how many ways there are of choosing 4 objects from 6. We’ve double counted because we have got multiple permutations of the last two objects (i.e.. (abcd)ef and (abcd)fe are the same) and we have multiply counted because we have many ways of writing the same items in the brackets. In fact we have over counted by due to the last items and overcounted by because of the permutations of the first items. Thus the total number of unique ways of picking 4 items from 6 is not but .
In fact this generalises completely. If we have items and we want to choose from them then we have:
where we read “n choose r” and both and are just two different ways of writing this.
How many different possible lottery tickets are there?
Clearly the order of the numbers doesn’t matter, and we can choose 6 numbers from 49. This is which is:
If you buy one lottery ticket, then the chances of you winning are 1 in 13983816, which is pretty terrible!
How about if you toss a coin 6 times, how many ways are there of getting 2 heads? We can start to enumerate them:
We can think of labeling the positions of the heads. The first in the list above will be (1,2), the second will be (1,3), etc. We can see that what we are doing is choosing 2 numbers from 6, but we know that this is just Note that choosing from gives the same number as choosing from . There is a nice symmetry because of the denominator in .
There are some more important properties of . How many ways are there of choosing objects from : The answer is always 1, whatever the value of . How about how to choose objects from . Again, the answer is . There is also a nice symmetry of this. How many ways are there of choosing 4 objects from 6 is the same as choosing 2 objects from 6 (it’s like choosing not to choose the 4 objects!). In general: .
Pascal’s identity
There is a very nice identity, which at first site might not seem very useful, but in fact it will help a lot with working out expressions of the form . This is Pascal’s identity:
We can prove this by starting with the left hand side:
Alternative derivation:
So we have an identity which tells us that to work out a term related to choosing from objects, we have to add together two terms related to choosing from objects. This is encoded entirely in Pascal’s triangle:
: | 1 | ||||||||
: | 1 | 1 | |||||||
: | 1 | 2 | 1 | ||||||
: | 1 | 3 | 3 | 1 | |||||
: | 1 | 4 | 6 | 4 | 1 | ||||
Where each entry is equal to the value of the two numbers above it, and if there is only one number above, it is this number. Pascal’s triangle is the complete enumeration of all . In fact, the above can be written as:
: | |||||||||
: | |||||||||
: | |||||||||
: | |||||||||
: | |||||||||
Check for yourself that the expressions that you calculate match up exactly with the numbers in Pascal’s triangle. Now, the rather mysterious looking Pascal’s identity makes a lot more sense. It is precisely the algorithm that you use to construct Pascal’s triangle. For instance Pascal’s identity tells you that which is the same as seeing that the number 4 is given by in Pascal’s triangle. In order to work out then we just need to write out Pascal’s triangle down to the layer (the first layer is for ).
[…] MAM1000 lecture notes part 18 – Choosing r objects from p […]