TITLE: Probability a pair of pairs of rows have the same vector sum
QUESTION [6 upvotes]: Let $X$ be a random square $n$ by $n$ matrix with $X_{i,j} \in \{0,1\}$.  What is the probability that there is a distinct pair of pairs of rows which have the same vector sum?  
If you add two rows elementwise then each entry has $0$ with probability $1/4$, $2$ with probability $1/4$ and $1$ with probability $1/2$ and they are independent.   So if the two pairs are disjoint the probability they are the same is $(1/4^2 + 1/2^2+1/4^2)^n = (3/8)^n$.  If the two pairs have one row in common the probability is $1/2^n$.  
How can you use these facts to give the final probability?

Clarification:
If we let $r_i$ be row $i$ then I want $i,j,k,\ell$ such that $r_i+r_j = r_k+r_{\ell}$ with rule 1)  that we can't have both $i\in \{k,\ell\}$ and  $j \in \{k,\ell\}$ and rule 2) that both $i \ne j$ and  $k \ne \ell$ hold.

REPLY [2 votes]: We'll answer (approximately) the question for $m \times n$ matrices for clarity, and just set $m = n$ at the end.
As you say, for the sum of any two rows $i_1$ and $i_2$, for a particular column $j$, the $j$th entry in the sum of the two rows is $0$ w.p. $\frac14$, $1$ w.p. $\frac24$, and $2$ w.p. $\frac14$, and different columns are independent.
So the probability that two disjoint pairs of rows have the same sum is the probability that in each column position $j$, each of the two pairs has the same sum, which is  $p = (\frac1{4^2} + \frac1{2^2} + \frac1{4^2})^n = (3/8)^n$. The probability that two pairs of rows that share a row in common have the same sum is the probability that in each of the $j$ positions, both of the "other" rows have the same element, which is $q = (1/2)^n$.
Now, to find the probability that there exist some two pairs $\{i, j\} \neq \{k, l\}$ with the same sum, we can use the inclusion-exclusion principle. To the first approximation, the probability is just the sum over all such pairs of pairs:
$$\sum_{\{i, j\} \neq \{k, l\}} \Pr(r_i + r_j = r_k + r_l)$$
To avoid overcounting pairs-of-pairs, let us say we only count those tuples $(i, j, k, l)$ that are in some canonical order, say $i < j$, $k < l$, and the two pairs $(i, j)$ and $(k, l)$ are themselves distinct and in lexicographic order. Then

with $\{i, j\}$ and $\{k, l\}$ disjoint, there are $\frac{m(m-1)(m-2)(m-3)}{8}$ such pairs of pairs — you can arrive at this number as $\frac12 \binom{m}{2}\binom{m-2}{2}$ or as $3\binom{m}{3}$, or whatever, and 
with one row in common (either $i=k$ so that $k = i < j < l$) or $j = k$ so that $i < j = k < l$) or $j = l$ so that $i < k < l = j$), there are $\frac{m(m-1)(m-2)}{2}$ such pairs of pairs.

So the above sum is $$\frac{m(m-1)(m-2)(m-3)}{8}p + \frac{m(m-1)(m-2)}{2}q.$$
This is strictly an upper bound on the probability, as it overcounts cases where multiple pairs of pairs each have the same sum. To refine the sum, we need to consider those cases (the second-order term in the inclusion-exclusion sum).
What is the probability of situations where multiple terms in the above sum are positive (i.e. happen simultaneously)?
There are many ways in which this can happen, but note that terms like $p^2$, $pq$, $qp$ or $q^2$ are all exponentially smaller than the first-order sum. So for large $n$, it is not worth it to care about such terms. The only ways in which multiple events can happen, whose probability is not exponentially smaller, are the ways in which two rows being equal lead to multiple pairs-of-pairs having equal sum. So let's look at these for the second- (and also third- and higher-) order sums.
If two rows $a$ and $b$ are equal, then for every pair-of-pairs like $\{a, i\}$ and $\{b, i\}$, we'll have $r_a + r_i = r_b + r_i$. And there are $(m-2)$ such pairs-of-pairs. And $\binom{m}{2}$ possible pairs $(a, b)$. So the entire inclusion-exclusion sum, if we care about just the $(1/2)^n$ term, would be:
$$ \binom{m}{2}q \left((m-2) - \binom{m-2}{2} + \binom{m-3}{3} - \dots \right)
= \binom{m}{2} q \left(1 - (1-1)^{m-2}\right) \\
= \binom{m}{2} q
$$
This matches the direct calculation as: the probability of some two rows being equal is roughly $\binom{m}{2} (1/2)^n$.
So the answer (to a very high degree of approximation) can be taken to be the above. In fact, for most practical purposes we can approximate further: the above sum is asymptotically (for large $m$ and $n$)
$$\sim \frac{m^2}{2}\frac{1}{2^n} \sim \frac{n^2}{2^{n+1}}$$
when $m=n$.