terican

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.

FreeInstantNo signupOpen source

Inputs

Binomial Coefficient C(n, k)

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Binomial Coefficient C(n, k)

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

Frequently asked questions

What is a binomial coefficient and what does n choose k mean?
A binomial coefficient C(n, k), read as 'n choose k', is the number of ways to select k items from a set of n distinct items without regard to order. For example, C(5, 2) = 10 means there are 10 different ways to choose 2 items from a set of 5. The formula is n! divided by k! times (n−k)!, where the exclamation mark denotes the factorial function.
How do you calculate n choose k by hand without a calculator?
To calculate C(n, k) by hand, multiply k descending integers starting from n in the numerator, then divide by k!. For C(8, 3): numerator = 8 × 7 × 6 = 336; denominator = 3! = 6; result = 336 / 6 = 56. This shortcut avoids computing large factorials directly. Cancel common factors before multiplying to keep intermediate numbers manageable — for example, 6/6 = 1 reduces the arithmetic immediately.
What is the difference between permutations P(n,k) and combinations C(n,k)?
Permutations count ordered arrangements: P(n, k) = n! / (n−k)!. Combinations count unordered selections: C(n, k) = n! / (k! × (n−k)!). For example, assigning 3 distinct prizes (1st, 2nd, 3rd) from 10 contestants gives P(10, 3) = 720 ordered outcomes. Choosing 3 winners with identical prizes gives C(10, 3) = 120 unordered selections. The relationship is C(n,k) = P(n,k) / k!, dividing out the k! redundant orderings.
Why is C(n, 0) always equal to 1?
C(n, 0) equals 1 because there is exactly one way to choose zero items from any set: select nothing. Applying the formula yields n! / (0! × n!) = n! / (1 × n!) = 1, using the convention that 0! = 1. By the same logic, C(n, n) = 1 because there is only one way to select all n items — take the entire set. Both values anchor Pascal's Triangle at its left and right edges.
What is the maximum value of n this binomial coefficient calculator supports?
This calculator supports values of n up to 170. Beyond that threshold, n! exceeds approximately 7.26 × 10^306, which overflows the representable range of IEEE 754 double-precision floating-point numbers used in standard computing environments. For combinatorics problems requiring n greater than 170, logarithmic computation — summing log-factorials term by term — or arbitrary-precision arithmetic libraries such as Python's math.comb function are necessary to obtain accurate results.
Where are binomial coefficients used in real-world applications?
Binomial coefficients appear across science, finance, and technology. In probability, they define the binomial distribution used to model clinical trial outcomes, coin-flip sequences, and manufacturing defect rates. In genetics, they count allele combinations in populations. In finance, binomial option-pricing trees weight each terminal node using C(n,k). In computer science, they power subset-enumeration algorithms. A well-known example: the number of possible lottery tickets choosing 6 numbers from 49 equals C(49, 6) = 13,983,816.