User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Presets:
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

The binomial coefficient C(n, k) counts the number of ways to choose k elements from a set of n without regard to order. It appears in probability distributions, polynomial expansions, and error-correcting codes. A miscalculated coefficient propagates through every downstream formula that depends on it. This tool computes exact results using native arbitrary-precision arithmetic, eliminating the floating-point truncation that plagues spreadsheet implementations for n > 66. It assumes n and k are non-negative integers with k โ‰ค n.

The multiplicative formula is used instead of the factorial definition to avoid intermediate overflow. The tool exploits the symmetry property C(n, k) = C(n, n โˆ’ k) to minimize the number of multiplications. Pro tip: for very large n, verify your result against Kummer's theorem for carry counting in base-p arithmetic when you need the coefficient modulo a prime.

binomial coefficient combinations pascal triangle n choose k combinatorics math calculator

Formulas

The binomial coefficient is defined as the ratio of factorials. The factorial definition is:

C(n, k) = n!k! โ‹… (n โˆ’ k)!

This tool uses the numerically stable multiplicative form to avoid computing large intermediate factorials:

C(n, k) = kโˆi = 1 n โˆ’ k + ii

Key identities used internally:

C(n, k) = C(n, n โˆ’ k) (Symmetry)
C(n, k) = C(n โˆ’ 1, k โˆ’ 1) + C(n โˆ’ 1, k) (Pascal's Rule)
nโˆ‘k = 0 C(n, k) = 2n (Row Sum)

Where n = total number of elements in the set, k = number of elements chosen, i = iteration index in the product, and C(n, k) = the number of k-combinations from n elements.

Reference Data

nC(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)
01
111
2121
31331
414641
515101051
61615201561
7172135352171
818285670562881
9193684126126843691
101104512021025221012045101
121126622049579292479249522066
151151054551365300350056435643550053003
2012019011404845155043876077520125970167960184756
2512530023001265053130177100480700108157520429753268760
30130435406027405142506593775203580058529251430715030045015
4014078098809139065800838383801864356076904685273438880847660528
5015012251960023030021187601589070099884400536878650250543370010272278170
10011004950161700392122575287520119205240016007560800186087894300190223180840017310309456440

Frequently Asked Questions

Standard IEEE 754 double-precision floats lose integer precision beyond 253 (9007199254740992). For example, C(67, 33) equals 14226520737620288370, which already exceeds this limit. BigInt provides exact arbitrary-precision integer arithmetic, so results remain correct for n up to 10000 and beyond.
The multiplicative product runs in O(min(k, n โˆ’ k)) time with O(1) extra space. The naive recursive Pascal's Rule has exponential time complexity O(C(n, k)) due to overlapping subproblems. Even memoized dynamic programming requires O(n โ‹… k) time and space, which is impractical for large inputs.
If k > n รท 2, the calculator replaces k with n โˆ’ k before computing. This halves the maximum number of loop iterations. For instance, C(1000, 998) reduces to C(1000, 2), computing in 2 iterations instead of 998.
The generalized binomial coefficient extends to real and negative n using the Gamma function: C(n, k) = ฮ“(n + 1) รท (ฮ“(k + 1) โ‹… ฮ“(n โˆ’ k + 1)). This tool restricts inputs to non-negative integers because exact BigInt arithmetic is only meaningful for the combinatorial (counting) interpretation.
The binomial theorem states (a + b)n = nโˆ‘k=0 C(n, k) anโˆ’k bk. Each coefficient in the expansion is exactly the binomial coefficient for that term. Setting a = b = 1 yields the row-sum identity 2n.
C(0, 0) = 1 by convention: there is exactly one way to choose zero elements from an empty set. Similarly, C(n, n) = 1 and C(n, 0) = 1. If k > n, the result is 0 because you cannot choose more elements than available. All these boundary conditions are handled explicitly before the loop executes.