fast-arithmetic-0.6.2.0: 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]

maxRegions Source #

Arguments

:: Int

\( n \)

-> Integer 

Compute the maximal number of regions obtained by joining \( n \) points about a circle by straight lines. See here.