Formula & Calculator

Combinations

A combination counts the number of ways to choose r items from n distinct items when order does not matter. It is n! / (r! (n−r)!). For example, the number of ways to choose 3 toppings from 8 is 56. Combinations are used in lottery odds, card games, and statistical sampling. The key difference from permutations is that AB and BA are considered the same combination.

Mathematics Combinatorics Daily Life
VORZEP · COMBINATORICS & PROBABILITY TOOLS

Combinations Calculator — nCr

Compute the binomial coefficient nCr = n! / (r! · (n − r)!) — the number of ways to choose r items from n without regard to order — and solve for n or r in either direction. Step-by-step factorial working, a highlighted Pascal's triangle row, a live binomial distribution chart, and companion metrics including permutations, factorials and probabilities.

nCr = n! / (r! · (n − r)!) · nPr = nCr · r! · nCr = nC(n−r)
Solve for
Total items (n) The size of the pool you are choosing from. Must be a non-negative integer. Typical: 5 for a poker hand, 6 for a lottery draw, 49 for a national lottery, 52 for a deck of cards, 1,000 for a sample survey frame.
n
n must be a non-negative integer.
Items chosen (r) The size of the subset you are selecting. Must be a non-negative integer no larger than n. Because choosing r items is the same as leaving out n − r items, C(n, r) = C(n, n − r) — the sequence is symmetric about r = n/2.
r
r must be a non-negative integer no greater than n.
Combination (nCr) The binomial coefficient — the number of distinct r-element subsets of an n-element set. Always a positive integer. C(n, 0) = C(n, n) = 1 for every n, and the values form row n of Pascal's triangle.
nCr
nCr must be a positive value.
COMBINATION ₁₀C₃
120
10! / (3! · 7!) = 120
SMALL COMBINATION
nCr = n! / (r! · (n − r)!)
Step-by-step solution
Row n of Pascal's triangle — nCk for every k
Current coefficient ₅C₃ Symmetric partner ₅C₂ Other coefficients in the row
nCk grows with n for fixed k
nCk vs n for the current k Current point (n, nCr)
Sensitivity
Companion combinatorics metrics
The factorial identity — and Pascal's triangle around it
n!3,628,800
÷
r!6
÷
(n − r)!5,040
=
nCr120
Row 10 of Pascal's triangle — highlighted cells are ₁₀C₃ and its symmetric partner ₁₀C₇
n! — the total factorial r! and (n − r)! — the divisor factorials nCr — the binomial coefficient
What the binomial coefficient really measures
nCrcombinations
=
nPrpermutations
÷
r!orderings of the chosen items

Combinations ignore order, permutations do not

A permutation counts every distinct arrangement: choosing a president, a treasurer and a secretary from ten people gives 10 × 9 × 8 = 720 ways. A combination counts only the set: choosing a three-person committee from the same ten gives 720 ÷ 3! = 120 ways, because the six orderings of any one committee are all the same committee. Dividing by r! is exactly what removes the ordering.

The row is symmetric: nCr = nC(n−r)

Choosing r items to keep is the same act as choosing n − r items to leave out, so the count must be identical. That is why row n of Pascal's triangle reads the same left to right as right to left, and why the row peaks in the middle at r = n/2. This symmetry halves the work in almost every computation: you never need to evaluate C(n, r) for r > n/2.

It is the coefficient in the binomial expansion

The binomial theorem says (a + b)ⁿ = Σ C(n, k) · aⁿ⁻ᵏ · bᵏ. The numbers in Pascal's triangle are precisely these coefficients — which is why the triangle is the fastest way to expand (a + b)ⁿ for small n, and why C(n, k) appears wherever a binomial power is expanded, from probability to generating functions to the binomial option-pricing model.

It counts subsets, samples and lottery tickets

Every "how many ways can I choose..." question is a binomial coefficient. A five-card poker hand: C(52,5) = 2,598,960. A six-number national lottery: C(49,6) = 13,983,816. A quality-control sample of 20 from a batch of 1,000: C(1000,20) ≈ 3.4 × 10⁴¹. The same number also gives the normalising constant in the binomial probability distribution, linking combinatorics directly to statistics.

How to Use This Calculator

The relation nCr = n! / (r! · (n − r)!) links three quantities. Choose which one you want the tool to find, then fill in the other two.

1. Choose what to solve for

Pick nCr, n, or r from the toggle. Solving for n or r searches the binomial sequence for the value you entered — and reports when no exact solution exists.

