I have a biased coin with the probability of flipping heads as $p$. I have a room of $n$ people and they each have this same coin. I ask everybody to flip their coins, and record their results as an $n$-dimensional vector of ones (heads) and zeros (tails) like [1 0 0 1 0 ...]
I do this many times, and I measure the average squared euclidean distance between any two n-dimensional vectors.
The result seems to be that on average, the squared euclidean distance between any of these two vectors is:
$2np(1-p)$
Why is this the case? This looks to me like twice the variance of a binomial distribution, but I have no idea why or how to derive that...
Context: I'm trying to understand a paper on a theoretical model of brain activity http://dx.doi.org/10.1016/j.neuron.2014.07.035 and I simplified the problem to coin flips for ease of explanation. :) I ran some simulations on the coin flip problem and it seems to check out.