Calculate C(n, k) exactly
Enter non-negative integers for n and k to compute the binomial coefficient (also called “n choose k”).
What is a binomial coefficient?
A binomial coefficient tells you how many ways there are to choose k objects from a set of n objects, where order does not matter.
It is written as C(n, k), nCk, or (n choose k).
For example, if you have 10 books and you want to choose 3 to bring on a trip, the number of unique selections is:
C(10,3) = 120.
The formula
The classic formula is:
C(n, k) = n! / (k! (n-k)!)
Here, ! means factorial, such as 5! = 5×4×3×2×1.
This formula works for integer values with 0 ≤ k ≤ n.
Useful identity: symmetry
One of the most important properties is:
C(n, k) = C(n, n-k).
This means choosing 3 out of 10 is the same count as choosing the 7 you leave out.
How this calculator works
This page uses an exact integer method with JavaScript BigInt, so results are precise for very large values. Instead of calculating giant factorials directly (which is slow and heavy), it uses a product form that is much more efficient:
C(n,k) = Π(i=1..k) (n-k+i)/i after replacing k with min(k, n-k).
- It validates that inputs are non-negative integers.
- It rejects invalid combinations where
k > n. - It returns an exact value, number of digits, and compact scientific notation for readability.
Worked examples
Example 1: Lottery-style combination
Suppose you choose 6 numbers from 49:
C(49,6) = 13,983,816.
This count explains why matching all numbers is so difficult.
Example 2: Card hands
A 5-card poker hand from a 52-card deck is:
C(52,5) = 2,598,960.
Example 3: Team selection
If 12 candidates are available and you need a committee of 4:
C(12,4) = 495 possible teams.
Why binomial coefficients matter
- Probability: Hypergeometric and binomial calculations depend on combinations.
- Statistics: They appear in confidence modeling and combinatorial counting.
- Computer science: Used in dynamic programming, algorithm analysis, and complexity counting.
- Algebra: Coefficients in the binomial expansion of
(a+b)^n.
Common input mistakes
- Using decimals (like 7.5) instead of integers.
- Entering negative values.
- Swapping n and k so that k becomes larger than n.
If you run into an error, just correct the input and calculate again.
Quick reference values
C(n,0) = 1C(n,1) = nC(n,n) = 1C(n,2) = n(n-1)/2
Use the calculator above to test these and build intuition quickly.