2. Use realistic presets

n presets run from 5 (a poker hand) to 100. r presets run from 0 to 25. nCr presets include the famous values 2,598,960 (five-card hands) and 13,983,816 (UK Lotto).

3. Respect the domain

Both n and r must be non-negative integers, and r ≤ n. The tool flags violations inline. C(n, 0) = C(n, n) = 1 always, and C(n, r) = C(n, n − r) always.

4. Read the result and verdict

The result card shows the coefficient alongside the permutation nPr, the factorial values and a colour-coded badge classifying the magnitude from trivial through small, moderate, large and astronomical.

5. Check the row and the triangle

The chart plots every coefficient in row n, highlighting your value and its symmetric partner. The Pascal's triangle strip below shows the rows above and including n, with the relevant cells marked.

6. Switch to Advanced for depth

Advanced mode adds a chart of nCk against n for fixed k, a sensitivity panel, and a companion table including nPr, r!, (n−r)!, 2ⁿ, the row sum, and the binomial probability for a fair coin.

What This Tool Offers

Built around the binomial coefficient nCr = n! / (r! · (n − r)!), the fundamental count of unordered selections.

Three-way solving

Solve for the combination, the total n, or the chosen r. Solving for n or r runs a search over the binomial sequence and reports whether an exact solution exists.

Highlighted Pascal row

The full triangle up to row n with your coefficient and its symmetric partner marked, plus a bar chart of every value in the row.

Magnitude verdict

Each result is classified from trivial (under 10) through small, moderate, large, very large, astronomical and up to combinatorial explosion.

Multi-metric hints

Every field shows related quantities — nPr, r!, (n − r)!, 2ⁿ — so you can cross-check against any combinatorics problem.

Growth chart

Advanced mode plots nCk against n for the current k, showing how quickly the coefficient grows — and marking your point on the curve.

Reference tables

A live nCr / nPr converter, a Pascal's triangle lookup grid, a table of famous combinations from poker to lotteries, and a variable reference.

Reference Tables & Conversions

A live nCr / nPr converter, a Pascal's triangle lookup grid, and a table of well-known combinatorial counts.

Combinations / permutations converter

n
r
nCr
nPr
r!
= ₁₀C₃ = 120 · ₁₀P₃ = 720 · 3! = 6 · ₁₀C₇ = 120 (symmetric)

Pascal's Triangle — First 13 Rows

Each entry is C(n, k). Row n has n + 1 entries and the row sums to 2ⁿ.

nCoefficients C(n, 0) … C(n, n)Row sum 2ⁿ

Famous Combinations

Real-world counts that are all binomial coefficients in disguise.

SituationnrnCrNotes
Coin toss outcomes (HHHT in any order)434Four strings with exactly three heads
Poker hand (five cards)5252,598,960Total distinct five-card hands
UK National Lottery (six numbers)49613,983,816Odds of one ticket on the jackpot
US Powerball (five white balls)69511,238,513White-ball combinations before the powerball
Bridge hand (thirteen cards)5213635,013,559,600Distinct bridge deals per player
Football pools (ten matches, 3 outcomes)105252Half the matches drawn
Choosing a 3-person committee103120Classic small combinatorics problem
Quality sample from a batch1,00020≈ 3.4 × 10⁴¹Sampling frame of a large production lot
Bit strings of length 8 with four 1s8470Balanced bytes — a classic computer-science count
Choosing a 5-a-side team from 12125792Ignoring positions

Variable Reference

SymbolMeaningDomainTypical range
nTotal number of items in the poolNon-negative integer0 – 1,000 in typical use
rNumber of items chosenInteger, 0 ≤ r ≤ n0 – 100 in typical use
nCrBinomial coefficient — combinationsPositive integer1 – 10⁴⁰ and beyond
nPrPermutations — ordered selectionsPositive integer, nPr ≥ nCr1 – 10⁴⁵ and beyond
n!Factorial of nPositive integer1 – 10³⁰⁸ (until floating-point overflow)
2ⁿTotal number of subsetsPositive integerRow sum of Pascal's triangle

What Does nCr = n! / (r! · (n − r)!) Measure?

The binomial coefficient C(n, r) counts the number of distinct ways to choose r items from a pool of n items when the order of selection does not matter. It is the fundamental counting function of combinatorics: it answers the question "how many different subsets of size r does an n-element set have?" and it appears in probability, statistics, algebra, computer science, cryptography and genetics.

