Last verified · v1.0
Calculator · math
Binomial Coefficient Calculator (N Choose K)
Compute C(n,k) — the number of ways to choose k items from n — using the exact factorial formula n!/(k!(n-k)!). Supports n up to 170.
Inputs
Binomial Coefficient C(n, k)
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
What Is the Binomial Coefficient?
The binomial coefficient, written C(n, k) or n choose k, counts 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, probability theory, and algebra, appearing wherever subsets or unordered selections must be counted.
The Formula
The binomial coefficient is defined by the factorial formula:
C(n, k) = n! / (k! × (n − k)!)
Where n! (n factorial) is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By universal convention, 0! = 1, ensuring the formula works at its boundary values.
Variables Explained
- n (total items): The size of the full set from which items are drawn. Must be a non-negative integer. This calculator accepts values up to 170 to prevent floating-point overflow.
- k (items chosen): The number of items selected from the set. Must satisfy 0 ≤ k ≤ n.
Step-by-Step Derivation
To derive C(n, k), start with the number of ordered arrangements of k items chosen from n, which equals n × (n−1) × ... × (n−k+1) = n! / (n−k)!. Because order does not matter in a combination, divide by k! — the number of ways to rearrange the chosen items — yielding the formula n! / (k! × (n−k)!).
As documented in Newton's Binomial Theorem (Whitman College) and The Binomial Formula (Portland Community College), this coefficient also appears as the coefficient of the x^k term in the expansion of (1+x)^n, the celebrated Binomial Theorem: (1+x)^n = sum of C(n,k) × x^k for k from 0 to n.
Worked Examples
Example 1: Lottery Combinations
A lottery draws 6 numbers from a pool of 49. The number of possible tickets equals C(49, 6) = 49! / (6! × 43!) = 13,983,816. Each ticket carries approximately a 1-in-13.98-million chance of matching all six drawn numbers.
Example 2: Committee Selection
From a group of 10 people, how many 3-person committees can be formed? C(10, 3) = 10! / (3! × 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120 committees. Order does not matter; the same three people form one committee regardless of selection sequence.
Example 3: Pascal's Triangle
Pascal's Triangle arranges binomial coefficients in rows, where row n lists C(n,0), C(n,1), ..., C(n,n). Row 5 produces: 1, 5, 10, 10, 5, 1 — confirming C(5,2) = 10 and C(5,3) = 10, and illustrating the symmetry property.
Key Properties
- Symmetry: C(n, k) = C(n, n−k). Choosing 3 items from 10 yields the same count as leaving 7 behind: both equal 120.
- Edge cases: C(n, 0) = C(n, n) = 1 for all n; C(n, 1) = n.
- Pascal's identity: C(n, k) = C(n−1, k−1) + C(n−1, k), the additive rule powering Pascal's Triangle and dynamic-programming solutions.
- Sum rule: The sum of all C(n, k) for k = 0 to n equals 2^n, counting every possible subset of an n-element set.
Practical Applications
- Probability and Statistics: Binomial coefficients define the binomial distribution, modeling the number of successes in n independent trials each with probability p — used in clinical trials, quality control, and survey analysis.
- Genetics: Counting genotype and allele combination frequencies in population genetics.
- Computer Science: Algorithms for enumerating subsets and memoized dynamic-programming computation of C(n,k) are standard techniques in competitive programming and algorithm design.
- Finance: Binomial option-pricing trees weight terminal nodes using binomial probabilities derived from C(n,k).
- Calculus: The Binomial Series extends C(n,k) to real-valued n, enabling power-series expansions of functions such as (1+x)^(1/2).
Computational Notes
Factorials grow extremely fast: 170! ≈ 7.26 × 10^306, approaching the limit of IEEE 754 double-precision floating-point representation. This calculator caps n at 170 to guarantee accurate results. For problems requiring n greater than 170, logarithmic methods — computing log(n!) as a sum of logs — or arbitrary-precision arithmetic libraries are recommended.
Reference