distribution-1.0.0.0: Finite discrete probability distributions.

Safe HaskellSafe-Inferred

Data.Distribution.Domain.Coin

Contents

Description

This modules provides distributions from coins and functions on coins.

Synopsis

Coin

type Coin = Distribution CoinSideSource

Distribution over the sides of a coin.

data CoinSide Source

Possible outcomes of a coin flip.

Constructors

Head 
Tail 

coin :: CoinSource

Fair coin.

Operations

flipsOf :: Int -> Coin -> Distribution IntSource

Flips n times the given coin and counts the number of heads.

reflipOn :: CoinSide -> Coin -> CoinSource

Rerolls the coin once if the first outcome satifies the given predicate.