function BernoulliPDF(x: Integer; p: Double): Double;
Bernoulli probability mass function (PMF).
| # | Name | Description |
|---|---|---|
| 1 | x | Function domain, integer |
| 2 | the only valid values are 0 or 1. | |
| 3 | p | Success 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.