Probability mass function 

Distribution 

Mean 

Variance 
The Bernoulli distribution is a discrete probability distribution, which takes value 1 with success probability p and value 0 with failure probability q = 1 − p.
Generates a sample of the Bernoulli distribution, i.e. 1
with
probability p and 0 with probability 1  p.
Name 
Type 
Description 
p 
double 
the probability of 1 
Type 
Description 
int 
the generated sample 
Generates a sample of the Bernoulli distribution using the specified random number generator.
Name 
Type 
Description 
p 
double 
the probability of 1 
r 
java.util.Random 
the random number generator 
Type 
Description 
int 
the generated sample 