CombinatoricBinomialCoefficient Method |
Namespace: Kaos.Combinatorics
public static long BinomialCoefficient( int n, int k )
Exception | Condition |
---|---|
OverflowException | When the numbers are just too big. |
The number of rows in a Combination table of k picks
from n choices is:
Combinatoric.BinomialCoefficient (n, k)
The number of rows in a Multicombination table of k picks
from n choices is:
Combinatoric.BinomialCoefficient (k+n-1, k)
An exception to the above formulas is the special case where the number of elements is 0. While mathematics treats this result as 1 row containing the empty product, this library returns 0 rows.