Post Reply 
Binomial Probability Distribution
05-25-2015, 10:38 PM (This post was last modified: 05-25-2015 10:40 PM by Dieter.)
Post: #4
RE: Binomial Probability Distribution
(05-25-2015 10:11 PM)Dave Britten Wrote:  Thanks for the tip. I'll see if I can incorporate that. I've just always been doing the looped nCr approach.

I just tried it and it works well.
Let n and p be the distribution parameters, and k1 resp. k2 the lower/upper bound of the random variable. Then this is the basic idea:
  • Calculate Comb(n, k1).
  • Use this to calculate the probability B(k1,n,p).
    This is the initial value of the sum you want to get.
  • Repeat the following loop k2–k1 times:
  • Calculate B(k+1) = B(k) * (n–k)/(k+1) * p/(1–p)
  • Add this to the sum, increase k by 1.
You can even prestore the constant p/(1–p) so that it has to be calculated only once.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Binomial Probability Distribution - Dieter - 05-25-2015 10:38 PM



User(s) browsing this thread: 1 Guest(s)