function BernoulliCDF(x: Integer; p: Double): Double;
Bernoulli cumulative distribution function (CDF).
| # | Name | Description |
|---|---|---|
| 1 | x | Function domain, integer |
| 2 | valid values are 0 or 1. | |
| 3 | p | Success probability, real value on the closed interval [0,1]. |
Returns: Double - the Bernoulli cumulative distribution function (CDF). Returns NAN when p is outside [0,1] or x is negative.
Remarks:
Computes the Bernoulli CDF P(X <= x):
CDF(x| p)={ 1-p, if x=0
{ 1, if x >= 1
Domain: p in [0,1]. For x<0 or p not in [0,1] the result is NaN. Note that the implementation returns 1 for every x >= 1 (e.g. x=5), not only x=1.