Which matrices give the same probability mass function In a previous question I asked the following.
Consider a fixed (non-random) $3$ by $n$ matrix $M$ whose elements are chosen from $\{-1,1\}$. What is the probability mass function of $Mx$ when $x$ is a random vector with elements chosen independently and uniformly at random from $\{-1,1\}$?
A very nice answer has been given by Justpassingby as follows. First we make the first row of $M$ all $1$s by flipping columns (that is multiplying them by $-1$).  There are now $2^2=4$ different possible types of column and the number each type is denoted by the variable $w_i$.
$$\eqalign{
P\left[Mx=\left(
\begin{matrix}k\\ l\\ m\\ \end{matrix}
\right)\right]
&=2^{-n}\sum_t{w_1 \choose (w_1+t)/2}{w_2 \choose (w_2+\frac{k+m}2-t)/2}{w_3 \choose (w_3+\frac{k+l}2-t)/2}{w_4 \choose (w_4+t-\frac{l+m}2)/2}
}$$
The range of the summation index $t$ is in principle that of $c_1,$ i.e., the set $\{-w_1,-w_1+2,\ldots,w_1-2,w_1\}$ but in practice many of the terms will be zero because of restrictions on the other $c_i.$
Now consider an $n$ by $n$ matrix where all the corresponding $w_i$ terms are either $1$ or $0$. That is, after changing the first row to be all $1$ by flipping columns, all the columns are distinct.

What does an extension of the formula above to $n$ by $n$ matrices
  with this new restriction  tell us about which $n$ by $n$ matrices
  have exactly the same pmf?

 A: Update: this answer is no longer valid because the lemma, which I posted as a separate question here, turns out to be false. I will either delete it or modify it - generally a doubtful action for an accepted answer, but it cannot stand in its current form.
Let $D$ be the $n$-dimensional hypercube
$$D=\left\{(x_1,\ldots,x_n)|\forall i\in\{1,\ldots,n\}\,x_i\in[-1,1]\right\}$$
Let $V$ be the set of its vertices
$$V=\left\{(x_1,\ldots,x_n)|\forall i\in\{1,\ldots,n\}\,x_i\in\{-1,1\}\right\}$$
I think that I can answer the question modulo the following lemma.
Lemma.
If $K$ and $L$ are linearly independent subsets of $V$ and $f:K\to L$ is an isometric bijection, then there exists a global symmetry $\sigma$ of $D$ that restricts to $f$ on $K.$
Now we are ready to consider the question.
If two matrices give the same probability mass function (pmf) then they should give the same covariances. The covariance matrix of $y$ is
$$E[y.y^T]=M.M^T$$
so the matrices should have the same rank (the number of nonzero eigenvalues of $M.M^T$ counting multiplicities).
The problem is stated for $n\times n$ matrices but that is not essentially simpler than general $r\times n$ matrices. If we have an $n\times n$ matrix of rank $k$ then we can write $n-k$ rows as linear combinations of the other $k$ rows; these linear combinations follow from the covariance matrix so our only hope for two different matrices with the same distribution is by looking at the $k$ linearly independent rows. Therefore from now on we consider rectangular $r\times n$ matrices ($r\leq n$) of full rank $r.$
The $r$ rows of $M$ form a linearly independent subset of $V.$ If we have two different matrices with the same pmf then these linearly independent subsets are isometric (because the covariance matrix fixes their distances). By the lemma, there exists a symmetry $\sigma$ of the $n$-hypercube $D$ that maps the rows of the two matrices to each other (in the correct order, we are not allowing permutations of rows because this changes the pmf). But the symmetries of $D$ are generated by reflections in one coordinate (flipping the sign of a column of $M$) and permutations of coordinates (changing the order of columns).
This means that two matrices of the same size give the same pmf if and only if they can be transformed into each other by flipping column signs and exchanging columns.
