-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Archived Topics
- Tablets and Mobile Devices Archive
- Incorrect binomial cumulative distribution function results

Create an account on the HP Community to personalize your profile and ask a question

10-04-2017 07:44 AM
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.
10-04-2017 01:26 PM
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!
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.
10-05-2017 01:06 AM
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
10-05-2017 01:30 PM
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.
