distribution-1.1.1.0: Finite discrete probability distributions.

Safe HaskellSafe
LanguageHaskell98

Data.Distribution.Domain.Coin

Contents

Description

This modules provides distributions from coins and functions on coins.

Synopsis

Coin

type Coin = Distribution CoinSide Source #

Distribution over the sides of a coin.

coin :: Coin Source #

Fair coin.

Operations

flipsOf :: Int -> Coin -> Distribution Int Source #

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

reflipOn :: CoinSide -> Coin -> Coin Source #

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