probability-0.2.9.1: Probabilistic Functional Programming
Safe HaskellSafe-Inferred
LanguageHaskell98

Numeric.Probability.Example.Histogram

Description

We have a set of symbols. We draw from this set n times with replacement. We then sort the symbols by their drawn frequency. What is the expected distribution of the histogram?

Synopsis

Documentation

>>> import qualified Combinatorics as Comb

example :: Ord a => T [] a -> Int -> T Rational (Map Int Int) Source #

flattenHistogram :: Num a => Map Int a -> [a] Source #

exampleList :: Ord a => T [] a -> Int -> T Rational [Int] Source #

>>> exampleList ('a'!:['b'..'k']) 4
fromFreqs [([4],720 % 1331),([2,1],540 % 1331),([1,0,1],40 % 1331),([0,2],30 % 1331),([0,0,0,1],1 % 1331)]

histogram :: Ord a => [a] -> Map a Int Source #

decorate :: b -> [a] -> [(a, b)] Source #