Combination nCr Calculator: Formula, Uses & Examples
- Permutations (nPr)
- Result
- Total items (n)
- 10
- You entered
- Items chosen (r)
- 3
- You entered
This combination calculator (nCr) works out how many ways you can choose r items from a set of n distinct items, where the order of selection does not matter. You enter the total number of items (n) and the number you want to pick (r), and the calculator returns the exact number of possible combinations. For example, choosing 3 toppings from a menu of 10 gives 120 different combinations.
Formula
The number of combinations is given by the binomial coefficient:
nCr = n! / [r! × (n − r)!]
- n = total number of distinct items (unitless count)
- r = number of items chosen (unitless count, ≤ n)
- ! = factorial, meaning the product of all positive integers up to that number (e.g., 5! = 5×4×3×2×1 = 120)
The result is a whole number. It counts unordered selections, so choosing {A, B, C} is the same as {C, B, A}.
Worked Example
Using the default values from the calculator above: n = 10, r = 3.
- Compute 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800
- Compute 3! = 3 × 2 × 1 = 6
- Compute (10 − 3)! = 7! = 5,040
- Apply the formula: 10C3 = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240 = 120
The calculator returns 120 combinations, matching the step-by-step result. The second output, 10P3 = 720, shows how many ordered arrangements exist for the same n and r.
When to Use nCr vs. nPr
The key question is: does order matter? If you are selecting a committee, a hand of cards, or a pizza topping list, order does not matter — use combinations. If you are assigning positions (president, treasurer) or arranging items in a sequence, order matters — use permutations (nPr).
Concrete examples:
- Combination: How many 5-card hands from a 52-card deck? 52C5 = 2,598,960.
- Permutation: How many ways to assign 3 different roles to 10 people? 10P3 = 720.
- Combination: How many ways to pick 2 colors from 8 for a flag? 8C2 = 28.
- Permutation: How many ways to arrange 3 books on a shelf from 5? 5P3 = 60.
If you accidentally use nPr when order doesn’t matter, you overcount by a factor of r! — the number of ways to reorder the chosen items.
Common Mistakes and Pitfalls
- Entering r > n: The formula gives zero (or undefined in some calculators). You cannot choose more items than exist. The calculator above returns 0 for r > n.
- Mixing up n and r: nCr is symmetric (nCr = nC(n−r)), so 10C3 = 10C7 = 120. But nPr is not symmetric; 10P3 = 720, while 10P7 = 604,800.
- Forgetting that 0! = 1: This is essential for cases like nC0 or nCn, both equal 1.
- Using combinations when order matters: This undercounts. For example, 10C3 = 120, but 10P3 = 720 — a factor of 6 (which is 3!) difference.
- Rounding: The result is always an integer. If you get a decimal, you likely misapplied the formula.
Real-World Applications
Combinations appear throughout mathematics, statistics, and everyday decision-making:
- Lottery odds: The chance of winning a 6/49 lottery is 1 in 49C6 = 13,983,816.
- Card games: Counting possible poker hands or bridge deals relies on nCr.
- Probability: The binomial distribution uses nCr to count success/failure sequences.
- Team selection: Choosing a project group from a larger pool, regardless of role.
- Genetics: Calculating possible gene combinations from alleles.
- Network design: Counting possible connections between nodes.
In statistics, the binomial coefficient is fundamental to the binomial theorem and probability mass function. For a fixed n, the values of nCr form a symmetric bell-shaped curve known as the binomial distribution.
How the Calculator Works
The calculator uses the factorial formula directly, but for large n and r, it avoids computing huge intermediate factorials. Instead, it simplifies the fraction: nCr = [n × (n−1) × … × (n−r+1)] / r!. For example, 10C3 = (10×9×8) / (3×2×1) = 720/6 = 120. This reduces the risk of overflow and speeds up computation.
For very large values (n > 1000), the result can exceed the precision of standard floating-point numbers. In such cases, the calculator may display scientific notation or an approximate value. For exact integer results, you would need arbitrary-precision arithmetic, which is beyond the scope of this simple online tool.
Limitations and Accuracy
The formula is exact for all non-negative integers n and r (with r ≤ n). The calculator is accurate for n up to about 170 when using double-precision floating-point, because 170! is near the maximum representable value. Beyond that, results may lose precision or show as infinity. If you need exact large combinations, consider using a dedicated arbitrary-precision calculator or programming language.
Also note that the calculator assumes all n items are distinct. If some items are identical, the number of distinct selections is smaller and requires a different formula (multinomial coefficients).
Frequently Asked Questions
What is the difference between nCr and nPr?
nCr counts unordered selections (choose a committee), while nPr counts ordered arrangements (assign roles). The relationship is nPr = nCr × r!. For the same n and r, permutations are always larger (unless r = 0 or 1).
Can I use nCr when r is larger than n?
No, mathematically the result is zero because you cannot choose more items than exist. The calculator returns 0 for r > n. If you see an error, check your inputs.
Why does 0! equal 1?
This is a mathematical convention that makes formulas work. It arises because there is exactly one way to arrange zero items, and it ensures the binomial theorem and combinations formula hold for r = 0 and r = n.
How do I calculate nCr on a scientific calculator?
Most scientific calculators have an nCr button, often accessed via the MATH or PRB menu. Enter n, press the nCr key, enter r, then press equals. If your calculator lacks this, you can use the formula with factorials, but be careful with large numbers.
What does “C” stand for in nCr?
The C stands for “combinations” or “choose.” It is also written as C(n, r), or with binomial notation like (n over r) in a vertical parenthesis. All mean the same thing.
Does the order of n and r matter?
For combinations, no: nCr = nC(n−r). For example, 10C3 = 10C7 = 120. But for permutations, yes: nPr ≠nP(n−r) in general. Always double-check which formula you need.
Related
Formula used
in n | Total items (n) | - | 10 | 0 in r | Items chosen (r) | - | 3 | 0 out comb | Combinations (nCr) | - | ncr(n, r) | 0 out perms | Permutations (nPr) | - | npr(n, r) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.