# What is the average value of the determinant of matrices in this set? [duplicate]

State true or false. Let $n \geq 2$ be a natural number. Let $S$ be the set of all $n \times n$ real matrices whose entries are only $0, 1$ or $2$. Then the average of determinants of matrices in $S$ is greater than or equal to $1$.

This is how I think the answer should go, but I am not fully convinced.

False. The average value is zero. There are only finitely many matrices in $S$, and we can exhibit a one-to-one correspondence between the matrices with non-zero determinants as follows: given $A \in S$ with positive determinant, interchanging the first two columns of $A$ gives us a matrix in $S$ with negative determinant. As this function has an inverse (itself) it is bijective. Thus, the average value of the determinant of matrices in $S$ is zero.

Since the entries of $A$ can only be $0,1,2$, we have that $S$ is a finite set of $3^{n^2}$ elements. Note that an average matrix of $S$, is created by picking $n^2$ independent variables $x_1,...,x_{n^2}$ identically distributed from $\{0,1,2\}$ and putting these together into a matrix. Clearly, the expectation of each $x_i$ is $1$.
With this setup, if we want to calculate the determinant of the matrix, then first of all, remember that the determinant is polynomial in the entries of the matrix i.e. $\det A = p(a_{ij})$. Now,what is the expectation of $p(a_{ij})$? By independence and the summation property, it's just $p(E(a_{ij}))$, which is just $p(\mathbf 1)$, the matrix with all entries $1$. The determinant of such a matrix is $0$. Hence, it follows that the average determinant of an element of $S$ is also $0$.