What is the largest determinant you can get by filling in 0,1 or 2 into a 4-by-4 matrix?

For example

$$\left| \begin{array}{ccc} 2 & 0 & 0 & 2 \\ 2 & 0 & 2 & 0 \\ 0 & 2 & 1 & 2 \\ 2 & 2 & 0 & 0 \end{array} \right|=40$$

Can it get bigger than that? And what's your approach?

-
Note you can take a factor $2^4=16$ out and work with 0 and 1. – Mark Bennet Sep 4 '12 at 21:52
I changed it into 0,1 or 2. – Voldemort Sep 4 '12 at 21:54
– user2468 Sep 4 '12 at 22:14

First of all, the option of filling in a "1" can always be avoided because the determinant is always a linear function of any entry. So substituting either 2 or 0 can ensure an equal or bigger determinant.

And if the question is to fill in either 2 or 0, then as Mark Bennet pointed out, it can be simplify into a binary matrix. However, this "simplified" problem is actually a particular case of the very complicated "Hadamard's maximal determinant problem" (MathWorld | Wikipedia). The general solution still has not been discovered yet.

The answer for this particular case is $48=3\times2^4$. And there're 60 different possible matrices that have this determinant.

-

More generally, consider an $n \times n$ matrix whose entries are in $[0,k]$ for some $k > 0$. Since the determinant is an affine function of each matrix element, we may as well assume that each element is $0$ or $k$. Moreover, by scaling, the answer will be $k^n$ times what we would get by replacing $k$ by $1$. Now look up "Hadamard maximal determinant problem". See e.g. https://oeis.org/A003432 and references there.

-

$$\left| \begin{array}{ccc} 2&0 & 2 & 2 \\ 2&2 & 0 & 2 \\ 2&2 & 2 & 0 \\ 0&2 & 2 & 2 \end{array} \right|=48$$

-
professorjava.weebly.com/matrix-determinant.html , this determinant does not equal to 48 – zinking Sep 6 '12 at 2:58
Quite right! I was taking absolute values. I've corrected it. – Byron Schmuland Sep 6 '12 at 12:35