# Binomial Coefficient C(n, m), Generalized

Here are some notes from my program XPCalc - Extra Precision Floating-Point Calculator http://www.oocities.org/hjsmithh/download.html#XPCalc:

Bino(x, y) = Binomial coefficient (x, y), generalized:

The binomial coefficient is generalized so x and y can be any real number, though some values will be infinite.

Bino(x, y) = C(x, y) = Gam(x+1) / (Gam(y+1) * Gam(x−y+1)).

The following is true if y is an integer: If y < 0, C(x, y) = 0. C(x, 0) = 1. C(x, 1) = x. If x is also an integer: C(x, y) is the binomial coefficient of x Things taken y at a time. If y >= 0 and x < 0, C(x, y) = (−1)^y * C(y−x−1, y). If y > x, C(x, y) = 0. If y > x/2, C(x, y) = C(x, x−y) is a better way to compute C(x, y).

If y is a small integer > 0, depending on the precision desired, for any x left after using the logic of the previous paragraph, the fastest way to compute C(x, y) is

C(x, y) = x*(x−1)/2*(x−2)/3* ... *(x−y+1)/y.

For example, C(−4.5, 3) = (−1)^3 * C(3 + 4.5 − 1, 3) = −C(6.5, 3) = −(6.5)*(5.5)/2*(4.5)/3 = −26.8125 exactly.

If none of the above applies, C(x, y) = Gam(x+1) / (Gam(y+1) * Gam(x−y+1)) is used, but if x−y is an integer < 0, C(x, y) = 0. For example C(5.5, 6.5) = 0, while C(−1, 1.5) = Gam(0)/(Gam(2.5) * Gam(−1.5)) is infinite.

See: Binomial Coefficient -- From MathWorld
And: Wolfram Function Evaluation -- Binomial

This page accessed times since April 4, 2005.
Page created by: hjsmithh@sbcglobal.net
Changes last made on Monday, 06-Aug-07 20:47:13 PDT