Binomial Probability Distribution
05-25-2015, 10:11 PM
Post: #3
 Dave Britten Senior Member Posts: 2,237 Joined: Dec 2013
RE: Binomial Probability Distribution
(05-25-2015 09:51 PM)Dieter Wrote:
(05-24-2015 05:58 PM)Dave Britten Wrote:  This program calculates the odds of a specified number of successes from independent trials with a known probability of success.

This requires a combinations function named COMB that calculates nCr. If you need one, see here.

Dave, it looks like your program evaluates COMB in every single loop so that it should not run particulary fast. But there is a simple fix: once nCr is known, the following nCr+1 can be evaluated very easily from this. Even the whole Binomial PDF for x+1 can be calculated from the PDF of the previous x, so that the slow power function in the loop can be avoided as well.

Dieter

Thanks for the tip. I'll see if I can incorporate that. I've just always been doing the looped nCr approach.
 « Next Oldest | Next Newest »

 Messages In This Thread Binomial Probability Distribution - Dave Britten - 05-24-2015, 05:58 PM RE: Binomial Probability Distribution - Dieter - 05-25-2015, 09:51 PM RE: Binomial Probability Distribution - Dave Britten - 05-25-2015 10:11 PM RE: Binomial Probability Distribution - Dieter - 05-25-2015, 10:38 PM RE: Binomial Probability Distribution - Dave Britten - 05-25-2015, 10:51 PM RE: Binomial Probability Distribution - Dave Britten - 05-26-2015, 03:47 PM RE: Binomial Probability Distribution - Dieter - 05-27-2015, 12:51 PM RE: Binomial Probability Distribution - Dieter - 05-26-2015, 10:38 PM RE: Binomial Probability Distribution - Dave Britten - 05-28-2015, 01:44 AM RE: Binomial Probability Distribution - Dieter - 05-28-2015, 11:11 AM

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