Binomial Distribution#

Univariate, Discrete, Bounded

The Binomial distribution is a discrete probability distribution that describes the number of successes in a fixed number \(n\) of independent Bernoulli trials (yes/no experiments), each with the same probability of success \(p\).

Key properties and parameters#

Support

\(x \in \{0, 1, \ldots, n\}\)

Mean

\(n p\)

Variance

\(n p (1-p)\)

Parameters:

  • \(n\) : (int) Number of Bernoulli trials, \(n \geq 0\).

  • \(p\) : (float) Probability of success in each trial, \(0 \leq p \leq 1\).

Probability Mass Function (PMF)#

\[ f(x \mid n, p) = \binom{n}{x} p^x (1-p)^{n-x} \]
/home/docs/checkouts/readthedocs.org/user_builds/preliz/envs/stable/lib/python3.11/site-packages/pytensor/link/numba/dispatch/basic.py:211: UserWarning: Numba will use object mode to run XlogY0's perform method. Set `pytensor.config.compiler_verbose = True` to see more details.
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/preliz/envs/stable/lib/python3.11/site-packages/pytensor/link/numba/dispatch/basic.py:211: UserWarning: Numba will use object mode to run XlogY0's perform method. Set `pytensor.config.compiler_verbose = True` to see more details.
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/preliz/envs/stable/lib/python3.11/site-packages/pytensor/link/numba/dispatch/basic.py:211: UserWarning: Numba will use object mode to run XlogY0's perform method. Set `pytensor.config.compiler_verbose = True` to see more details.
  warnings.warn(
Binomial Distribution PMF

Cumulative Distribution Function (CDF)#

\[ F(k \mid n, p) = I_{1 - p}(n - \lfloor x \rfloor, \lfloor x \rfloor + 1) \]
Binomial Distribution CDF

where \(I_{1 - p}(a, b)\) is the regularized incomplete beta function.

See also

Common Alternatives:

  • Bernoulli Distribution - For a single trial, i.e., \(n=1\), the Binomial distribution reduces to the Bernoulli distribution.

Related Distributions:

References#