double BernoulliPDF(int x, double p);
Bernoulli probability mass function (PMF).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | x | int | Function domain, integer; the only valid values are 0 or 1. |
| 2 | p | double | Success probability, real value on the closed interval [0,1]. |
Returns: 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.
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler