random-fu-0.0.1.1: Random number generationSource codeContentsIndex
Data.Random.Distribution.Bernoulli
Synopsis
bernoulli :: Distribution (Bernoulli b) a => b -> RVar a
boolBernoulli :: (Fractional a, Ord a, Distribution StdUniform a) => a -> RVar Bool
generalBernoulli :: Distribution (Bernoulli b) Bool => a -> a -> b -> RVar a
data Bernoulli b a = Bernoulli b
Documentation
bernoulli :: Distribution (Bernoulli b) a => b -> RVar aSource
Generate a Bernoulli variate with the given probability. For Bool results, bernoulli p will return True (p*100)% of the time and False otherwise. For numerical types, True is replaced by 1 and False by 0.
boolBernoulli :: (Fractional a, Ord a, Distribution StdUniform a) => a -> RVar BoolSource
A random variable whose value is True the given fraction of the time and False the rest.
generalBernoulli :: Distribution (Bernoulli b) Bool => a -> a -> b -> RVar aSource
generalBernoulli t f p generates a random variable whose value is t with probability p and f with probability 1-p.
data Bernoulli b a Source
Constructors
Bernoulli b
show/hide Instances
Produced by Haddock version 2.4.2