How many different determinants are possible by reordering entries?

71 Views Asked by At

I was preparing a worksheet about cofactor expansion of $3\times3$ determinants and decided to create only matrices of order 3 whose entries are among $\pm1,\pm2,\dots,\pm9$ such that the absolute value of the entries form the set $\{1,2,\dots,9\}$. For example: $$\begin{bmatrix}-9&7&-4\\-2&5&6\\1&3&8 \end{bmatrix}\mbox{ has determinant 0.}$$

I was very surprised when I realized that by using only these values, I can create matrices with determinants $0,1,2,\dots,9$ and about other 20 values smaller than 100. Of course, we can create negative determinants if we just permute a pair of rows in the matrix so I will focus only on the nonnegative values of the determinant.

Let $D$ be the set of possible values of the determinant of a matrix created in this way.

Question 1: Is there a way to find $D$?

Question 2: Can $D$ be described as a sequence of consecutive integers? If not, what is the largest sequence of consecutive integers included in $D$

There are $9!\times 2^9=185,794,560$ matrices of order 3 that can be computed in this way. This large number brings me hope that we can find a large sequence of consecutive integers included in $D$.

1

There are 1 best solutions below

0
On BEST ANSWER

(this doesn't help in analytical solution, or gives any interesting properties, posting per question author request)

We can bruteforce all variants with simple python code:

from itertools import permutations
def det(A):
  return A[0][0] * (A[1][1] * A[2][2] - A[2][1] * A[1][2]) - A[0][1] * (A[1][0] * A[2][2] - A[1][2] * A[2][0]) + A[0][2] * (A[1][0] * A[2][1] - A[1][1] * A[2][0])
masks = [[(1 if (b & (1 << i)) == 0 else -1) for i in range(9)] for b in range(512)]
values = set()
for a in permutations(list(range(1, 10))):
  if a[0] != 1:
    continue
  for m in masks:
    A = [a[i] * m[i] for i in range(9)]
    values.add(abs(det([A[0:3], A[3:6], A[6:9]])))
m = max(values)
print(m, [x for x in range(m) if x not in values])

921 [891, 895, 897, 904, 908, 909, 911, 913, 915, 918, 920]

The first number $921$ is maximum determinant we can get, the rest are values less than $921$ that we can't get. To speedup things a bit we assume that top left element is $\pm 1$.