Probabilities.BernoulliPDF Method

function BernoulliPDF(x: Integer; p: Double): Double;

Bernoulli probability mass function (PMF).

#NameDescription
1xFunction domain, integer
2the only valid values are 0 or 1.
3pSuccess probability, real value on the closed interval [0,1].

Returns: Double - the Bernoulli distribution probability mass function (PMF). Returns NAN when p is outside [0,1] or x is outside {0,1}.

Remarks:

Computes the Bernoulli PMF, the probability of x successes in a single trial with success probability p:

PMF(x| p)={ 1-p,  if x=0
          { p,  if x=1

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

See Also: Probabilities.BernoulliCDF, Probabilities.BernoulliCDFInv, Probabilities.BinomPDF