Post Reply 
Binomial Probability Distribution
05-25-2015, 10:51 PM
Post: #5
RE: Binomial Probability Distribution
(05-25-2015 10:38 PM)Dieter Wrote:  
(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

That appears to mesh with what I came up with: COMB(n, r+1)=COMB(n, r)/(r+1)*(n-r).
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Binomial Probability Distribution - Dave Britten - 05-25-2015 10:51 PM



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