Binomial Module

Special mathematical functions

Functions and values

Function or value Description

_coeffcient n k

Full Usage: _coeffcient n k

Parameters:
    n : int - input for n in the computation of (n | k)
    k : int - input for k in the computation of (n | k)

Returns: float

Returns the binomial coeffcient (n | k) via the factorial formula. for some combinations of n and k, this might result in overflows. The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input

n : int

input for n in the computation of (n | k)

k : int

input for k in the computation of (n | k)

Returns: float

_coeffcientLn n k

Full Usage: _coeffcientLn n k

Parameters:
    n : int - input for n in the computation of ln(n | k)
    k : int - input for k in the computation of ln(n | k)

Returns: float

Returns the natural logarithm of the binomial coeffcient (n | k) via the factorial formula. for some combinations of n and k, this might result in overflows. The caller is responsible to handle edge cases such as nan, infinity, and -infinity in the input

n : int

input for n in the computation of ln(n | k)

k : int

input for k in the computation of ln(n | k)

Returns: float

coeffcient n k

Full Usage: coeffcient n k

Parameters:
    n : int - input for n in the computation of (n | k)
    k : int - input for k in the computation of (n | k)

Returns: float

Returns the binomial coeffcient (n | k) via the factorial formula. for some combinations of n and k, this might result in overflows. Edge cases in the input (nan, infinity, and -infinity) are catched and handled. This might be slower than the unchecked version `_coefficient` but does not require input sanitation to get expected results for these cases.

n : int

input for n in the computation of (n | k)

k : int

input for k in the computation of (n | k)

Returns: float

coeffcientLn n k

Full Usage: coeffcientLn n k

Parameters:
    n : int - input for n in the computation of ln(n | k)
    k : int - input for k in the computation of ln(n | k)

Returns: float

Returns the natural logarithm of the binomial coeffcient (n | k) via the factorial formula. for some combinations of n and k, this might result in overflows. Edge cases in the input (nan, infinity, and -infinity) are catched and handled. This might be slower than the unchecked version `_coefficient` but does not require input sanitation to get expected results for these cases.

n : int

input for n in the computation of ln(n | k)

k : int

input for k in the computation of ln(n | k)

Returns: float