fast-arithmetic-0.6.0.7: Fast functions on integers.

CopyrightCopyright (c) 2018 Vanessa McHale
Safe HaskellNone
LanguageHaskell2010

Numeric.Combinatorics

Description

This provides facilities for working with common combinatorial functions.

Synopsis

Documentation

choose :: Int -> Int -> Integer Source #

\( \binom{n}{k} \)

catalan :: Int -> Integer Source #

The nth 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]