C#: Numerical algorithm to generate numbers from Binomial distribution

前端 未结 3 475
名媛妹妹
名媛妹妹 2021-01-17 22:59

I need to generate random numbers from Binomial(n,p) distribution.

A Binomial(n,p) random variable is sum of n uniform variables which take 1 with probability p. In

3条回答
  •  礼貌的吻别
    2021-01-17 23:26

    There's no obvious way to do this efficiently. For small n, you might as well just us the formula to calculate the inverse PDF. For larger n, you're probably best off using one of the approximations to other distributions that are easier to calculate.

提交回复
热议问题