The Combinations Formula

The standard definition:

nCr = n! / (r! · (n − r)!)

The multiplicative form, which is easier to compute and avoids large factorials:

nCr = n · (n − 1) · (n − 2) · … · (n − r + 1) / r!

The recurrence used to build Pascal's triangle:

nCr = (n−1)C(r−1) + (n−1)Cr   with   nC0 = nCn = 1

And the relationship to permutations:

nPr = nCr · r!   ⟺   nCr = nPr / r!

Why the Formula Works

Start by counting ordered selections. If you choose r items from n one at a time without replacement, the first choice has n options, the second has n − 1, the third has n − 2, and so on down to n − r + 1. That product is the number of permutations, nPr = n! / (n − r)!.

But every unordered selection of r items can be arranged in r! different orders, and permutations count all of them separately. To convert the ordered count into the unordered count, divide by r!:

nCr = nPr / r! = [n! / (n − r)!] / r! = n! / (r! · (n − r)!)

Nothing else is required. The entire formula is a two-line argument: count the orderings, then divide by the number of ways to order what you chose.

Key Properties of the Binomial Coefficient

Six identities do almost all the practical work. Symmetry: C(n, r) = C(n, n − r), because keeping r items is the same as discarding n − r. Boundary values: C(n, 0) = C(n, n) = 1, because there is exactly one empty subset and one full subset. Pascal's rule: C(n, r) = C(n−1, r−1) + C(n−1, r), which is how the triangle is built and which encodes the two cases "the new item is chosen" and "the new item is not chosen". Row sum: Σ C(n, k) for k = 0 to n equals 2ⁿ, the total number of subsets. Alternating sum: Σ (−1)ᵏ C(n, k) = 0 for n ≥ 1. Vandermonde's identity: Σ C(m, k) · C(n, r − k) = C(m + n, r), which counts a choice from two separate pools.

One more property is worth knowing because it saves time in practice: the row is unimodal and peaks at r = n/2. When n is even, the single largest entry is C(n, n/2); when n is odd, the two largest entries are C(n, (n−1)/2) and C(n, (n+1)/2), which are equal by symmetry. This is why a fair coin produces a bell-shaped distribution of heads counts across the row.

Worked Examples

Given: n = 10, r = 3 — solve for ₁₀C₃
₁₀C₃ = 10! / (3! · 7!) = 3,628,800 / (6 · 5,040) = 120
Given: n = 5, r = 2 — solve for ₅C₂
₅C₂ = 120 / (2 · 6) = 10
Given: n = 52, r = 5 — solve for ₅₂C₅ (poker hands)
₅₂C₅ = 52! / (5! · 47!) = 2,598,960
Given: n = 49, r = 6 — solve for ₄₉C₆ (lottery odds)
₄₉C₆ = 13,983,816 ways — a one-in-14-million chance on a single ticket
Given: n = 8, r = 4 — solve for ₈C₄
₈C₄ = 40,320 / (24 · 24) = 70
Given: n = 10, r = 0 or r = 10 — solve for the boundary
₁₀C₀ = ₁₀C₁₀ = 1 — one empty subset, one full subset
Given: C(n, 2) = 45 — solve for n
n(n − 1)/2 = 45 ⟹ n² − n − 90 = 0 ⟹ n = 10 ⟹ n = 10

Frequently Asked Questions

Order. A permutation counts every distinct arrangement of the chosen items; a combination counts only the set, ignoring the order in which the items were chosen. Choosing a president, a vice-president and a treasurer from ten people gives ₁₀P₃ = 720 outcomes, because who holds which office matters. Choosing a three-person committee from the same ten gives ₁₀C₃ = 120 outcomes, because the committee is the same committee regardless of the order the names were drawn. The two are related by nPr = nCr · r!: divide the permutation count by r! to remove the redundant orderings.

Because choosing which r items to keep is logically the same act as choosing which n − r items to discard. Each subset of size r has exactly one complement of size n − r, and the pairing is one-to-one, so the two counts must be equal. This is why Pascal's triangle is symmetric left to right, why the row peaks in the middle, and why you never need to evaluate C(n, r) for r > n/2 — just swap r for n − r and compute the smaller value.

