Find the number of ways in which the nine digits 1,2,3,...,9 can be arranged in a 3*3 square array such that the determinant of this square is an odd integer. Each digit to be used only once.
You guys really need to try this analytically, instead of dueling computer programs - it is a very good problem.
First all I will focus on is parity, there are five odd entries and four even entries. So where can the even entries be in the matrix when the determinant is odd?
First by the pigeon hole principle there is at least one row with two even terms, and at least one column with two even terms.
If the even elements of the row and column are distinct then there is one pattern (disregarding row and column permutations):
0 0 1
1 1 0
1 1 0
Else, the elements intersect at a common entry, leaving the fourth entry to occupy any of the six other locations (disregarding row and column permutations):
0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1
0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 1
1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0
Of these seven patterns, four determinants are even and three are odd. The three odd patters are:
0 0 1 0 0 1 0 0 1
0 1 0 0 1 1 0 1 1
1 1 1 1 0 1 1 1 0
Now to count the possible row and column permutations.
There are 6 possible row permutations and 6 possible column permutations for a total of 36 permutations. But in the first two patterns there are two rows or two columns which have two even entries, so the permutations actually double count those.
So that leaves 36+18+18=72 total possible parity patters.
Now all that is left is to multiply by 5!=120 ways to arrange the odd numbers and 4!=24 ways to arrange the even numbers within each pattern, for a grand total of 72*120*24 = 207360 determinants.