# Thread: Determinant calculation - tricky question

1. ## Determinant calculation - tricky question

Let $A(a_{i,j})$ be a $3\times 3$ matrix, such that $a_{i,j}\in \left \{ 1,2,3,...9 \right \}$ and all matrix entries are distinct (no repetitions).
I need to find such A with a maximum determinant.

I can really use some guidance here.

2. ## Re: Determinant calculation - tricky question

Originally Posted by Stormey
Let $A(a_{i,j})$ be a $3\times 3$ matrix, such that $a_{i,j}\in \left \{ 1,2,3,...9 \right \}$ and all matrix entries are distinct (no repetitions).
I need to find such A with a maximum determinant.

I can really use some guidance here.
Hi Stormey!

It can be solved with brute force - a program that iterates over all possibilities.
I found that there are 36 matrices with the maximum which is 412.

The first is:
$\det \begin{bmatrix}1&4&8\\ 7&2&6 \\ 5&9&3\end{bmatrix} = 412$

3. ## Re: Determinant calculation - tricky question

Hi ILikeSerena! loved your profile pic...
thanks for the help.

did you managed to find any constancy?
I mean, what's so special about these matrices (with the maximum determinant)?

I was thinking more like, if:

$detA=a_{11}\cdot a_{22}\cdot a_{33}+a_{12}\cdot a_{23}\cdot a_{31}+a_{13}\cdot a_{21}\cdot a_{32}-(a_{11}\cdot a_{23}\cdot a_{32} +a_{12}\cdot a_{21}\cdot a_{33} +a_{13}\cdot a_{22}\cdot a_{31})$

then I want the expression in the brackets to be as small as possible.
in other words, I want to find the arrangment that'll produce the the smallest sum for:
$x_{1}\cdot x_{2}\cdot x_{3} +x_{4}\cdot x_{5}\cdot x_{6} +x_{7}\cdot x_{8}\cdot x_{9}$ when $x_i\in \left \{ 1,2,3,4,5,6,7,8,9 \right \}$.
but I'm just thinking out loud here, i don't see how can it be solved,
so if you have any more ideas i'd love to hear...

4. ## Re: Determinant calculation - tricky question

Thx!

Yes. The problem is that all those number are used in a positive sense but also in a negative sense.

My first idea was to consider the eigenvalues.
The determinant is the product of the eigenvalues.
The trace is the sum of the eigenvalues.
To find a maximum determinant, the sum should also be maximal, but only if all eigenvalues are positive.
Anyway, that would mean having 7,8,9 on the main diagonal.

That's when I decided to brute force it, to see if my idea was right.
At least I found that 12 matrices have indeed 7,8,9 on their diagonal.

You want a pattern?
Well, take a look yourself.
The solutions are:

$\begin{bmatrix}1&4&8 \\ 7&2&6 \\ 5&9&3\end{bmatrix}\qquad \begin{bmatrix}1&5&7 \\ 8&3&6 \\ 4&9&2\end{bmatrix}\qquad \begin{bmatrix}1&7&5 \\ 4&2&9 \\ 8&6&3\end{bmatrix}\qquad \begin{bmatrix}1&8&4 \\ 5&3&9 \\ 7&6&2\end{bmatrix}\qquad \begin{bmatrix}2&4&9 \\ 7&1&5 \\ 6&8&3\end{bmatrix}$

$\begin{bmatrix}2&6&7 \\ 9&3&5 \\ 4&8&1\end{bmatrix}\qquad \begin{bmatrix}2&7&6 \\ 4&1&8 \\ 9&5&3\end{bmatrix}\qquad \begin{bmatrix}2&9&4 \\ 6&3&8 \\ 7&5&1\end{bmatrix}\qquad \begin{bmatrix}3&5&9 \\ 8&1&4 \\ 6&7&2\end{bmatrix}\qquad \begin{bmatrix}3&6&8 \\ 9&2&4 \\ 5&7&1\end{bmatrix}$

$\begin{bmatrix}3&8&6 \\ 5&1&7 \\ 9&4&2\end{bmatrix}\qquad \begin{bmatrix}3&9&5 \\ 6&2&7 \\ 8&4&1\end{bmatrix}\qquad \begin{bmatrix}4&1&8 \\ 9&5&3 \\ 2&7&6\end{bmatrix}\qquad \begin{bmatrix}4&2&9 \\ 8&6&3 \\ 1&7&5\end{bmatrix}\qquad \begin{bmatrix}4&8&1 \\ 2&6&7 \\ 9&3&5\end{bmatrix}$

