Click or drag to resize
DigitalRuneMathHelperBinomialCoefficient Method
Computes the binomial coefficient of (n, k), also read as "n choose k".

Namespace: DigitalRune.Mathematics
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public static long BinomialCoefficient(
	int n,
	int k
)

Parameters

n
Type: SystemInt32
n, must be a value equal to or greater than 0.
k
Type: SystemInt32
k, a value in the range [0, n].

Return Value

Type: Int64
The binomial coefficient.
Remarks
This method returns a binomial coefficient. The result is the k'th element in the n'th row of Pascal's triangle (using zero-based indices for k and n). This method returns 0 for negative n.
See Also