Expected value of $1$'s in a matrix product defined over $\mathbb{Z}_2$

157 Views Asked by At

Let $\mathbf{A}$, $\mathbf{B}$ be random boolean matrices of $n \times n$ size, such that the matrix entry is $1$ with probability $p$ and $0$ otherwise. All entries are independent. How many $1$'s on average will be in the product of matrices, if an addition and multiplication operations are defined over $\mathbb{Z}_2$?

Attempt Briefly, in every matrix cell, I have got an expected value of $(p^2n)\space\text{mod 2}$. In total, $n^2(p^2n\space \text{mod 2})$.

1

There are 1 best solutions below

0
On BEST ANSWER

Forgetting about over $Z_2$ for a second, if we consider the product over $Z$, it is correct that the expected value of each spot is $p^2n$, because each spot is the sum of $n$ independent products of two independent Bernoulli random variables with probability $p$.

However, we can do more than just state the EV of each of these entries; we can calculate the full dist. The product of the two independent Bernoulli random variables is also Bernoulli, with probability $p^2$, so the sum of $n$ (independent) of these is Binomial. So, for each entry in the product matrix, the entry in $Z_2$ is 1 iff this Binomial random variable is odd.

There is a handy trick that the sum of the odd values of a binomial distribution: Sum of odd terms of a binomial expansion: $\sum\limits_{k \text{ odd}} {n\choose k} a^k b^{n-k}$. Using that result, we get that the probability that any one entry in the product matrix (over $Z_2$) is 1 is

$\frac{1}{2}(1-(1-2p^2)^n)$

Because expectation is linear, the expected number of total 1's in the product matrix is

$\frac{n^2}{2}(1-(1-2p^2)^n)$