pmrdk
05-11-2010, 02:05 PM
Hi!
I wish to do the following:
I have two vectors with N elements in each. All elements are set to zero.
Now, in each vector I select n indices at random and set the corresponding elements to 1.
My goal is to calculate the expected overlap between the vectors as a function of n. That is, how many elements have 1 in both vectors.
Initially I thought about using the binomial distribution with probability p=(n/N)*(n/N), but clearly this is incorrect, since we have the constraint that only n elements should have the value 1. Therefore we have not n independent trails. I also cannot apply the hyper-geometric distribution directly, since we consider two random variables.
Any thoughts? :confused:
I wish to do the following:
I have two vectors with N elements in each. All elements are set to zero.
Now, in each vector I select n indices at random and set the corresponding elements to 1.
My goal is to calculate the expected overlap between the vectors as a function of n. That is, how many elements have 1 in both vectors.
Initially I thought about using the binomial distribution with probability p=(n/N)*(n/N), but clearly this is incorrect, since we have the constraint that only n elements should have the value 1. Therefore we have not n independent trails. I also cannot apply the hyper-geometric distribution directly, since we consider two random variables.
Any thoughts? :confused: