Binomial Coefficient Calculator
Calculate C(n, k) — the number of ways to choose k items from n — for combinatorics, probability, and Pascal's triangle.
Enter n (total items) and k (items to choose), then click Calculate to get the exact binomial coefficient with its formula.
Binomial Coefficient Calculator
Calculate C(n, k) — the number of ways to choose k items from n — for combinatorics, probability, and Pascal's triangle.
About the binomial coefficient calculator
The binomial coefficient C(n, k), also written as "n choose k" or as the symbol ⁿCₖ, is the number of ways to select exactly k items from a set of n distinct items when the order of selection does not matter. It is one of the most fundamental quantities in combinatorics and appears throughout probability theory, algebra, statistics, and computer science.
The formula for the binomial coefficient is C(n, k) = n! / (k! × (n − k)!), where the exclamation mark denotes the factorial function: n! = n × (n−1) × (n−2) × ⋯ × 2 × 1, and 0! = 1 by convention. For example, C(5, 2) = 5! / (2! × 3!) = 120 / (2 × 6) = 10, meaning there are exactly 10 ways to pick 2 items from a group of 5.
Binomial coefficients are the entries of Pascal's triangle. In Pascal's triangle, each number is the sum of the two directly above it. The entry in row n and column k (counting from zero) is exactly C(n, k). This property follows from Pascal's identity: C(n, k) = C(n−1, k−1) + C(n−1, k), which says that each item in the selection is either included (reducing the problem to choosing k−1 from n−1) or excluded (reducing it to choosing k from n−1).
The name "binomial coefficient" comes from the binomial theorem: (x + y)ⁿ = Σ C(n, k) × xᵏ × y^(n−k) for k from 0 to n. The coefficient of each term xᵏ y^(n−k) in the expansion of (x + y)ⁿ is exactly C(n, k). For example, (x + y)³ = x³ + 3x²y + 3xy² + y³, and the coefficients 1, 3, 3, 1 are C(3,0), C(3,1), C(3,2), C(3,3).
In probability, binomial coefficients arise in the binomial distribution, which models the number of successes in n independent Bernoulli trials each with success probability p. The probability of exactly k successes is C(n, k) × p^k × (1−p)^(n−k). Combinatorics problems such as counting poker hands, lottery tickets, committee selections, or binary strings with a fixed number of ones all reduce directly to binomial coefficient calculations.
For large n and k, direct factorial computation causes integer overflow. Efficient algorithms compute C(n, k) iteratively using the multiplicative formula C(n, k) = ∏ (n − i) / (i + 1) for i from 0 to k−1, which keeps intermediate values smaller. This calculator uses exact integer arithmetic to return precise results for all practical inputs.
Binomial coefficient examples
Real-world scenarios where C(n, k) gives the number of possible outcomes.
| C(n, k) | Result | Real-world meaning |
|---|---|---|
| C(5, 2) | 10 | Number of ways to choose 2 items from 5. e.g. pairs from a group of 5 people. |
| C(52, 5) | 2,598,960 | Number of possible 5-card poker hands from a standard 52-card deck. |
| C(8, 3) | 56 | Row 8, position 3 in Pascal's triangle. Also the number of 3-element subsets of an 8-element set. |
| C(12, 4) | 495 | Ways to select a team of 4 from 12 candidates, where order doesn't matter. |
How to use the binomial coefficient calculator
- Enter n — the total number of items in your set. n must be a non-negative integer.
- Enter k — the number of items to choose. k must be between 0 and n inclusive.
- Click 'Calculate C(n, k)'. The result shows the exact binomial coefficient and the expanded formula.
- Click Reset to clear both fields and enter new values for a different calculation.
Binomial coefficient FAQ
What does C(n, k) mean?
C(n, k) is the number of ways to choose k items from a set of n distinct items when the order of selection does not matter. It is also called the binomial coefficient, 'n choose k', or a combination. For example, C(6, 2) = 15 because there are 15 distinct pairs you can form from 6 items.
What is the difference between a combination and a permutation?
In a combination, the order of the selected items does not matter: choosing {A, B} is the same as {B, A}. The count is C(n, k) = n! / (k! (n−k)!). In a permutation, order matters: choosing A then B is different from B then A. The count is P(n, k) = n! / (n−k)!. The relationship is P(n, k) = k! × C(n, k).
Why is C(n, 0) = 1 and C(n, n) = 1?
C(n, 0) counts the number of ways to choose 0 items from n — there is exactly one way to do nothing, so C(n, 0) = 1. C(n, n) counts the number of ways to choose all n items — there is exactly one way to take everything, so C(n, n) = 1. Both results follow directly from the factorial formula: n!/(0! × n!) = 1 and n!/(n! × 0!) = 1.
How do binomial coefficients relate to Pascal's triangle?
Pascal's triangle is a triangular array where each entry equals the sum of the two entries directly above it. The entry in row n (starting at row 0) and column k (starting at column 0) is exactly C(n, k). This follows from Pascal's identity: C(n, k) = C(n−1, k−1) + C(n−1, k). Reading across row n gives all coefficients from C(n,0) to C(n,n).
What is the binomial theorem?
The binomial theorem states that (x + y)ⁿ = Σ C(n, k) xᵏ y^(n−k) summed for k from 0 to n. The binomial coefficients are the numerical factors in front of each term. For instance, (x + y)⁴ = x⁴ + 4x³y + 6x²y² + 4xy³ + y⁴, and the coefficients 1, 4, 6, 4, 1 are C(4,0) through C(4,4).
Can k be larger than n?
No. If k > n, you cannot choose more items than exist in the set, so C(n, k) is defined to be 0 for k > n. The factorial formula also gives 0 in this case because (n−k)! is undefined for negative arguments — by convention the result is 0. The calculator will display an error if you enter k > n and remind you to correct the inputs.