Probabilities::BinomPDF Function

Overload List

#SignatureDescription
1double BinomPDF(int x, int N, double p);Binomial probability mass function (PMF).
2void BinomPDF(TMtxVecInt *X, int n, double P, TDenseMtxVec *Res);Binomial PDF (vectorized).

Overload 1: double BinomPDF(int x, int N, double p);

Binomial probability mass function (PMF).

#NameTypeDescription
1xintFunction domain, integer on the closed interval [0,N].
2NintNumber of trials; N must be a positive integer.
3pdoubleSuccess probability; p must lie on the closed interval [0,1].

Returns: the binomial probability mass function (PMF). Returns NAN when p is outside [0,1], N<=0, or x>N.

Remarks:

Computes the binomial PMF, the probability of observing exactly x successes in N independent Bernoulli trials each with success probability p:

PMF(x| N,p)=binomNx p^x (1-p)^(N-x), x=0,1,...,N

Domain: x in {0,1,...,N}, N >= 1, p in [0,1]. For p not in [0,1], N <= 0 or x>N the result is NaN.

To recognize a situation that involves a binomial random variable, the following assumptions must be met:

  • The experiment consists of a fixed number, N, of Bernoulli trials that result in either success or failure.
  • The trials are identical and independent, so the success probability p remains the same from trial to trial.
  • The random variable x denotes the number of successes obtained in the N trials.
See Also: Probabilities::BinomCDF, Probabilities::BinomCDFInv, Probabilities::BernoulliPDF
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler

Overload 2: void BinomPDF(TMtxVecInt *X, int n, double P, TDenseMtxVec *Res);

Binomial PDF (vectorized).

#NameTypeDescription
1XTMtxVecInt *Defines distribution domain, real vector or matrix with integer values on closec interval [0,n].
2nintDefines number of trials. n must be a positive integer.
3PdoubleDefines success probability. p must lie on the [0,1] closed interval.
4ResTDenseMtxVec *After calculation stores the PDF calculated using X, n and p. Length and Complex properties of Res are adjusted automatically to match Length and Complex properties of X.
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler