binomialDistribution
binomialDistribution(
trials,probability):Distribution
Defined in: binomial-distribution.ts:24
The binomial distribution — the number of successes in trials independent
attempts, each succeeding with probability probability.
Both tails come from the regularized incomplete beta, which is an exact
identity rather than an approximation: P(X ≤ k) = I₁₋ₚ(n − k, k + 1). That
costs one continued fraction instead of a sum of k terms, and keeps the
upper tail accurate where summing from the bottom and subtracting would not.
Parameters
Section titled “Parameters”trials
Section titled “trials”number
Number of attempts; a non-negative integer.
probability
Section titled “probability”number
Success probability of one attempt, in [0, 1].
Returns
Section titled “Returns”The distribution.
Throws
Section titled “Throws”When trials is not a non-negative integer, or
probability is outside [0, 1].