12.4. Let $A$ be a square matrix of order $n$, whose elements are the numbers -2019 or 2019.

Determine the maximum value of the determinant of matrix $A$, for: a) $n=3$; b) $n=4$.
## Solution:

a) We observe that $A=2019 \cdot B$, where $B$ is a square matrix of order $n$, whose elements are the numbers -1 or 1. Then $\operatorname{det} A=2019^{n} \operatorname{det} B$. Let $n=3$. We add the elements of the second row of matrix $B$ to the corresponding elements of the first row. We add the elements of the third row of matrix $B$ to the corresponding elements of the first row. We obtain a matrix whose elements in the second and third rows are the numbers $-2, 0$ or 2, which implies $\operatorname{det} B: 4$. Considering that $|\operatorname{det} B| \leq 6$ and the existence, for example, of the matrix $B=\left(\begin{array}{ccc}-1 & 1 & 1 \\ 1 & -1 & 1 \\ 1 & 1 & 1\end{array}\right)$, such that $\operatorname{det} B=4$, we conclude that the maximum value of the determinant of matrix $B$ is equal to 4 and the maximum value of the determinant of matrix $A$ is equal to $4 \cdot 2019^{3}$.

b) By similar reasoning to that in a), we obtain that for $n=4$, $\operatorname{det} B: 8$.

Since the maximum value of the determinant of a square matrix $B$ of order 3 with the mentioned properties is equal to 4, by calculating the value of the determinant of a square matrix $B$ of order 4 through the method of its expansion along a row or column, we obtain that det $B \leq 16$.

The existence, for example, of the matrix $B=\left(\begin{array}{cccc}1 & 1 & 1 & -1 \\ 1 & -1 & 1 & 1 \\ 1 & 1 & -1 & 1 \\ -1 & 1 & 1 & 1\end{array}\right)$, such that $\operatorname{det} B=16$, implies that the maximum value of the determinant of matrix $B$ is equal to 16, and the maximum value of the determinant of matrix $A$ is equal to $16 \cdot 2019^{4}$.