21.3: Counting Permutations
For \(\vert A \vert = n\text{,}\) there are \(n!\) permutations on \(A\text{.}\)
- Proof
-
Informal proof.
We want to count the number of ways of constructing an ordered list of the \(n\) elements of \(A\text{.}\) There are \(n\) ways to choose the first element in the list, \(n-1\) ways to choose the second, \(n-2\) ways to choose the third, and so on, ending at a single way to choose the \(n^{th}\text{.}\) By the Multiplication Rule, there are\begin{equation*} n \cdot (n - 1) \cdot (n - 2) \cdot \cdots \cdot 1 = n! \end{equation*}
ways to construct such a list.Formal proof.
By induction.Base case \(n=1\) .
If \(\vert A \vert = 1\text{,}\) then \(A\) consists of a single element, say \(A = \{a\}\text{.}\) There is only one possible permutation of \(A\text{,}\) and that is the identity function \(\text{id}_A: A \rightarrow A\) defined by \(\text{id}_A(a) = a\text{.}\) Thus, we have verified that there is \(1! = 1\) permutation of \(A\text{.}\)Induction step.
Let \(k \ge 1\) be a fixed integer. Our induction hypothesis is to assume that if \(B\) is any set with \(\vert B \vert = k\) elements, then there are \(k!\) permutations on \(B\text{.}\) We want to use this hypothesis to prove that if \(A\) is a set with \(\vert A \vert = k+1\) elements, then there are \((k+1)!\) permutations on \(A\text{.}\)Write \(A = \{ a_0, a_1, \ldots , a_k \}\) and \(B = \{ a_1, a_2, \ldots , a_k \}\text{.}\) Then \(B\) is a subset of \(A\) that contains \(k\) elements, and so by our induction hypothesis there are \(k!\) permutations on \(B\text{.}\) For every such permutation of \(B\text{,}\) we can construct \(k+1\) permutations of \(A\) by “inserting” \(a_0\) at different positions in the output list. For example, consider how the identity permutation on \(B\) can be turned into \(k+1\) different permutations on \(A\) — see Figure \(\PageIndex{1}\).
Each of the \(k!\) permutations of \(B\) can be used to construct \(k+1\) permutations of \(A\text{,}\) in the same fashion as we have above for the identity permutation of \(B\text{.}\) So we have in total \((k+1) \cdot k! = (k+1)!\) permutations of \(A\text{,}\) as required.
When applying the method of mathematical induction in the formal proof, we began our base case at \(n = 1\text{.}\) But the formula \(n!\) is still valid for the number of permutations of the empty set. In this case, \(n = 0\) and so \(n! = 0! = 1\) by Convention 21.1.1 . And there is indeed exactly one permutation of the empty set — the empty function. (See Statement 2 of Proposition 12.1.1 .)
Each of the provided proofs for Theorem \(\PageIndex{1}\) above contains an idea that is of practical use in counting collections.
- In the informal proof, we used the Multiplication Rule to count the number of ways to construct an ordered list, where the tasks in the construction are choosing the elements in the list one at a time. (We used this similar thinking often in Chapter 20 , though we didn't explicitly connect the Multiplication Rule to ordered lists.)
- In the formal proof, we used the idea of “inserting” an object into an existing ordered list to create a new ordered list.
For a class of twenty students, in how many different orders can a professor hand back marked tests:
- In total?
- If Karishma's test must be handed back first?
- If Elizabeth's and Ruijing's tests cannot immediately follow one another?
Solution
- A test distribution order is the same thing as a permutation of the students in the class, so there are \(20!\) different handback orders (approximately \(2.4\) quintillion).
- This is just the number of ways of ordering the remaining nineteen students' papers, which is \(19!\) (approximately \(122\) quadrillion).
- It is easier to count the ways that they do follow each other. One way to do this is as follows. Remove Elizabeth's test from the pile. There are now \(19!\) ways to order the remaining nineteen papers. There are two ways to insert Elizabeth's test back into any such ordering — either immediately before or after Ruijing's paper. So there are \(2 \cdot 19!\) orderings we do not want. Therefore, applying the Subtraction Rule yields answer
\begin{equation*} 20! - 2 \cdot 19! = 20 \cdot 19! - 2 \cdot 19! = 18 \cdot 19!\text{.} \end{equation*}
For an alphabet \(\Sigma\) with \(\vert \Sigma \vert = n\text{,}\) how many words in \(\Sigma^{\ast}\) contain each element of the alphabet exactly once?
Solution
Here we just want to order all the elements of \(\Sigma\) into a word, so the answer is \(n!\text{.}\)
- Compare.
-
See Worked Example 20.3.11.
Worked Example \(\PageIndex{2}\) justifies the convention \(0! = 1\text{,}\) since if \(\vert \Sigma \vert = 0\text{,}\) then \(\Sigma^{\ast}\) contains exactly one word: the empty word \(\emptyset\text{.}\) And in this case it is vacuously true that \(\emptyset\) contains each element of \(\Sigma\) exactly once.
If \(\vert A \vert = n\text{,}\) how many different total orders on \(A\) exist?
Solution
Specifying a total order on \(A\) really just means ordering the elements of \(A\text{:}\)
\begin{equation*} a_1 \le a_2 \le a_3 \le \cdots \le a_n. \end{equation*}
So there are \(n!\) possible total orders.
How many different colour patterns can we obtain by placing three red bottles and five blue bottles on a shelf? (Assume the bottles are indistinguishable except by colour.)
Solution
Let's use the Division Rule , where first we will count a more structured collection. If the bottles of the same colour were distinguishable from each other, we would have \(8!\) ways of lining them up on the shelf. Assuming indistinguishability, we now consider two orderings with the same colour pattern but mixed up red and/or blue bottles to be equivalent. For example, the two orderings
\begin{gather*} \mathrm{R}_1 \; \mathrm{B}_1 \; \mathrm{B}_2 \; \mathrm{R}_2 \; \mathrm{R}_3 \; \mathrm{B}_3 \; \mathrm{B}_4 \; \mathrm{B}_5, \\ \mathrm{R}_2 \; \mathrm{B}_5 \; \mathrm{B}_3 \; \mathrm{R}_1 \; \mathrm{R}_3 \; \mathrm{B}_1 \; \mathrm{B}_4 \; \mathrm{B}_2, \end{gather*}
of distinguishable bottles create the same colour pattern, and so are equivalent. Once red and blue bottle positions are determined, we can permute the reds (\(3!\) ways) and blues (\(5!\) ways) independently, so each equivalence class inside the collection of orderings of
distinguishable
bottles contains \(3! \cdot 5!\) equivalent orderings. Applying the
Division Rule
, we arrive at
\begin{equation*} \dfrac{8!}{3! \cdot 5!} = \dfrac{8\cdot 7 \cdot 6}{3 \cdot 2} = 56 \end{equation*}
possible colour patterns.
How many different seating arrangements of ten people around a round table are possible, if no one is considered to be at the “head” or “foot” of the table?
Solution
Solution. 1
Let's use the
Division Rule
, where first we will count a more structured collection. There are \(10!\) ways to line the \(10\) people up. Wrapping the end of the line around to meet the beginning forms a circular seating arrangement. But “rotating” around the line (\(10\) possible rotations) yields an equivalent circular seating arrangement. So the answer is
\begin{equation*} \dfrac{10!}{10} = 9! \text{.} \end{equation*}
Solution. 2
Force one particular person to always be the “start” of the seating arrangement, no matter what physical seat they are sitting in, and ignoring the fact that a circular arrangement really has no “start.” Then there are \(9!\) ways to arrange the remaining \(9\) people around the table starting from the seat to the left of the “start” person.