Binomial Probability Distribution
05-28-2015, 11:11 AM
Post: #10
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Binomial Probability Distribution
(05-28-2015 01:44 AM)Dave Britten Wrote:  Good idea with the early exit. I'll have to play around with that a bit.

Here is an update with the Comb loop counting up the denominator:

Code:
.. ... 21 x>y?     // min(n, n-k1) = 0 ? 22 GTO 03   // then Comb=1, skip Comb loop 23 RCL 01 24 LBL 01 25 *        // calculate Comb(n, k1) iteratively 26 DSE L 27 RCL 01 28 LastX 29 - 30 ST/ Y 31 X<> L 32 DSE Z 33 GTO 01 34 RDN 35 LBL 03 .. ...

That's three more steps, on the other hand the RCL 01 command in line 14 now can be omitted. So all in all it's two steps more. But accuracy improves – try your example once again:

Code:
120 [ENTER] 6 [1/x] 40 [ENTER] 120 XEQ"BINCDF"   =>   6,419629908 E–6

That's the exact result for a ten-digit value of 1/6. :-)

Dieter
 « 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)