Skip to main content

Introduction to Discrete Mathematics

Chapter 3 Permutations

For \(n\in\mathbb{N}\text{,}\) we define \({[n]:=\{1,2,\ldots,n\}}\text{.}\) That is, \([n]\) is just clever shorthand for the set containing 1 through \(n\text{.}\) This notation is meant to resemble interval notation.
For \(k\in\mathbb{N}\) and a nonempty set \(A\text{,}\) a \(k\)-permutation of \(A\) is an injective function \(w:[k]\to A\text{.}\) The set of all \(k\)-permutations of \(A\) is denoted by \({S_{A,k}}\text{.}\) If \(A\) happens to be the set \([n]\text{,}\) we use the notation \({S_{n,k}}\text{.}\) And if \(n=k\text{,}\) we write \({S_n:=S_{n,n}}\) and refer to each \(n\)-permutation in \(S_n\) as a permutation. Let \({P(n,k):=|S_{n,k}|}\text{.}\) By convention, we set \({P(n,0):=1}\text{,}\) including the case when \(n=0\text{.}\)

Problem 3.1.

Complete the following.
  1. Write down all of the elements in \(S_3\text{.}\) What is \(P(3,3)\text{?}\)
  2. Write down all of the elements in \(S_{4,3}\text{.}\) What is \(P(4,3)\text{?}\)
The game of chess is played on an \(8\times 8\) grid. We will consider chessboards with arbitrary dimensions, say \(n\times k\) (\(n\) rows, \(k\) columns) with \(1\leq k \leq n\text{.}\) A rook is a castle-shaped piece that can move horizontally or vertically any number of squares. In a typical chess game, there are two black rooks and two white rooks, but for our purposes we will assume we have \(k\) rooks, where all the rooks are the same color. We say that an arrangement of rooks on an \(n\times k\) chessboard is non-attacking if no two rooks lie in the same row or column. FigureΒ 3.1 shows one possible non-attacking rook arrangement on an \(6\times 4\) chessboard.
Four non-attacking rooks on a six by four chessboard.
A non-attacking rook arrangement on a \(6\times 4\) chessboard. Four rooks are placed such that no two occupy the same row or column.
Figure 3.1. A non-attacking rook arrangement on a \(6\times 4\) chessboard. Four rooks are placed such that no two occupy the same row or column.

Problem 3.2.

Consider the collection of \(k\)-permutations in \(S_{n,k}\) with \(1\leq k\leq n\text{.}\) Explain why \(P(n,k)\) is equal to the number of non-attacking rook arrangements on an \(n\times k\) chess board. Hint: Establish a bijection between the collection of non-attacking rook arrangements on an \(n\times k\) chess board and the collection of \(k\)-permutations.
Recall that for \(n\in\mathbb{N}\text{,}\) the factorial of \(n\) is defined \({n!:=n\cdot (n-1)\cdots 2\cdot 1}\text{,}\) and we define \({0!:=1}\) for convenience.
Note that as a special case of the formula above, we have \(|S_n|=P(n,n)=n!\) and we obtain
\begin{equation*} {P(0,0)=\frac{0!}{(0-0)!}=1} \text{ and } {P(n,0)=\frac{n!}{(n-0)!}=1.} \end{equation*}
We can think of a \(k\)-permutation as a linearly-ordered arrangement (i.e., string) of \(k\) of \(n\) objects. That is, we can denote a \(k\)-permutation as a string \(w=w(1)w(2)\cdots w(k)\text{,}\) where each \(w(i)\in [n]\) and \(w(i)\neq w(j)\) for \(i\neq j\text{.}\) For example, if \(n=6\) and \(k=4\text{,}\) then the string \(3624\) represents the \(4\)-permutation \(w:[4]\to [6]\) given by
\begin{equation*} w(1)=3, w(2)=6, w(3)=2,w(4)=4\text{.} \end{equation*}
Do you see why this \(4\)-permutation corresponds to the non-attacking rook arrangement in FigureΒ 3.1?
In the case when \(n=k\text{,}\) we can denote a permutation as a string \(w=w(1)w(2)\cdots w(n)\text{,}\) where each entry \(w(i)\) appears once. For example, the string \(w=241365\) represents the bijection \(w:[6]\to [6]\) given by
\begin{equation*} w(1)=2, w(2)=4, w(3)=1, w(4)=3, w(5)=6, w(6)=5\text{.} \end{equation*}