$\begin{bmatrix}4&9&2 \\ 1&5&7 \\ 8&3&6\end{bmatrix}\qquad \begin{bmatrix}5&1&7 \\ 9&4&2 \\ 3&8&6\end{bmatrix}\qquad \begin{bmatrix}5&3&9 \\ 7&6&2 \\ 1&8&4\end{bmatrix}\qquad \begin{bmatrix}5&7&1 \\ 3&6&8 \\ 9&2&4\end{bmatrix}\qquad \begin{bmatrix}5&9&3 \\ 1&4&8 \\ 7&2&6\end{bmatrix}$

$\begin{bmatrix}6&2&7 \\ 8&4&1 \\ 3&9&5\end{bmatrix}\qquad \begin{bmatrix}6&3&8 \\ 7&5&1 \\ 2&9&4\end{bmatrix}\qquad \begin{bmatrix}6&7&2 \\ 3&5&9 \\ 8&1&4\end{bmatrix}\qquad \begin{bmatrix}6&8&3 \\ 2&4&9 \\ 7&1&5\end{bmatrix}\qquad \begin{bmatrix}7&1&5 \\ 6&8&3 \\ 2&4&9\end{bmatrix}$

$\begin{bmatrix}7&2&6 \\ 5&9&3 \\ 1&4&8\end{bmatrix}\qquad \begin{bmatrix}7&5&1 \\ 2&9&4 \\ 6&3&8\end{bmatrix}\qquad \begin{bmatrix}7&6&2 \\ 1&8&4 \\ 5&3&9\end{bmatrix}\qquad \begin{bmatrix}8&1&4 \\ 6&7&2 \\ 3&5&9\end{bmatrix}\qquad \begin{bmatrix}8&3&6 \\ 4&9&2 \\ 1&5&7\end{bmatrix}$

$\begin{bmatrix}8&4&1 \\ 3&9&5 \\ 6&2&7\end{bmatrix}\qquad \begin{bmatrix}8&6&3 \\ 1&7&5 \\ 4&2&9\end{bmatrix}\qquad \begin{bmatrix}9&2&4 \\ 5&7&1 \\ 3&6&8\end{bmatrix}\qquad \begin{bmatrix}9&3&5 \\ 4&8&1 \\ 2&6&7\end{bmatrix}\qquad \begin{bmatrix}9&4&2 \\ 3&8&6 \\ 5&1&7\end{bmatrix}$

$\begin{bmatrix}9&5&3 \\ 2&7&6 \\ 4&1&8\end{bmatrix}$

Quick observations:

There are another 12 matrices with 1,2,3 and yet another 12 with 4,5,6 on their main diagonal.

All matrices appear to have the same numbers in their rows, or in their columns.
For instance each matrix has the number 1,5,7 in either a row or a column.

5. ## Re: Determinant calculation - tricky question

OK!
found it.

The permutation that will produce the smallest sum of $x_{1}\cdot x_{2}\cdot x_{3} +x_{4}\cdot x_{5}\cdot x_{6} +x_{7}\cdot x_{8}\cdot x_{9}$ over $\left \{ 1,2,3,4,5,6,7,8,9 \right \}$ is:
$9\cdot 6\cdot 1+8\cdot 5\cdot 2+7\cdot 4\cdot 3$
therfore, it doesn't matter how i'll set up the entries, as long as the sign of every one of these products ( $9\cdot 6\cdot 1/ 8\cdot 5\cdot 2/ 7\cdot 4\cdot 3$), is (-1).
so 9,6,1 for example can be set in $a_{12},a_{21},a_{33}$, since the sign for $\sigma =\bigl(\begin{smallmatrix}1 & 2 & 3\\ 2 & 1 & 3\end{smallmatrix}\bigr)$ is (-1), and so on...

thank you so much.
a little correction, it's not enough to find the amallest sum of $x_{1}\cdot x_{2}\cdot x_{3} +x_{4}\cdot x_{5}\cdot x_{6} +x_{7}\cdot x_{8}\cdot x_{9}$, but also the biggest, which is:
$9\cdot 8\cdot 7+6\cdot 5\cdot 4+3\cdot 2\cdot 1$.