Given a random square matrix of size $n\times n$ in the field $\mathbb F_2$, what is the probability that its determinant is $1$? (This is also the probability that the matrix is non-singular, since $\mathbb F_2$ only has the elements $0$ and $1$.)
-
1Just to supplement jpescter's answer, here is the link to a question of mine on SO, which gives Mathematica program to generate non-singular random matrices over $Z_p$. It also gives the link to the Dana Randal's article, where the algorithm was taken from. – Sasha Nov 22 '11 at 13:56
-
Generalized to finite fields $\mathbb{F}_q$ (with $q$ prime) in https://math.stackexchange.com/questions/1399406/what-is-the-number-of-invertible-n-times-n-matrices-in-operatornamegl-nf. – tparker Aug 16 '20 at 19:15
1 Answers
The probability that a matrix over $\mathbb{F}_2$ has determinant $1$ is
$$\frac{|SL_n(\mathbb{F}_2)|}{|\mathcal{M}_n(\mathbb{F}_2)|} = \frac{\displaystyle\prod_{k=0}^{n-1}(2^n - 2^k)}{2^{n^2}} = \prod_{k=1}^{n} \Big(1 - \frac{1}{2^k} \Big).$$
More generally, the probability that a matrix over $\mathbb{F}_q$ has determinant 1 is
$$\frac{|SL_n(\mathbb{F}_q)|}{|\mathcal{M}_n(\mathbb{F}_q)|} = \frac{\frac{1}{q-1}\displaystyle\prod_{k=0}^{n-1}(q^n - q^k)}{q^{n^2}} = \frac{1}{q-1}\prod_{k=1}^{n} \Big(1 - \frac{1}{q^k} \Big).$$
For an explanation on how to calculate $|SL_n(\mathbb{F}_q)|,$ see this note by Gabe Cunningham.
As this is too long for a comment, I've posted it as an addendum to my original answer. The probability does indeed converge to a positive limit as $n\rightarrow \infty.$ Observe,
$$\begin{align} \log \left(\prod_{n \in \mathbb{Z}_+}(1 - \frac{1}{q^n}) \right) &= \sum_{n \in \mathbb{Z}_+} \log \Big(1 - \frac{1}{2^n} \Big) \\ &= -\sum_{n \in \mathbb{Z}_+} \sum_{k \in \mathbb{Z}_+} \frac{1}{k} \left( \frac{1}{q^n} \right)^k \\ &= -\sum_{k \in \mathbb{Z}_+} \frac{1}{k} \left(\sum_{n \in \mathbb{Z}_+} \Big(\frac{1}{q^{k}} \Big)^n \right) \\ &= -\sum_{k \in \mathbb{Z}_+} \frac{1}{k} \left(\frac{q^{-{k}}}{1 - q^{-{k}}} \right) \\ &= -\sum_{k \in \mathbb{Z}_+} \frac{1}{k} \left(\frac{1}{q^{k} -1} \right) \\ &\gt -q\sum_{k \in \mathbb{Z}_+} \frac{1}{k} \Big(\frac{1}{q} \Big)^k \\ &= \log(1/q^q). \end{align} $$
It follows $\displaystyle\prod_{n \in \mathbb{Z}_+} \Big(1 - \frac{1}{q^n} \Big) > 1/q^q$, so the product converges.
-
At a glance from the plot, it seems that this function converges to something above 0.28; is that possible? And if not, is it possible to give asymptotics? – FUZxxl Oct 09 '11 at 23:52
-
Sorry, I mistyped... It seems to converge to 0.288788..., but it might also be that it just falls infinitly, but extremly slow. – FUZxxl Oct 09 '11 at 23:57
-
2It seems that there is something called $q$-Pochhammer symbol, such that $\prod^n_{k=1}(1-2^{-k})=(1/2;1/2)n$. It seems that this actually converges: $(1/2;1/2)\infty=0.2887880950866\dots$ – FUZxxl Oct 10 '11 at 00:02
-
2
-
2The infinite product $\displaystyle \prod_{k=1}^\infty (1 - 2^{-k})$ does converge to a nonzero value because $\displaystyle \sum_{k=1}^\infty 2^{-k}$ converges. The result might be denoted by the Q-Pochhammer symbol $(1/2; 1/2)\infty$. I don't know if there's any simpler expression than that. You could also write it as $\sum{k=1}^\infty a(k) 2^{-k}$ where $a(k)$ is the number of partitions of $k$ into an odd number of distinct positive integers minus the number of partitions into an even number of distinct positive integers. – Robert Israel Oct 10 '11 at 00:31
-
Shouldn't you be evaluating the ratio for $SL_n$ rather than $GL_n$? It would seem you've only computed the probability a matrix is invertible instead of the probability it has determinant 1. Also, for completeness, I think you could also do a general calculation for $\mathbb{F}_q$ and provide links on how the order of matrix groups over finite fields are actually derived. – anon Oct 10 '11 at 00:59
-
@anon. We're working over $\mathbb{F}_2$ so $SL_n = GL_n.$ I think the downvote is uncalled for. – jspecter Oct 10 '11 at 01:03
-
@jspecter: I didn't downvote (the score is +3,-0 in case you can't see it yourself at this time). You're right they coincide for $q=2$, but perhaps you could have mentioned that or why it was true? – anon Oct 10 '11 at 01:07
-
@ anon. My b. Someone must have taken away their vote. I'll incorporate a remark about the general case. – jspecter Oct 10 '11 at 01:09
-
2For $n\geq 3$ we don't have $SL_n = GL_n $ anymore so I think the generalization part should read "determinant 0" instead of "determinant 1". – Ragib Zaman Oct 10 '11 at 03:09
-
1@RagibZaman: I assume you mean $q \ge 3$, not $n \ge 3$. It's easy to see that $SL_n$ has index $q-1$ in $GL_n$, since determinant is a homomorphism of $GL_n$ onto the multiplicative group of ${\mathbb F}_q$. – Robert Israel Oct 10 '11 at 19:53
-
The lower bound's proof seems to be wrong. $\frac{1}{q^k - 1} > \frac{1}{q^k}$, so because of the minus sign the inequality is in the wrong direction. Also, $-q \sum_{k \in \mathbb{Z}^+} \frac{1}{k} \left(\frac{1}{q}\right)^k = \log\left(\left(1 - \frac{1}{q}\right)^q\right)$, not $\log\left(\frac{1}{q^q}\right)$. – qbt937 Sep 12 '20 at 06:32
-
It looks like I was wrong about the inequality. I had missed the $q$ getting multiplied out front. With that, it works because $q^k - 1 \ge q^{k-1}$ so $\frac{1}{q^{k}-1} \le \frac{q}{q^k}$. But I still think the final lower bound should be $\log\left(\left(1 - \frac1q\right)^q\right)$. – qbt937 Feb 16 '23 at 00:35