Copyright | (c) 2016 André Szabolcs Szelp |
---|---|

License | BSD3 |

Maintainer | a.sz.szelp@gmail.com |

Stability | experimental |

Portability | portable |

Safe Haskell | None |

Language | Haskell98 |

The discrete uniform distribution. There are two parametrizations of
this distribution. First is the probability distribution on an
inclusive interval {1, ..., n}. This is parametrized with n only,
where p_1, ..., p_n = 1/n. (`discreteUniform`

).

The second parametrization is the uniform distribution on {a, ..., b} with
probabilities p_a, ..., p_b = 1/(a-b+1). This is parametrized with
*a* and *b*. (`discreteUniformAB`

)

## Synopsis

- data DiscreteUniform
- discreteUniform :: Int -> DiscreteUniform
- discreteUniformAB :: Int -> Int -> DiscreteUniform
- rangeFrom :: DiscreteUniform -> Int
- rangeTo :: DiscreteUniform -> Int

# Documentation

data DiscreteUniform #

The discrete uniform distribution.

## Instances

# Constructors

:: Int | Range |

-> DiscreteUniform |

Construct discrete uniform distribution on support {1, ..., n}.
Range *n* must be >0.

:: Int | Lower boundary (inclusive) |

-> Int | Upper boundary (inclusive) |

-> DiscreteUniform |

Construct discrete uniform distribution on support {a, ..., b}.

# Accessors

rangeFrom :: DiscreteUniform -> Int #

*a*, the lower bound of the support {a, ..., b}

rangeTo :: DiscreteUniform -> Int #

*b*, the upper bound of the support {a, ..., b}