Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
How can I generate a random number that has a binomial distribution?
I'm making a simulation in which a random event with probability p is simulated n times, and I want to count up the number of times this happens each step.
Obviously the easiest way would be to make a loop and play it out n times, but the n in my simulation undergoes exponential growth so this would be completely impractical.
Does anyone know a formula or technique I could use to simulate the sum of all these trials? The result should be random each time but follow a binomial distribution in the long term.
Please ask if you're not sure what I'm after.
2 Answers
- MorningfoxLv 71 decade agoFavourite answer
When 'n' is very large, you would get a normal distribution. In most practical cases, n = 1000 is more than large enough, for 0.05 < p < 0.95.
- 1 decade ago
look its a very hectic process , i cant remember the formula , take a book of probability and search in binomial distribution. u will get this in college level probability