java.lang.Object
org.bzdev.math.rv.RandomVariable<Boolean>
org.bzdev.math.rv.BooleanRandomVariable
org.bzdev.math.rv.BinomialBooleanRV
- All Implemented Interfaces:
Cloneable
,RandomVariableOps<Boolean>
Random variable that generates 'true' or 'false' with a specified
probability.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.bzdev.math.rv.BooleanRandomVariable
parallelStream, parallelStream, stream, stream, tightenMaximumS, tightenMinimumS
Methods inherited from class org.bzdev.math.rv.RandomVariable
clone, getCharacteristics, getMaximum, getMaximumClosed, getMinimum, getMinimumClosed, setMaximum, setMinimum, setRequiredMaximum, setRequiredMinimum, spliterator, spliterator, tightenMaximum, tightenMinimum
-
Constructor Details
-
BinomialBooleanRV
Constructor.- Parameters:
prob
- the probability that the value is 'true'- Throws:
IllegalArgumentException
-
-
Method Details
-
getProb
public double getProb()Get the probability that this random variable has the valuetrue
.- Returns:
- the probability that this random variable has the value 'true'
-
next
Description copied from class:RandomVariable
Get the next value for a random variable. In general, each value will be independent of the last.- Specified by:
next
in interfaceRandomVariableOps<Boolean>
- Specified by:
next
in classRandomVariable<Boolean>
- Returns:
- the next value
-