Click or drag to resize
StdRandomBernoulli Method (Double)
Returns a random boolean from a Bernoulli distribution with success probability P.

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static bool Bernoulli(
	double p
)

Parameters

p
Type: SystemDouble
p the probability of returning true

Return Value

Type: Boolean
true with probability p and false with probability p
Exceptions
ExceptionCondition
ArgumentExceptionunless p >= 0.0 and p <= 1.0
See Also