Both equal 1, for every value of n including n = 0. There is exactly one way to choose nothing — do nothing — and exactly one way to choose everything — take the whole set. This is also consistent with the definition 0! = 1, which is not arbitrary but forced by the recurrence C(n, r) = C(n−1, r−1) + C(n−1, r) and by the requirement that the formula n! = n · (n−1)! hold at n = 1. Those boundary values are what anchor both edges of Pascal's triangle at 1.

Use the multiplicative form: nCr = [n · (n−1) · … · (n−r+1)] / r!. Multiply the r descending terms together, then divide by r!. This keeps every intermediate value much smaller than n! would be, because the large tail factors of n! cancel against (n − r)!. For very large n and r, work in logarithms using lgamma: ln C(n, r) = lgamma(n+1) − lgamma(r+1) − lgamma(n−r+1), then exponentiate. This calculator uses the multiplicative method with logarithm fallback so it stays accurate far beyond the range where factorials overflow.

Because every subset of an n-element set has some size k between 0 and n, and C(n, k) counts the subsets of size k. Summing across all k therefore counts every subset exactly once, giving the total number of subsets. And the total number of subsets is 2ⁿ, because each of the n elements is independently either in or out — two choices per element, n elements. The identity Σ C(n, k) = 2ⁿ is the algebraic statement of that double-counting argument, and it is also what you get by setting a = b = 1 in the binomial theorem.

No. For non-negative integers n and r with r ≤ n, C(n, r) is always a positive integer. It counts a number of subsets, so it cannot be fractional, and it cannot be negative because there are no negative counts. If a calculation produces a fraction, either the inputs were not integers or an arithmetic error occurred. The calculator enforces integer inputs and flags any violation. Note that the generalised binomial coefficient for non-integer arguments does exist in advanced mathematics — it appears in Newton's generalised binomial theorem — but that is a different function from the one on this page.

It computes nCr using the multiplicative product rather than dividing two factorials, which keeps intermediate values much smaller and delays overflow. When the result exceeds the range of a double-precision float (roughly 1.8 × 10³⁰⁸), the calculator switches to a logarithmic computation and reports the value in scientific notation, along with a note that the displayed digits are approximate. Values like C(1000, 20) ≈ 3.4 × 10⁴¹ are reported accurately to the limit of double precision. Beyond that, exact integer arithmetic would require arbitrary-precision libraries, which are outside the scope of a browser calculator.

Calculating...

Variables

Symbol Quantity Unit
nCr Number of combinations
n Total number of distinct items
r Number of items being chosen

What it means

The number of combinations (unordered selections) of r items from a set of n distinct items is nCr = n!/(r!(n−r)!). This counts subsets, where order does not matter. It is used in probability (e.g., lottery odds), in statistics (binomial distribution), in combinatorics, and in computer science (e.g., for algorithm analysis of subsets). It also appears in Pascal’s triangle. Understanding combinations is essential for counting problems, for evaluating binomial probabilities, and for combinatorial optimization.

Worked example

Combinations – Two Examples

Real‑World
Scenario: How many ways to choose 2 fruits from 5 different ones? Order doesn't matter.
ParameterValue
n5
r2
1₅C₂ = 5!/(2!·3!) = 10
Result 10 ✓ Subsets
Scenario: A committee of 3 is chosen from 7 members. How many possible committees?
ParameterValue
n7
r3
1₇C₃ = 7!/(3!·4!) = 35
Result 35 ✓ Committees
Insight: Order does not matter. nCr = n!/(r!(n−r)!). Symmetric: nCr = nC(n−r).

Common mistakes

  • Combinations: nCr = n!/(r!(n−r)!) – order does not matter.
  • If r > n: The result is 0.
  • Symmetry: nCr = nC(n−r) – use this for simplification.
  • Applications: Used in probability, binomial theorem, and selection problems.
  • Check: For small numbers, verify manually.

Applications

Combinations, nCr = n!/(r!(n−r)!), give the number of unordered selections of r items from a set of n. This is used in probability, statistics, and decision analysis. Engineers apply it in quality control (sampling plans), in reliability engineering (component selection), and in software testing (test case combination). In finance, it helps in portfolio selection. By knowing combinations, professionals can count possible outcomes without order, which is critical for risk assessment, experimental design, and combinatorial optimisation. This formula is a basic tool for any quantitative analysis involving discrete choices.

  • Sampling plans and acceptance sampling in quality control
  • Reliability analysis – selecting components for redundancy
  • Test case generation and combinatorial testing
  • Portfolio selection and asset allocation
  • Probability calculations in games and risk analysis