Login
📚 Discrete Mathematics
Chapters ▾
⇩ Download ▾

2.3 Combinations and Permutations

A permutation is a (possible) rearrangement of objects. For example, there are 6 permutations of the letters a, b, c:

a b c ,     a c b ,     b a c ,     b c a ,     c a b ,     c b a

.

We 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 2 1 .

A piece of notation is helpful here: n ! , 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 5 4 3 2 1 . This generalizes:

Sometimes we do not want to permute all of the letters/numbers/elements we are given.

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 , and n = 6 .) We write this number P ( n , k ) and sometimes call it a k -permutation of n elements. 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

P ( 10 , 4 ) = 10 9 8 7

.

Notice again that P ( 10 , 4 ) starts out looking like 10 ! , but we stop after 7. We can formally account for this “stopping” by dividing away the part of the factorial we do not want:

P ( 10 , 4 ) = 10 9 8 7 6 5 4 3 2 1 6 5 4 3 2 1 = 10 ! 6 !

.

Careful: The factorial in the denominator is not 4 ! but rather ( 10 4 ) ! .

Note that when n = k , we have P ( n , n ) = n ! ( n n ) ! = n ! (since we defined 0 ! to be 1). This makes sense —we already know n ! gives the number of permutations of all n objects.

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 ? You have n objects, and you need to choose k of them. You can do that in ( n k ) 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 ) :

P ( n , k ) = ( n k ) k !

.

Now since we have a closed formula for P ( n , k ) already, we can substitute that in:

n ! ( n k ) ! = ( n k ) k !

.

If we divide both sides by k ! we get a closed formula for ( n k ) .

We say P ( n , k ) counts permutations, and ( n k ) counts combinations. The formulas for each are very similar, there is just an extra k ! in the denominator of ( n k ) . That extra k ! accounts for the fact that ( n k ) 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.

How many triangles are there with vertices from the points shown below? Note, we are not allowing degenerate triangles - ones with all three vertices on the same line, but we do allow non-right triangles. Explain why your answer is correct.

Five equally spaced dots in a vertical line and six additional equally spaced dots extending to the right in a horizontal line from the lowest dot (forming a right angle).

If you pick any three points, you can get a triangle, unless those three points are all on the x -axis or on the y -axis. There are other ways to start this as well, and any correct method should give the same answer.

120.

We have seen that the formula for P ( n , k ) is n ! ( n k ) ! . Your task here is to explain why this is the right formula.

  1. Suppose you have 12 chips, each a different color. How many different stacks of 5 chips can you make? Explain your answer and why it is the same as using the formula for P ( 12 , 5 ) .
  2. Using the scenario of the 12 chips again, what does 12 ! count? What does 7 ! count? Explain.
  3. Explain why it makes sense to divide 12 ! by 7 ! when computing P ( 12 , 5 ) (in terms of the chips).
  4. Does your explanation work for numbers other than 12 and 5? Explain the formula P ( n , k ) = n ! ( n k ) ! using the variables n and k .

Discrete Mathematics: An Open Introduction, 3rd edition, by Oscar Levin (discrete.openmathbooks.org), licensed under CC BY-SA 4.0; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.