Hi,

I have n binary variables all having the same probability p of flipping. Probability is low, so I wouldn't want to go through generating a random number for every one of them in order to flip their value. I know that the expected number of flips for the n variables is m = n*p. I could use this number to generate m random indexes and proceed by flipping the variables indexed by them, but somehow I'm not quite satisfied with it because in a random process it will not be always the case that m elements will be flipped. Is there an efficient way to simulate the variance around m?

Thank you!

Stan

I have n binary variables all having the same probability p of flipping. Probability is low, so I wouldn't want to go through generating a random number for every one of them in order to flip their value. I know that the expected number of flips for the n variables is m = n*p. I could use this number to generate m random indexes and proceed by flipping the variables indexed by them, but somehow I'm not quite satisfied with it because in a random process it will not be always the case that m elements will be flipped. Is there an efficient way to simulate the variance around m?

Thank you!

Stan

Last edited: