This is a follow-up to this question: Probability that a random binary matrix is invertible?
The answer says that the probability of a random $\{0,1\}$, $n \times n$ matrix to be invertible is:
$$p(n)=\prod_{k=1}^{n}(1-2^{-k})\;,$$
For a $32\times32$, that's about 0.288.
But, when I generate a random matrix in Matlab, and check its rank, it's always 32! The code is: A=randi([0 1],32,32);rank(A). You can even try it online here.
Is the answer wrong? Is Matlab/Octave wrong? Please help me solve the mystery. Thanks!
That is a special result, for algebra modulo 2, binary. That is what $\mathbb{F}^2$ means.
For any of the following sets of random matrices:
$$ A \in \mathbb{R}^n \times \mathbb{R}^n,\{a_{ij} \sim N(0,1)\}\\ A \in \mathbb{R}^n \times \mathbb{R}^n,\{a_{ij} \sim U[0,1]\}\\ $$
Through any of the following standard commands, respectively:
The matrix has full rank almost surely, being the probability of having a full rank matrix equal to 1, as the standard interpretation of probability under infinite sets, there are possible values, but under a measure not comparable with the whole set measure.
By other side, the following set of random matrices: $$ A \in \mathbb{R}^n \times \mathbb{R}^n,\{a_{ij} \sim U[0,1]\}\\ $$
Realizable throught the command:
The probability of having a full rank matrix is at least $1-(3/4+\sigma(1))^n$.
https://arxiv.org/abs/math/0501313
Probability that a random binary matrix is invertible?
If I generate a random matrix what is the probability of it to be singular?
https://mathoverflow.net/questions/12657/proving-almost-all-matrices-over-c-are-diagonalizable
https://en.wikipedia.org/wiki/Almost_surely