Problem 3.4.

How many strings of length three are there using letters from \(\{a,b,c,d,e,f,g\}\) if the letters in the string are not repeated?

Problem 3.5.

There are 8 finalists at the Olympic Games 100 meters sprint. Assume there are no ties.
  1. How many ways are there for the runners to finish?
  2. How many ways are there for the runners to get gold, silver, bronze?
  3. How many ways are there for the runners to get gold, silver, bronze given that Usain Bolt is sure to get the gold medal?

Problem 3.6.

If \(1\leq k\leq n\text{,}\) prove that \({P(n,k)=P(n-1,k)+kP(n-1,k-1)}\text{,}\) both using the formula in TheoremΒ 3.3, and separately using the definition of \(k\)-permutations together with Product and Sum Principles. The latter approach is an example of a combinatorial proof.
The formula in the previous problem is an example of a recurrence relation, which will be a topic of focus in a later chapter.
Interpreting a permutation as a linearly ordered arrangement of objects (i.e., string), a circular permutation is similar to a permutation except the objects are arranged on a circle, so that there is no beginning or end. An example of a circular permutation of length 8 is given in FigureΒ 3.2. Any circular rotation yields the same circular permutation. However, for \(n\geq 3\text{,}\) reversing the relative order of the elements (i.e., encountering the same numbers counterclockwise instead of clockwise) yields a different circular permutation. Do you see why we included the restriction on \(n\) in the previous sentence?
Circular permutation of the numbers one through eight.
Example of a circular permutation for \(n=8\text{.}\) Reading the numbers clockwise, we encounter 1, 4, 5, 2, 8, 7, 3, 6.
Figure 3.2. Example of a circular permutation for \(n=8\text{.}\)
We encountered circular permutations back in ProblemΒ 1.39 when we counted circular seating arrangements of six friends sitting around a circle to play a game. Recall that the trick in that problem was to make use of the Division Principle.

Problem 3.7.

How many circular permutations are there of length \(n\text{?}\)
Moving away from circular permutations and back to \(k\)-permutations, recall that we can represent each \(k\)-permutation of \([n]\) as a string of length \(k\text{,}\) where each entry is from \([n]\) and no repeats are allowed. What if we allow repeats?

Problem 3.8.

How many ways can the letters of the word PRESCOTT be arranged?

Problem 3.9.

How many ways can the letters of the word POPPY be arranged? Try to solve this problem in two different ways.
Consider a set of \(n\) objects that are not necessarily distinct, with \(p\) different types objects and \(n_i\) objects of type \(i\) (for \(i=1,2,\ldots, p\)), so that \(n=n_1+\cdots +n_p\text{.}\) An ordered arrangement of these \(n\) objects is called a generalized permutation and the number of such arrangements is denoted by \({P(n;n_1,\ldots,n_p)}\text{.}\) For example, the number of words we can make out of the letters of POPPY is \(P(5;3,1,1)\text{.}\) The following theorem follows immediately from the Division Principle.

Problem 3.11.

How many ways can the letters of the word MISSISSIPPI be arranged?

Problem 3.12.

In Professor X’s class of 9 graduate students she will give two A’s, one B, and six C’s. How many possible ways are there to do this?

Problem 3.13.

Let’s revisit ProblemΒ 1.15, which involved my walk to get coffee. When we attacked that problem, we did a lot of brute force. Do we now have an easier method?

Problem 3.14.

In how many ways can a deck of 52 cards be dealt to four players, say \(N\text{,}\) \(E\text{,}\) \(S\text{,}\) and \(W\text{?}\)