Copyright | Copyright (c) 2018 Vanessa McHale |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This provides facilities for working with common combinatorial functions.
Documentation
doubleFactorial :: Int -> Integer Source #
\( n!! \)
catalan :: Int -> Integer Source #
The n
th Catalan number, with indexing beginning at 0
.
λ:> catalan <$> [0..9] [1,1,2,5,14,42,132,429,1430,4862]
derangement :: Int -> Integer Source #
\( !n \)
λ:> derangement <$> [0..10] [1,0,1,2,9,44,265,1854,14833,133496,1334961]
Compute the maximal number of regions obtained by joining \( n \) points about a circle by straight lines. See here.