Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Boltzmann.Data.Common
Description
General helper functions
Documentation
frequencyWith :: (Ord r, Num r, Monad m) => (r -> m r) -> [(r, m a)] -> m a #
partitions :: Int -> Int -> [[Int]] #
partitions k n
: lists of non-negative integers of length n
with sum
less than or equal to k
.
binomial :: Int -> Int -> Integer #
Binomial coefficient.
binomial n k == factorial n `div` (factorial k * factorial (n-k))
multinomial :: Int -> [Int] -> Integer #
Multinomial coefficient.
multinomial n ps == factorial n `div` product [factorial p | p <- ps]