4
$\begingroup$

I want to know, how Mathematica actually implements the cumulative distribution function of the binomial distribution. Which algorithm does Mathematica use to compute CDF[BinomialDistribution[n, p], x]? Does Mathematica use the normal approximation, or does it use a better approximation?

So far I have found the sites about BinomialDistribution and CDF but I haven't found an answer to my question there. I know that Mathematica is closed source but is there a way get information about the actual used algorithm?

Note: I never have used Mathematica before.

$\endgroup$
2
  • 7
    $\begingroup$ It evaluates the regularized incomplete beta function, which is built-in as BetaRegularized[], for appropriate arguments. As to what algorithm is being used to evaluate that… the docs only note that it uses hypergeometric function representations and continued fractions under the hood, and nothing more. $\endgroup$ Jul 21, 2015 at 15:07
  • $\begingroup$ You can see the use of BetaRegularized just by evaluating CDF[BinomialDistribution[n, p], x] $\endgroup$
    – Bob Hanlon
    Nov 16, 2015 at 19:23

1 Answer 1

4
$\begingroup$

J.M.'s comment:

It evaluates the regularized incomplete beta function, which is built-in as BetaRegularized[], for appropriate arguments. As to what algorithm is being used to evaluate that… the docs only note that it uses hypergeometric function representations and continued fractions under the hood, and nothing more.

$\endgroup$
1
  • 2
    $\begingroup$ For what it is worth, Mathematica usually prefers slow and accurate over fast and approximate. $\endgroup$
    – Eric Brown
    Nov 16, 2015 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.