Rook polynomial
In combinatorial mathematics, a rook polynomial is a generating polynomial of the number of ways to place non-attacking rooks on a board that looks like a checkerboard; that is, no two rooks may be in the same row or column. The board is any subset of the squares of a rectangular board with m rows and n columns; we think of it as the squares in which one is allowed to put a rook. The board is the ordinary chessboard if all squares are allowed and m = n = 8 and a chessboard of any size if all squares are allowed and m = n. The coefficient of x k in the rook polynomial RB is the number of ways k rooks, none of which attacks another, can be arranged in the squares of B. The rooks are arranged in such a way that there is no pair of rooks in the same row or column. In this sense, an arrangement is the positioning of rooks on a static, immovable board; the arrangement will not be different if the board is rotated or reflected while keeping the squares stationary. The polynomial also remains the same if rows are interchanged or columns are interchanged.
The term "rook polynomial" was coined by John Riordan.
Despite the name's derivation from chess, the impetus for studying rook polynomials is their connection with counting permutations with restricted positions. A board B that is a subset of the n × n chessboard corresponds to permutations of n objects, which we may take to be the numbers 1, 2,..., n, such that the number aj in the j-th position in the permutation must be the column number of an allowed square in row j of B. Famous examples include the number of ways to place n non-attacking rooks on:
- an entire n × n chessboard, which is an elementary combinatorial problem;
- the same board with its diagonal squares forbidden; this is the derangement or "hat-check" problem;
- the same board without the squares on its diagonal and immediately above its diagonal, which is essential in the solution of the problème des ménages.
Definition
The rook polynomial RB of a board B is the generating function for the numbers of arrangements of non-attacking rooks:where rk is the number of ways to place k non-attacking rooks on a board of m rows and n columns. There is a maximum number of non-attacking rooks the board can hold; indeed, there cannot be more rooks than the smaller of the number of rows and columns in the board.
Complete boards
The first few rook polynomials on square n × n boards are :In words, this means that on a 1 × 1 board, 1 rook can be arranged in 1 way, and zero rooks can also be arranged in 1 way ; on a complete 2 × 2 board, 2 rooks can be arranged in 2 ways, 1 rook can be arranged in 4 ways, and zero rooks can be arranged in 1 way; and so forth for larger boards.
For complete m × n rectangular boards Bm,n we write Rm,n := RBm,n . The smaller of m and n can be taken as an upper limit for k, since obviously rk = 0 if k > min. This is also shown in the formula for Rm,n.
The rook polynomial of a rectangular chessboard is closely related to the generalized Laguerre polynomial Lnα by the identity
Matching polynomials
A rook polynomial is a special case of one kind of matching polynomial, which is the generating function of the number of k-edge matchings in a graph.The rook polynomial Rm,n corresponds to the complete bipartite graph Km,n . The rook polynomial of a general board B ⊆ Bm,n corresponds to the bipartite graph with left vertices v1, v2,..., vm and right vertices w1, w2,..., wn and an edge viwj whenever the square is allowed, i.e., belongs to B. Thus, the theory of rook polynomials is, in a sense, contained in that of matching polynomials.
We deduce an important fact about the coefficients rk, which we recall given the number of non-attacking placements of k rooks in B: these numbers are unimodal, i.e., they increase to a maximum and then decrease. This follows from the theorem of Heilmann and Lieb about the zeroes of a matching polynomial, which implies that all the zeroes of a rook polynomial are negative real numbers.
Connection to matrix permanents
For incomplete square n × n boards, computing the number of ways to place n rooks on the board is equivalent to computing the permanent of a 0–1 matrix.Complete rectangular boards
Rooks problems
A precursor to the rook polynomial is the classic "Eight rooks problem" by H. E. Dudeney in which he shows that the maximum number of non-attacking rooks on a chessboard is eight by placing them on one of the main diagonals. The question asked is: "In how many ways can eight rooks be placed on an 8 × 8 chessboard so that neither of them attacks the other?" The answer is: "Obviously there must be a rook in every row and every column. Starting with the bottom row, it is clear that the first rook can be put on any one of eight different squares. Wherever it is placed, there is the option of seven squares for the second rook in the second row. Then there are six squares from which to select the third row, five in the fourth, and so on. Therefore the number of different ways must be 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320".The same result can be obtained in a slightly different way. Let us endow each rook with a positional number, corresponding to the number of its rank, and assign it a name that corresponds to the name of its file. Thus, rook a1 has position 1 and name "a", rook b2 has position 2 and name "b", etc. Then let us order the rooks into an ordered list by their positions. The diagram on Fig. 1 will then transform in the sequence. Placing any rook on another file would involve moving the rook that hitherto occupied the second file to the file, vacated by the first rook. For instance, if rook a1 is moved to "b" file, rook b2 must be moved to "a" file, and now they will become rook b1 and rook a2. The new sequence will become. In combinatorics, this operation is termed permutation, and the sequences, obtained as a result of the permutation, are permutations of the given sequence. The total number of permutations, containing 8 elements from a sequence of 8 elements is 8!.
To assess the effect of the imposed limitation "rooks must not attack each other", consider the problem without such limitation. In how many ways can eight rooks be placed on an 8 × 8 chessboard? This will be the total number of combinations of 8 rooks on 64 squares:
Thus, the limitation "rooks must not attack each other" reduces the total number of allowable positions from combinations to permutations which is a factor of about 109,776.
A number of problems from different spheres of human activity can be reduced to the rook problem by giving them a "rook formulation". As an example: A company must employ n workers on n different jobs and each job must be carried out only by one worker. In how many ways can this appointment be done?
Let us put the workers on the ranks of the n × n chessboard, and the jobs − on the files. If worker i is appointed to job j, a rook is placed on the square where rank i crosses file j. Since each job is carried out only by one worker and each worker is appointed to only one job, all files and ranks will contain only one rook as a result of the arrangement of n rooks on the board, that is, the rooks do not attack each other.
The rook polynomial as a generalization of the rooks problem
The classical rooks problem immediately gives the value of r8, the coefficient in front of the highest order term of the rook polynomial. Indeed, its result is that 8 non-attacking rooks can be arranged on an 8 × 8 chessboard in r8 = 8! = 40320 ways.Let us generalize this problem by considering an m × n board, that is, a board with m ranks and n files. The problem becomes: In how many ways can one arrange k rooks on an m × n board in such a way that they do not attack each other?
It is clear that for the problem to be solvable, k must be less or equal to the smaller of the numbers m and n; otherwise one cannot avoid placing a pair of rooks on a rank or on a file. Let this condition be fulfilled. Then the arrangement of rooks can be carried out in two steps. First, choose the set of k ranks on which to place the rooks. Since the number of ranks is m, of which k must be chosen, this choice can be done in ways. Similarly, the set of k files on which to place the rooks can be chosen in ways. Because the choice of files does not depend on the choice of ranks, according to the products rule there are ways to choose the square on which to place the rook.
However, the task is not yet finished because k ranks and k files intersect in k2 squares. By deleting unused ranks and files and compacting the remaining ranks and files together, one obtains a new board of k ranks and k files. It was already shown that on such board k rooks can be arranged in k! ways. Therefore, the total number of possible non-attacking rooks arrangements is:
For instance, 3 rooks can be placed on a conventional chessboard in ways. For k = m = n, the above formula gives rk = n! that corresponds to the result obtained for the classical rooks problem.
The rook polynomial with explicit coefficients is now:
If the limitation "rooks must not attack each other" is removed, one must choose any k squares from m × n squares. This can be done in:
If the k rooks differ in some way from each other, e.g., they are labelled or numbered, all the results obtained so far must be multiplied by k!, the number of permutations of k rooks.
Symmetric arrangements
As a further complication to the rooks problem, let us require that rooks not only be non-attacking but also symmetrically arranged on the board. Depending on the type of symmetry, this is equivalent to rotating or reflecting the board.Symmetric arrangements lead to many problems, depending on the symmetry condition.
The simplest of those arrangements is when rooks are symmetric about the centre of the board. Let us designate with Gn the number of arrangements in which n rooks are placed on a board with n ranks and n files. Now let us make the board to contain 2n ranks and 2n files. A rook on the first file can be placed on any of the 2n squares of that file. According to the symmetry condition, placement of this rook defines the placement of the rook that stands on the last file − it must be arranged symmetrically to the first rook about the board centre. Let us remove the first and the last files and the ranks that are occupied by rooks. This will give a board of 2n − 2 files and 2n − 2 ranks. It is clear that to each symmetric arrangement of rooks on the new board corresponds a symmetric arrangement of rooks on the original board. Therefore, G2n = 2nG2n − 2. By iterating the above formula one reaches to the case of a 2 × 2 board, on which there are 2 symmetric arrangements. As a result of this iteration, the final expression is G2n = 2nn! For the usual chessboard, G8 = 24 × 4! = 16 × 24 = 384 centrally symmetric arrangements of 8 rooks. One such arrangement is shown in Fig. 2.
For odd-sized boards there is always a square that does not have its symmetric double − this is the central square of the board. There must always be a rook placed on this square. Removing the central file and rank, one obtains a symmetric arrangement of 2n rooks on a 2n × 2n board. Therefore, for such board, once again G2n + 1 = G2n = 2nn!
A little more complicated problem is to find the number of non-attacking arrangements that do not change upon 90° rotation of the board. Let the board have 4n files and 4n ranks, and the number of rooks is also 4n. In this case, the rook that is on the first file can occupy any square on this file, except the corner squares. There are another 3 rooks that correspond to that rook and they stand, respectively, on the last rank, the last file, and the first rank. Removing the files and ranks of those rooks, one obtains the rook arrangements for a × board with the required symmetry. Thus, the following recurrence relation is obtained: R4n = R4n − 4, where Rn is the number of arrangements for a n × n board. Iterating, it follows that R4n = 2n...1. The number of arrangements for a × board is the same as that for a 4n × 4n board; this is because on a × board, one rook must necessarily stand in the centre and thus the central rank and file can be removed. Therefore R4n + 1 = R4n. For the traditional chessboard, R8 = 4 × 3 × 1 = 12 possible arrangements with rotational symmetry.
For × and × boards, the number of solutions is zero. Two cases are possible for each rook: either it stands in the centre or it doesn't stand in the centre. In the second case, this rook is included in the rook quartet that exchanges squares on turning the board at 90°. Therefore, the total number of rooks must be either 4n or 4n + 1. This proves that R4n + 2 = R4n + 3 = 0.
The number of arrangements of n non-attacking rooks symmetric to one of the diagonals on a n × n board is given by the telephone numbers defined by the recurrence Qn = Qn − 1 + Qn − 2. This recurrence is derived in the following way. Note that the rook on the first file either stands on the bottom corner square or it stands on another square. In the first case, removal of the first file and the first rank leads to the symmetric arrangement n − 1 rooks on a × board. The number of such arrangements is Qn − 1. In the second case, for the original rook there is another rook, symmetric to the first one about the chosen diagonal. Removing the files and ranks of those rooks leads to a symmetric arrangement n − 2 rooks on a × board. Since the number of such arrangements is Qn − 2 and the rook can be put on the n − 1 square of the first file, there are Qn − 2 ways for doing this, which immediately gives the above recurrence. The number of diagonal-symmetric arrangements is then given by the expression:
This expression is derived by partitioning all rook arrangements in classes; in class s are those arrangements in which s pairs of rooks do not stand on the diagonal. In exactly the same way, it can be shown that the number of n-rook arrangements on a n × n board, such that they do not attack each other and are symmetric to both diagonals is given by the recurrence equations B2n = 2B2n − 2 + B2n − 4 and B2n + 1 = B2n.