• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
Seize the moment! nominate yourself or a tech enthusiast you admire & join the HP Community Experts!
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended
HP Prime

On the HP Prime (firmware version 2016 12 08 (11226)) the binomial_cdf function gives incorrect results for values close to zero.

 

Steps to reproduce : In the HOME screen, type

 

BINOMIAL_CDF(100,0.5,1)*10^12

 

Observed result : 1

Expected result : 7.967*10^-17

 

Details : BINOMIAL_CDF seems to be rounded up to 10^-12 when it's below 10^-12, except for a number of successes k=0

 

This bug seems to affect the HP 39gII too.

5 REPLIES 5
HP Recommended

Thank you for finding this subtle issue! It was actually in the very extremes of the incomplete beta function. This was later used to implement binomial_cdf and created the problem in these rare cases.

 

In the meantime, you can use "binomial_cdf" in the CAS screen and you will get the correct result. Thanks again!

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
HP Recommended

Thanks for your quick reply.

The CAS system is not exact either, maybe because it is based on too large fractions.

 

exact(BINOMIAL_CDF(100,1/2,21)) returns 1/461041954.

 

I'm not sure this is exact. 1/461041954 equals to 2.16900000e-9 while the R statistical software finds 2.168683e-09 in two different ways (sum of probability mass function and cumulative distribution function).

 

Anyway, I would expect a huge fraction with the exact binomial distribution.

Are fractions based on floating point numerator and denominators ? Rounding errors may be worse than in the non-CAS mode.

 

Secondly, for n=100 and k<=20, it's always equal to zero:

 

exact(BINOMIAL_CDF(100,1/2,20)) returns 0

 

HP Recommended

 

Using the command exact is not the way to do CAS calculations.

 

You will have to press the CAS key in order to get into CAS environment.

 

When I repeat the calculations you did I get a result in the form of a fraction with a huge numerator and denominator.

 

The result can be converted into a numerical number by pressing  Shift -Enter, which gives the result you expected.

 

As a check I subtracted 

 

BINOMIAL_CDF(100,1/2,21) - BINOMIAL_CDF(100,1/2,20)

 

which should give BINOMIAL(100,1/2,21), and it does.

 

So very probably the result is exact.

 

 

HP Recommended

Direct check:

 

2017-10-06 09.58.42.jpg

HP Recommended

It works, indeed.

Thank you.

Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.