Digital Library of Mathematical Functions
About the Project
NIST
26 Combinatorial AnalysisProperties

§26.15 Permutations: Matrix Notation

The set \mathop{\mathfrak{S}_{{n}}\/}\nolimits26.13) can be identified with the set of n\times n matrices of 0’s and 1’s with exactly one 1 in each row and column. The permutation \sigma corresponds to the matrix in which there is a 1 at the intersection of row j with column \sigma(j), and 0’s in all other positions. The permutation 35247816 corresponds to the matrix

26.15.1\begin{bmatrix}0&0&1&0&0&0&0&0\\
0&0&0&0&1&0&0&0\\
0&1&0&0&0&0&0&0\\
0&0&0&1&0&0&0&0\\
0&0&0&0&0&0&1&0\\
0&0&0&0&0&0&0&1\\
1&0&0&0&0&0&0&0\\
0&0&0&0&0&1&0&0\end{bmatrix}

The sign of the permutation \sigma is the sign of the determinant of its matrix representation. The inversion number of \sigma is a sum of products of pairs of entries in the matrix representation of \sigma:

where the sum is over 1\leq g<k\leq n and n\geq h>\ell\geq 1.

The matrix represents the placement of n nonattacking rooks on an n\times n chessboard, that is, rooks that share neither a row nor a column with any other rook. A permutation with restricted position specifies a subset B\subseteq\{1,2,\ldots,n\}\times\{1,2,\ldots,n\}. If (j,k)\in B, then \sigma(j)\neq k. The number of derangements of n is the number of permutations with forbidden positions B=\{(1,1),(2,2),\ldots,(n,n)\}.

Let r_{j}(B) be the number of ways of placing j nonattacking rooks on the squares of B. Define r_{0}(B)=1. For the problem of derangements, r_{j}(B)=\binom{n}{j}. The rook polynomial is the generating function for r_{j}(B):

If B=B_{1}\cup B_{2}, where no element of B_{1} is in the same row or column as any element of B_{2}, then

26.15.4R(x,B)=R(x,B_{1})\,R(x,B_{2}).

For (j,k)\in B, B\setminus[j,k] denotes B after removal of all elements of the form (j,t) or (t,k), t=1,2,\ldots,n. B\setminus(j,k) denotes B with the element (j,k) removed.

N_{k}(B) is the number of permutations in \mathop{\mathfrak{S}_{{n}}\/}\nolimits for which exactly k of the pairs (j,\sigma(j)) are elements of B. N(x,B) is the generating function:

and

The number of permutations that avoid B is

Example 1

The problème des ménages asks for the number of ways of seating n married couples around a circular table with labeled seats so that no men are adjacent, no women are adjacent, and no husband and wife are adjacent. There are 2(n!) ways to place the wives. Let B=\{(j,j),(j,j+1)\>|\>1\leq j<n\}\cup\{(n,n),(n,1)\}. Then

The solution is

Example 2

The Ferrers board of shape (b_{1},b_{2},\ldots,b_{n}), 0\leq b_{1}\leq b_{2}\leq\cdots\leq b_{n}, is the set B=\{(j,k)\>|\>1\leq j\leq n,1\leq k\leq b_{j}\}. For this set,

If B is the Ferrers board of shape (0,1,2,\ldots,n-1), then

and therefore by (26.8.10),