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.
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
Pascal's Triangle — First 13 Rows
Each entry is C(n, k). Row n has n + 1 entries and the row sums to 2ⁿ.
| n | Coefficients C(n, 0) … C(n, n) | Row sum 2ⁿ |
|---|
Famous Combinations
Real-world counts that are all binomial coefficients in disguise.
| Situation | n | r | nCr | Notes |
|---|---|---|---|---|
| Coin toss outcomes (HHHT in any order) | 4 | 3 | 4 | Four strings with exactly three heads |
| Poker hand (five cards) | 52 | 5 | 2,598,960 | Total distinct five-card hands |
| UK National Lottery (six numbers) | 49 | 6 | 13,983,816 | Odds of one ticket on the jackpot |
| US Powerball (five white balls) | 69 | 5 | 11,238,513 | White-ball combinations before the powerball |
| Bridge hand (thirteen cards) | 52 | 13 | 635,013,559,600 | Distinct bridge deals per player |
| Football pools (ten matches, 3 outcomes) | 10 | 5 | 252 | Half the matches drawn |
| Choosing a 3-person committee | 10 | 3 | 120 | Classic small combinatorics problem |
| Quality sample from a batch | 1,000 | 20 | ≈ 3.4 × 10⁴¹ | Sampling frame of a large production lot |
| Bit strings of length 8 with four 1s | 8 | 4 | 70 | Balanced bytes — a classic computer-science count |
| Choosing a 5-a-side team from 12 | 12 | 5 | 792 | Ignoring positions |
Variable Reference
| Symbol | Meaning | Domain | Typical range |
|---|---|---|---|
| n | Total number of items in the pool | Non-negative integer | 0 – 1,000 in typical use |
| r | Number of items chosen | Integer, 0 ≤ r ≤ n | 0 – 100 in typical use |
| nCr | Binomial coefficient — combinations | Positive integer | 1 – 10⁴⁰ and beyond |
| nPr | Permutations — ordered selections | Positive integer, nPr ≥ nCr | 1 – 10⁴⁵ and beyond |
| n! | Factorial of n | Positive integer | 1 – 10³⁰⁸ (until floating-point overflow) |
| 2ⁿ | Total number of subsets | Positive integer | Row 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:
The multiplicative form, which is easier to compute and avoids large factorials:
The recurrence used to build Pascal's triangle:
And the relationship to permutations:
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!:
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
₁₀C₃ = 10! / (3! · 7!) = 3,628,800 / (6 · 5,040) = 120
₅C₂ = 120 / (2 · 6) = 10
₅₂C₅ = 52! / (5! · 47!) = 2,598,960
₄₉C₆ = 13,983,816 ways — a one-in-14-million chance on a single ticket
₈C₄ = 40,320 / (24 · 24) = 70
₁₀C₀ = ₁₀C₁₀ = 1 — one empty subset, one full subset
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.
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| Parameter | Value |
|---|---|
| n | 5 |
| r | 2 |
| Parameter | Value |
|---|---|
| n | 7 |
| r | 3 |
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
Related calculators · Probability Distributions
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.