Combination Calculator (nCr)

Count how many ways you can choose r items from a set of n when the order of selection does not matter. This calculator evaluates C(n, r) exactly with big-integer arithmetic, so even a 30-digit answer such as C(100, 50) is shown digit for digit rather than as a rounded approximation.

How to Use This Calculator

  1. Enter n, the total number of items available.
  2. Enter r, the number of items to choose (r must be between 0 and n).
  3. Press Calculate to evaluate C(n, r) exactly, for any n up to 2,000.
  4. Read the exact value; answers with 30 or more digits also appear in scientific notation.

Reading the Output

Exact value: Every digit of C(n, r), grouped with thousands separators.

Digits: How long the exact answer is — a quick sense of scale for large results.

Scientific notation: A 10-significant-figure approximation, shown when the exact value has 30 or more digits.

The Combination Formula

A combination is a selection where only membership matters: picking Alice and Bob is the same outcome as picking Bob and Alice. The count of such selections is the binomial coefficient, read as "n choose r":

C(n, r) = n! / (r! × (n − r)!)

Multiplicative form: C(n, r) = [(n − r + 1) × (n − r + 2) × … × n] / r!

Key properties:

  • C(n, r) = C(n, n − r)
  • C(n, 0) = C(n, n) = 1
  • C(n, 1) = n
  • C(n − 1, r − 1) + C(n − 1, r) = C(n, r)

The factorial form is the textbook definition, but it is a poor recipe for direct computation because n! explodes long before the final answer does. The multiplicative form cancels the (n − r)! factor first, which is exactly how this calculator works.

How This Calculator Stays Exact for Large n

Standard JavaScript numbers hold integers exactly only up to 2^53 − 1, which is 9,007,199,254,740,991 — a 16-digit ceiling. Computing combinations through raw factorials fails even sooner: 171! overflows the floating-point range entirely, and precision quietly degrades long before that. Our general-purpose probability calculator takes that simpler factorial approach, which is fine for classroom-sized inputs but cannot show every digit of a large result.

This page instead runs a big-integer loop: starting from 1, it multiplies by (n − k + i) and divides by i for i = 1 up to k, where k = min(r, n − r) exploits the symmetry rule to halve the work. After step i the running value equals C(n − k + i, i), which is itself a binomial coefficient and therefore a whole number — so every intermediate division is exact and no rounding can creep in. That is how the tool reports all 30 digits of C(100, 50) = 100,891,344,545,564,193,334,812,497,256 rather than an estimate. If you care about the order of the chosen items rather than just membership, switch to the permutation calculator.

Committees, Lotteries, and Card Hands

Combinations answer "how many groups are possible?" — the question behind committees, lottery tickets, and card hands alike:

  • Committees: choosing 4 members from a 12-person board gives C(12, 4) = 495 distinct committees; a small 2-of-5 working group gives C(5, 2) = 10.
  • Lotteries: a 6-of-49 draw has C(49, 6) = 13,983,816 equally likely tickets, so one ticket wins the jackpot with probability 1 in 13,983,816.
  • Card hands: a five-card poker hand from a 52-card deck is one of C(52, 5) = 2,598,960 possibilities.

In every case the division by r! is doing the conceptual work: it collapses all the orderings of the same group into a single outcome.

Pascal's Triangle and the Symmetry Rule

Binomial coefficients are the entries of Pascal's triangle: row n lists C(n, 0) through C(n, n), and each entry is the sum of the two entries above it.

Pascal's rule: C(n − 1, r − 1) + C(n − 1, r) = C(n, r)

Example: C(4, 1) + C(4, 2) = 4 + 6 = 10 = C(5, 2)

Row n = 5: 1, 5, 10, 10, 5, 1 — sum 32 = 2^5

Two consequences are worth remembering. Row sums equal 2^n because every subset of an n-element set is either chosen or not, element by element. And the rows read the same in both directions — the symmetry C(n, r) = C(n, n − r) — because choosing r items to keep is the same decision as choosing n − r items to leave out. Try n = 49 with r = 43: the calculator returns 13,983,816, identical to C(49, 6), and it exploits that same symmetry internally to keep large computations fast.

Worked Example: The 6-of-49 Lottery

How many different tickets exist in a lottery where players pick 6 numbers out of 49? Enter n = 49 and r = 6. By hand, the multiplicative form keeps the numbers manageable:

  1. Cancel the (n − r)! factor: C(49, 6) = (49 × 48 × 47 × 46 × 45 × 44) / 6!.
  2. Build the numerator: 49 × 48 = 2,352; × 47 = 110,544; × 46 = 5,085,024; × 45 = 228,826,080; × 44 = 10,068,347,520.
  3. Divide by 6! = 720: 10,068,347,520 ÷ 720 = 13,983,816.

The calculator's interleaved loop reaches the same answer while keeping every intermediate value small and whole: 44, then 990, 15,180, 178,365, 1,712,304, and finally 13,983,816 — each partial result is itself a binomial coefficient.

As a probability, one ticket hits the jackpot with chance 1 ÷ 13,983,816 ≈ 0.0000000715, or about 7.15 × 10^-8. Matching exactly 5 of the 6 winning numbers can happen in C(6, 5) × C(43, 1) = 6 × 43 = 258 ways, so those odds are 13,983,816 ÷ 258 ≈ 54,200.84 — about 1 in 54,201.

Frequently Asked Questions

How large can n and r be in this calculator?

The calculator accepts any whole numbers with 0 <= r <= n <= 2000 and returns the exact integer every time. Results grow quickly: C(2000, 1000) has 601 digits, all of which are displayed. The computation loops only min(r, n - r) times thanks to the symmetry rule, so even the largest allowed inputs evaluate in a fraction of a second.

Why does C(n, r) equal C(n, n - r)?

Choosing which r items to include is exactly the same decision as choosing which n - r items to exclude, so the two counts must match. For example, C(49, 6) and C(49, 43) both equal 13,983,816. The calculator uses this identity internally, computing with the smaller of r and n - r.

How is this different from the combination mode in the probability calculator?

The probability calculator evaluates factorials with ordinary floating-point numbers, which is accurate for small inputs but overflows near 170! and loses precision well before that. This dedicated page multiplies and divides with big-integer arithmetic, so every digit of the result is exact even when the answer has hundreds of digits, and it adds thousands separators plus scientific notation for readability.

What do C(n, 0) = 1 and C(n, n) = 1 mean in practice?

There is exactly one way to choose nothing (the empty selection) and exactly one way to choose everything (the full set). Both follow from the formula because 0! is defined as 1. These two entries form the borders of Pascal's triangle.

How do I turn a combination count into odds or a probability?

When every selection is equally likely, the probability of one specific outcome is 1 divided by the count. A 6-of-49 lottery ticket wins with probability 1/13,983,816, roughly 7.15 x 10^-8. For events that can happen in several ways, divide the number of favorable selections by the total count instead.