In combinatorics, a permutation is an ordering of a list of objects. For example, arranging four people in a line is equivalent to finding permutations of four objects. More abstractly, each of the following is a permutation of the letters and
Note that all of the objects must appear in a permutation and two orderings are considered different if some object appears in a different place in the orderings.
Permutations are important in a variety of counting problems (particularly those in which order is important) as well as in various other areas of mathematics; for example, the determinant is often defined using permutations.
The simplest example of a permutation is the case where all objects need to be arranged, as the introduction did for The question thus becomes the following:
Given a list of objects, how can all possible permutations be listed?
There are several algorithms for enumerating all permutations; one example is the following recursive algorithm:
- If the list contains a single element, then return the single element.
- If the list contains more than one element, loop through each element in the list, returning this element concatenated with all permutations of the remaining objects.
Lisa has 5 different ornaments she wants to arrange in a line on her mantle. How many ways can she arrange the ornaments?
We can think of Lisa’s mantle as having five positions in a line. There are 5 ornaments, which gives 5 choices for which ornament goes into the first position. After placing the first ornament, there are 4 choices of which ornament to put into the second position. Repeating this argument, there are 3 choices for the third position, 2 choices for the fourth position, and 1 choice for the last position. By the rule of product, the total number of ways to place the ornaments is
Given a list of distinct objects, how many different permutations of the objects are there?
Since each permutation is an ordering, start with an empty ordering which consists of positions in a line to be filled by the objects. There are choices for which object to place in the first position. After the first object is placed, there are remaining objects, so there are choices for which object to place in the second position. Repeating this argument, there are choices for the third position, choices for the fourth position, and so on. For the position, the number of choices is Then the rule of product implies the total number of orderings is
For a positive integer , the notation denotes the factorial of and refers to the product of all positive integers from to . Note that is the empty product and is defined to be .
The argument above shows the following result:
The number of permutations of distinct objects is , the factorial of
Jack is playing with a standard deck of playing cards. He shuffles the cards and then turns the top card over to show an ace of spades. If he continues to deal the cards from the top of the deck, how many different permutations are there for the remaining cards in the deck?
Since the first card is an ace of spades, there are remaining distinct playing cards in the deck. Then there are different permutations of the remaining cards.
The first few values of are
As the above list shows, grows very quickly with ; , for example, is already larger than the number of atoms in the observable universe.
In how many ways can a party of 4 men and 4 women be seated at a circular table so that no two women are adjacent??
The 4 men can be seated at the circular table such that there is a vacant seat between every pair of women.
The number of ways in which these 4 men can be seated at the circular table is Now the 4 vacant seats can be occupied by the women in ways. Thus, the required number of ways is ways.
Suppose Ellie is choosing a secret passcode consisting of the digits for some . She would like her passcode to use each digit at most once and because she is concerned about security, she would like to choose a value of such that the number of possible permutations is at least 250,000. What is the smallest value of Ellie can use?
Note that and Therefore, Ellie needs at least digits in her passcode. Since the digits start from , the smallest value of Ellie can choose is
More precisely, Stirling's formula states that is approximated by
The precise bounds for the approximation are shown in the inequality
In the case that the objects are not distinct, we have a permutations with repetition problem; in the case that the permutation must satisfy certain constraints, we have a permutations with restriction problem.
Consider the following problem:
Lisa has 13 different ornaments and wants to put 4 ornaments on her mantle. In how many ways is this possible?
Using the product rule, Lisa has 13 choices for which ornament to put in the first position, 12 for the second position, 11 for the third position, and 10 for the fourth position. So the total number of choices she has is . Using the factorial notation, the total number of choices is .
Using the same argument, we can proceed with the general case. If we have objects and want to arrange of them in a row, there are ways to do this. This is also known as a -permutation of , and is denoted by .
How many 3-digit numbers can be formed without repetition of digits?
The hundredth place cannot contain , but we can put any of the other numbers in the hundredths place. So, it can be filled in ways. Now we cannot use the number we used in the hundredths place in the tenth place. But we can use . So, we can fill the tenth place in ways, too. The units digit can be filled in places since two numbers are now unavailable. So, the total number of 3-digit numbers without repetition of digits that can be formed is
How many 4-letter passwords can be formed if the characters allowed to use without repetition are 0, 1, 2, 3, ..., 9 and A, B, C, ..., Z and a, b, c, ..., z?
We have choices to choose from. So we have to arrange 4 objects out of 62 available objects, the number of ways of doing which is equal to
Suppose Lisa has 13 different ornaments and would like to place 4 of the ornaments in a row on her mantle, and Anna has 12 different ornaments and would like to place 5 of the ornaments in a row on her mantle. Does Lisa have more choices in the possible number of ways to place her ornaments or does Anna?
Since Lisa has 13 ornaments and would like to place 4 of them on her mantle, she has
choices in the possible number of ways to place her ornaments. Similarly, since Anna has 12 ornaments and would like to place 5 of them on her mantle, she has
choices in the possible number of ways to place her ornaments. Now,
since by canceling terms, we can see that . This shows that Anna has more choices in possible ways to place her ornaments.
In general, if Anna has different ornaments and would like to place of them on the mantle with and if Lisa has different ornaments and would like to place of them on a mantle, for what values of does Anna have more choices in the possible number of ways to place all of her ornaments?
Since Anna has ornaments and would like to place of them on her mantle, she has
choices in the possible number of ways to place her ornaments. Similarly, since Lisa has ornaments and would like to place of them on her mantle, she has
choices in the possible number of ways to place her ornaments. Now, let's compare the two quantities by cancelling terms:
Now since , we can check that for , and we have
For , we have
This shows that Anna has more choices in the possible ways to place her ornaments for .
Here are some examples for permutations with repetition:
Main Article: Permutations with Repetition
How many different 6-digit numbers can be obtained by using all of the digits
We first count the total number of permutations of all six digits. This gives a total of
permutations. Now, there are two 5's, so the repeated 5's can be permuted in ways and the six-digit number will remain the same. Similarly, there are three 7's, so the repeated 7's can be permuted in ways and the six-digit number will remain the same. This shows the number of different 6-digit numbers using all of the digits is
From the name above, how many different names (including the above one) can be created such that the relative order of consonants and vowels does not change.
Details and Assumptions:
- "The relative order of consonants and vowels does not change" means that vowels and consonants should occupy the same places as they did in the original name, but they can be juggled with their places.
- An example would be "GEHW NIOO HEUN".
Main Article: Permutations - With Restriction
Lisa has 4 different dog ornaments and 6 different cat ornaments that she wants to place on her mantle. All of the dog ornaments should be consecutive and the cat ornaments should also be consecutive. How many ways can they be arranged?
We have to decide if we want to place the dog ornaments first, or the cat ornaments first, which gives us 2 possibilities. We can arrange the cat ornaments in ways and the dog ornaments in ways. Hence, by the rule of product, there are ways to arrange the ornaments.
Given a permutation problem, how do we determine which category the problem falls under and which technique should be applied to solve the problem? It may be useful to first ask yourself a few questions:
- Are the objects all distinct?
- How many objects are there in total?
- How many objects are we asked to place into an ordering?
- Are there any restrictions on the objects or on the ordering?
Based on the answers to these questions, it may become easier to decide which technique should be applied. Working through many examples is one way to become better at recognizing whether a permutation problem should fall in the category of permutation with or without repetition, or permutation with or without restriction.