5
0
rooks want to arrange themselves in a non-attacking position on a
5
0
×
5
0
chessboard such that the arrangement is symmetric about the diagonal from the lower left corner to the upper right corner. They can do this in
N
ways. What are the last five digits of
N
?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
This problem requires more Combinatorics than Computer Science.
First, we notice that since there are as many non-attacking rooks as their are files, there must be an rook in each file. Let's call the rank of the rook in the i'th file r o o k ( i ) .
The symmetry constraint means that for every rook which is some steps above the diagonal, there exists a rook which is exactly the same steps away horizontally from the the same point on the diagonal.
r o o k ( i + ( r o o k ( i ) − i ) ) = i ⟹ r o o k ( r o o k ( i ) ) = i ∀ i
Now, let us have a look at the array of the ranks of the rooks. Two things can happen to each of the rooks:
For example, in the configuration
[1, 2, 3, 4, 8, 7, 6, 5]
, the first four rooks are in the diagonal but the fifth and the 8th rook have paired up and so has the sixth and the seventh rook.
We can choose 2 r rooks from 2 n rooks in ( 2 r 2 n ) ways and then pair them up in 2 r r ! ( 2 r ) ! ways.
Thus, the total number of symmetric arrangements asked is the summation of the possible arrangements when none of them switch ranks, 2 of them switch ranks, 4 of them switch ranks, 6 ... and so on.
f ( 2 n ) = i = 0 ∑ n ( 2 i 2 n ) 2 i i ! ( 2 i ) !
Since you've started on a combinatorial approach, how can we use combinatorial ideas to find the summation?
Since you've started on a combinatorial approach, how can we use combinatorial ideas to find the summation?
Log in to reply
I initially thought that mindlessly counting the solutions to a minizinc model will solve this problem. It didn't obviously work because there was no way I could run through all the solutions. But when I ran the model, with smaller numbers, I realised that there is a lot of structure in the solutions which can be analytically taken care of.
I am not aware of a method that allows me to calculate such a large number by hand. Can you teach me how?
Log in to reply
Hint: A recurrence relation exists, and so that would greatly simplify the calculations. It is "linear" in F n , but the coefficients involve n .
Log in to reply
@Calvin Lin – Let F n be the number of ways of arranging n non-attacking rooks symmetrically on an n × n chessboard. The recurrence relation is F n = F n − 1 + ( n − 1 ) F n − 2 with F 0 = F 1 = 1 .
There are F n − 1 ways of arranging the n rooks symmetrically if the rook in the first column is on the diagonal of symmetry.
There are n − 1 places to put the rook in the first column if it is not on the diagonal of symmetry. If the first column rook goes in row j , then the j th column rook must go in row 1 , and there are F n − 2 ways of arranging the other n − 2 rooks symmetrically.
Performing calculations modulo 1 0 0 0 0 0 in Excel (or elsewhere) makes it a simple matter to evaluate the last 5 digits of F 5 0 .
An alternative way of thinking about this problem is to see that F n is 1 plus the number of permutations in S n whose cycle type contains only transpositions ( 2 -cycles). That leads to the formula ( j being the number of transpositions in the cycle type): F n = j = 0 ∑ ⌊ 2 1 n ⌋ ( 2 j n ) 2 j j ! ( 2 j ) !
Log in to reply
@Mark Hennings – That's great! Different approaches of thinking about the problem can yield different answers.
It could be interesting to show how the closed form of F n could be used to demonstrate the recurrence relation (haven't tried that yet).
Problem Loading...
Note Loading...
Set Loading...
Let r o o k s ( n ) be the number of possibilities for n rooks on n × n chessboard.
We can observe that the following relation realation holds:
r o o k s ( 0 ) = 1
r o o k s ( 1 ) = 1
r o o k s ( n + 2 ) = r o o k s ( n + 1 ) + ( n + 1 ) ∗ r o o k s ( n ) n ≥ 0
This gives in python: