Combination Function Calculator: nCr Made Simple
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This combination calculator computes the number of ways to choose r items from a set of n distinct items, where order does not matter. You enter the total number of items (n) and the number of items to choose (r), and the calculator returns the combination count (nCr), often called the binomial coefficient. It also shows the result as a step-by-step formula so you can verify the math yourself.
Formula
The combination formula counts selections without regard to order:
nCr = n! / (r! × (n − r)!)
Where:
- n = total number of distinct items (a positive integer)
- r = number of items chosen (a positive integer, r ≤ n)
- ! = factorial (e.g., 5! = 5 × 4 × 3 × 2 × 1 = 120)
The result is always an integer. For example, 5C3 = 10 because there are 10 ways to pick 3 items from 5.
Worked Example
Using the default values (n = 10, r = 3):
- Compute 10! = 3,628,800
- Compute 3! = 6
- Compute (10 − 3)! = 7! = 5,040
- Plug in: 10C3 = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240 = 120
The calculator shows 120 combinations. That matches the formula’s output exactly.
When to Use Combinations vs. Permutations
The key question: does order matter? If you are selecting a committee, choosing lottery numbers, or picking toppings, order does not matter — use combinations. If you are arranging books on a shelf, assigning medals (gold, silver, bronze), or creating passwords, order matters — use permutations (nPr = n! / (n − r)!).
Example: From 5 people, choose 2 to form a pair. That’s 5C2 = 10 pairs. But if those 2 are assigned to specific roles (president and secretary), it’s 5P2 = 20 arrangements.
Common Mistakes and How to Avoid Them
- Entering r > n: The formula yields a factorial of a negative number, which is undefined. Always ensure r ≤ n.
- Confusing combinations with permutations: Remember, combinations ignore order; permutations do not.
- Using decimals: n and r must be non-negative integers. The calculator will round or error if you enter decimals.
- Misreading the result: 10C3 = 120, not 720 (which would be 10P3). Check whether order matters in your problem.
Real-World Applications
Combinations appear in probability, statistics, and everyday decisions:
- Lottery odds: The number of possible tickets in a 6/49 lottery is 49C6 = 13,983,816.
- Card games: A standard 52-card poker hand count is 52C5 = 2,598,960.
- Team selection: Choosing 5 players from a roster of 12 gives 12C5 = 792 possible teams.
- Binomial probability: The coefficient in the binomial expansion (a + b)^n is nCr.
Limits of the Formula
This formula assumes all items are distinct and that you are choosing without replacement. If items can repeat (e.g., choosing flavors with unlimited refills), use the “combinations with repetition� formula: (n + r − 1)Cr. Also, the factorial grows extremely fast — 70! is already beyond the range of most calculators, so for large n (above about 170), you may need a calculator that handles big integers or use logarithms.
How to Choose the Right Calculator
When using any combination calculator, check that it asks for n and r separately and that it clearly states whether it returns nCr or nPr. Some calculators also offer a “list� mode where you input a set of items and it generates all combinations. For most needs, a simple nCr calculator like this one suffices. If you need to compute probabilities, look for one that also gives the total number of outcomes.
Frequently Asked Questions
What is the difference between nCr and nPr?
nCr counts selections where order does not matter (e.g., choosing 3 friends from 10). nPr counts arrangements where order matters (e.g., assigning 3 different prizes to 3 of 10 people). The formula for nPr is n! / (n − r)!, which is always larger than nCr for r > 1.
Can I use this calculator for combinations with repetition?
No. This calculator assumes each item can be chosen at most once (without replacement). For combinations with repetition, use the formula (n + r − 1)Cr. For example, choosing 3 scoops from 5 flavors (with repeats allowed) is 7C3 = 35.
What if r = 0 or r = n?
If r = 0, there is exactly 1 way to choose nothing (nC0 = 1). If r = n, there is exactly 1 way to choose all items (nCn = 1). The calculator handles these correctly because 0! = 1.
Why does the calculator show permutations as well?
It is a convenience. Many users need both values, and seeing nPr helps clarify whether they have chosen the right calculation. If you only need combinations, ignore the permutations output.
How do I calculate combinations for large n, like n = 1000?
The factorial of 1000 is enormous (over 2,500 digits). Most standard calculators overflow. Use a calculator that supports arbitrary-precision integers or use the logarithmic form: log(nCr) = log(n!) − log(r!) − log((n−r)!). This gives an approximate value that is often sufficient for probability work.
Related
Formula used
in n | Total items (n) | - | 10 | 0 in r | Items to choose (r) | - | 3 | 0 out ncr | Combinations (nCr) | - | fact(n) / (fact(r) * fact(n - r)) | 0 out permutations | Permutations (nPr) | - | fact(n) / fact(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.