# Binomial Coefficient C(n, m)

The Binomial coefficient C(n, m) is defined for all n >= 0 and 0 <= m <= n. C(n, 0) = C(n, n) = 1 for n >= 0.

C(n, m) = n!/((n−m)!*m!) and is always a whole integer.

To compute C(n, m), n >= 0, 0 <= m <= n:
if m == 0 or m == n, C(n, m) = 1
if 2m > n, change m to m = n − m

Now C(n, m) = ((((((n * (n−1)) / 2) * (n−2)) / 3) ... ) * (n+1−m)) / m.
With this arrangement of alternating multiplies and divides, every divide gives a whole number result.

For example
C(9, 6) = C(9, 3) = (((9 * 8) / 2) * 7) / 3 = ((72 / 2) * 7) / 3 = (36 * 7) / 3 = 252 / 3 = 84.

### ```n C(n,0) C(n,1) C(n,2) C(n,3) C(n,4) C(n,5) C(n,6) C(n,7) C(n,8) C(n,9) C(n,10) 0 1 1 1 1 2 1 2 1 3 1 3 3 1 4 1 4 6 4 1 5 1 5 10 10 5 1 6 1 6 15 20 15 6 1 7 1 7 21 35 35 21 7 1 8 1 8 28 56 70 56 28 8 1 9 1 9 36 84 126 126 84 36 9 1 10 1 10 45 120 210 252 210 120 45 10 1 11 1 11 55 165 330 462 462 330 165 55 11 12 1 12 66 220 495 792 924 792 495 220 66 13 1 13 78 286 715 1287 1716 1716 1287 715 286 14 1 14 91 364 1001 2002 3003 3432 3003 2002 1001 15 1 15 105 455 1365 3003 5005 6435 6435 5005 3003 16 1 16 120 560 1820 4368 8008 11440 12870 11440 8008 17 1 17 136 680 2380 6188 12376 19448 24310 24310 19448 18 1 18 153 816 3060 8568 18564 31824 43758 48620 43758 19 1 19 171 969 3876 11628 27132 50388 75582 92378 92378 20 1 20 190 1140 4845 15504 38760 77520 125970 167960 184756 n C(n,0) C(n,1) C(n,2) C(n,3) C(n,4) C(n,5) C(n,6) C(n,7) C(n,8) C(n,9) C(n,10) ```

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