You have a bunch of chips which come in five different colors: red, blue, green, purple and yellow.
A is a (possible) rearrangement of objects. For example, there are 6 permutations of the letters a, b, c:
\begin abc, ~~ acb, ~~ bac, ~~bca, ~~ cab, ~~ cba\text \endWe know that we have them all listed above —there are 3 choices for which letter we put first, then 2 choices for which letter comes next, which leaves only 1 choice for the last letter. The multiplicative principle says we multiply \(3\cdot 2 \cdot 1\text<.>\)
How many permutations are there of the letters a, b, c, d, e, f?
We do NOT want to try to list all of these out. However, if we did, we would need to pick a letter to write down first. There are 6 choices for that letter. For each choice of first letter, there are 5 choices for the second letter (we cannot repeat the first letter; we are rearranging letters and only have one of each), and for each of those, there are 4 choices for the third, 3 choices for the fourth, 2 choices for the fifth and finally only 1 choice for the last letter. So there are \(6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 720\) permutations of the 6 letters.
A piece of notation is helpful here: \(n!\text\) read “\(n\) factorial”, is the product of all positive integers less than or equal to \(n\) (for reasons of convenience, we also define 0! to be 1). So the number of permutation of 6 letters, as seen in the previous example is \(6! = 6\cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1\text<.>\) This generalizes:
There are \(n! = n\cdot (n-1)\cdot (n-2)\cdot \cdots \cdot 2\cdot 1\) permutations of \(n\) (distinct) elements.
Remember what it means for a function to be bijective: each element in the codomain must be the image of exactly one element of the domain. Using two-line notation, we could write one of these bijections as
\begin f = \twoline \text \endWhat we are really doing is just rearranging the elements of the codomain, so we are creating a permutation of 8 elements. In fact, “permutation” is another term used to describe bijective functions from a finite set to itself.
If you believe this, then you see the answer must be \(8! = 8 \cdot 7 \cdot\cdots\cdot 1 = 40320\text<.>\) You can see this directly as well: for each element of the domain, we must pick a distinct element of the codomain to map to. There are 8 choices for where to send 1, then 7 choices for where to send 2, and so on. We multiply using the multiplicative principle.
Sometimes we do not want to permute all of the letters/numbers/elements we are given.
How many 4 letter “words” can you make from the letters a through f, with no repeated letters?
This is just like the problem of permuting 4 letters, only now we have more choices for each letter. For the first letter, there are 6 choices. For each of those, there are 5 choices for the second letter. Then there are 4 choices for the third letter, and 3 choices for the last letter. The total number of words is \(6\cdot 5\cdot 4 \cdot 3 = 360\text<.>\) This is not \(6!\) because we never multiplied by 2 and 1. We could start with \(6!\) and then cancel the 2 and 1, and thus write \(\frac\text<.>\)
In general, we can ask how many permutations exist of \(k\) objects choosing those objects from a larger collection of \(n\) objects. (In the example above, \(k = 4\text\) and \(n = 6\text<.>\)) We write this number \(P(n,k)\) and sometimes call it a . From the example above, we see that to compute \(P(n,k)\) we must apply the multiplicative principle to \(k\) numbers, starting with \(n\) and counting backwards. For example
\begin P(10, 4) = 10\cdot 9 \cdot 8 \cdot 7\text \endNotice again that \(P(10,4)\) starts out looking like \(10!\text\) but we stop after 7. We can formally account for this “stopping” by dividing away the part of the factorial we do not want:
\begin P(10,4) = \frac = \frac\text \endCareful: The factorial in the denominator is not \(4!\) but rather \((10-4)!\text<.>\)
\(P(n,k)\) is the number of , the number of ways to arrange \(k\) objects chosen from \(n\) distinct objects.
\begin P(n,k) = \frac = n(n-1)(n-2)\cdots (n-(k-1))\text \endNote that when \(n = k\text\) we have \(P(n,n) = \frac = n!\) (since we defined \(0!\) to be 1). This makes sense —we already know \(n!\) gives the number of permutations of all \(n\) objects.
Note that it doesn't make sense to ask for the number of bijections here, as there are none (because the codomain is larger than the domain, there are no surjections). But for a function to be injective, we just can't use an element of the codomain more than once.
We need to pick an element from the codomain to be the image of 1. There are 8 choices. Then we need to pick one of the remaining 7 elements to be the image of 2. Finally, one of the remaining 6 elements must be the image of 3. So the total number of functions is \(8\cdot 7 \cdot 6 = P(8,3)\text<.>\)
What this demonstrates in general is that the number of injections \(f:A \to B\text\) where \(\card = k\) and \(\card = n\text\) is \(P(n,k)\text<.>\)
Here is another way to find the number of \(k\)-permutations of \(n\) elements: first select which \(k\) elements will be in the permutation, then count how many ways there are to arrange them. Once you have selected the \(k\) objects, we know there are \(k!\) ways to arrange (permute) them. But how do you select \(k\) objects from the \(n\text\) You have \(n\) objects, and you need to choose \(k\) of them. You can do that in \(\) ways. Then for each choice of those \(k\) elements, we can permute them in \(k!\) ways. Using the multiplicative principle, we get another formula for \(P(n,k)\text\)
\begin P(n,k) = \cdot k!\text \endNow since we have a closed formula for \(P(n,k)\) already, we can substitute that in:
\begin \frac = \cdot k!\text \endIf we divide both sides by \(k!\) we get a closed formula for \(\text<.>\)
We say \(P(n,k)\) counts permutations, and \(\) counts combinations. The formulas for each are very similar, there is just an extra \(k!\) in the denominator of \(\text<.>\) That extra \(k!\) accounts for the fact that \(\) does not distinguish between the different orders that the \(k\) objects can appear in. We are just selecting (or choosing) the \(k\) objects, not arranging them. Perhaps “combination” is a misleading label. We don't mean it like a combination lock (where the order would definitely matter). Perhaps a better metaphor is a combination of flavors — you just need to decide which flavors to combine, not the order in which to combine them.
To further illustrate the connection between combinations and permutations, we close with an example.
You decide to have a dinner party. Even though you are incredibly popular and have 14 different friends, you only have enough chairs to invite 6 of them.
How are these numbers related? Notice that \(P(14,6)\) is much larger than \(\text<.>\) This makes sense. \(\) picks 6 friends, but \(P(14,6)\) arranges the 6 friends as well as picks them. In fact, we can say exactly how much larger \(P(14,6)\) is. In both counting problems we choose 6 out of 14 friends. For the first one, we stop there, at 3003 ways. But for the second counting problem, each of those 3003 choices of 6 friends can be arranged in exactly \(6!\) ways. So now we have \(3003\cdot 6!\) choices and that is exactly \(2162160\text<.>\)
Alternatively, look at the first problem another way. We want to select 6 out of 14 friends, but we do not care about the order they are selected in. To select 6 out of 14 friends, we might try this:
\begin 14 \cdot 13 \cdot 12 \cdot 11 \cdot 10 \cdot 9\text \endThis is a reasonable guess, since we have 14 choices for the first guest, then 13 for the second, and so on. But the guess is wrong (in fact, that product is exactly \(2162160 = P(14,6)\)). It distinguishes between the different orders in which we could invite the guests. To correct for this, we could divide by the number of different arrangements of the 6 guests (so that all of these would count as just one outcome). There are precisely \(6!\) ways to arrange 6 guests, so the correct answer to the first question is
\begin \frac\text \endNote that another way to write this is
\begin \frac\text \endwhich is what we had originally.