ThisCalculator

Technology

Every Combination Calculator? How to Count All Possible Sets

Updated · Standard formula, shown below

Combinations (nCr) 120 ways
Permutations (nPr)
720 ways
Result
Total items (n)
10 items
You entered
Chosen (r)
3 items
You entered

Every Combination Calculator? How to Count All Possible Sets

This calculator works out the number of combinations (nCr) for a given set size and selection size — that is, how many distinct groups you can form when order doesn’t matter. You enter the total number of items (n) and how many you choose (r), and you get back the exact count of possible combinations, along with the related permutation count. The formula used is the standard binomial coefficient: C(n, r) = n! / (r! × (n − r)!).

Formula

The number of combinations is given by the binomial coefficient:

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

  • n = total number of distinct items (unit: items, must be a non‑negative integer)
  • r = number of items chosen (unit: items, must be an integer between 0 and n)
  • ! = factorial, the product of all positive integers up to that number (e.g., 5! = 5×4×3×2×1 = 120)

The result is the number of unordered subsets of size r from a set of n items. If order matters, you use permutations instead: P(n, r) = n! / (n − r)!.

Worked Example

Using the default values from the calculator (n = 10, r = 3):

  1. Compute the factorials: 10! = 3,628,800; 3! = 6; (10−3)! = 7! = 5,040.
  2. Plug into the formula: C(10, 3) = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240.
  3. Divide: 3,628,800 ÷ 30,240 = 120.

So there are 120 ways to choose 3 items from 10. The calculator shows exactly 120 for the first output, and the permutation output is 10! / 7! = 720.

When to Use Combinations vs. Permutations

The key question is: does the order of the chosen items matter?

  • Combinations – order does not matter. Examples: choosing 3 toppings from 10 for a pizza; picking 5 players from a team of 12; selecting 2 colors from a palette of 8.
  • Permutations – order matters. Examples: assigning 3 distinct prizes to 10 people; arranging 4 books on a shelf; creating a 3‑digit PIN from digits 0‑9 (with repetition allowed, which is a separate case).

If the problem allows repetition (e.g., you can choose the same item more than once), the formulas change: combinations with repetition are C(n+r−1, r), and permutations with repetition are n^r. The calculator above assumes no repetition, which is the most common interpretation.

How to Read the Result

The combination count tells you how many distinct groups exist. For example, C(10, 3) = 120 means there are 120 different ways to pick 3 items from a set of 10, and each group differs from every other group by at least one item. The number grows quickly: C(50, 5) = 2,118,760, which is why lottery odds are so low. The permutation output is always larger (or equal) than the combination output for the same n and r, because each combination can be arranged in r! different orders.

Common Mistakes and Pitfalls

  • Confusing n and r – C(n, r) = C(n, n−r). For example, C(10, 3) = C(10, 7) = 120. Swapping them doesn’t change the result, but mixing up which number is the total set size does.
  • Using combinations when order matters – If you’re arranging items, you need permutations. A common error is using nCr for a sequence of events.
  • Forgetting that r cannot exceed n – If r > n, the result is 0 (you can’t choose more items than exist). Most calculators, including this one, will show an error or 0.
  • Rounding errors with large numbers – Factorials grow astronomically; for n > 170, standard floating‑point arithmetic overflows. This calculator uses exact integer arithmetic up to reasonable limits, but for very large n you may need a specialized tool.

Limits of the Formula

The binomial coefficient assumes distinct items and no repetition. If items are identical (e.g., counting color combinations of identical balls), the formula doesn’t apply. Also, the formula counts subsets, not sequences; if you need to count ordered arrangements, use permutations. For problems with repetition allowed, the formulas differ as noted above. The calculator works for any non‑negative integers n and r with r ≤ n, but for extremely large n (above about 1,000,000) the computation may be slow or exceed memory.

Alternatives and Related Calculations

  • Permutation calculator – use when order matters (nPr).
  • Combinations with repetition – use when you can pick the same item more than once (e.g., choosing 3 flavors from 5 with repeats allowed): C(n+r−1, r).
  • Multinomial coefficient – counts ways to partition n items into groups of specified sizes.
  • Binomial probability – uses combinations to find the probability of k successes in n trials.

For most everyday counting problems, this calculator covers the basics. If you need to count arrangements with restrictions, you may need to break the problem into smaller steps.

Frequently Asked Questions

What is the difference between a combination and a permutation?

A combination is a selection where order doesn’t matter (e.g., choosing 3 fruits from a basket). A permutation is an arrangement where order matters (e.g., arranging 3 fruits in a row). For the same n and r, the number of permutations is r! times larger than the number of combinations.

Can I use this calculator for lottery odds?

Yes, for a simple lottery where you pick r numbers from n without replacement and order doesn’t matter, the number of possible tickets is C(n, r). For example, a 6/49 lottery has C(49, 6) = 13,983,816 possible combinations. The probability of winning with one ticket is 1 divided by that number.

What if I want to count combinations with repetition?

Use the formula C(n+r−1, r). For example, choosing 3 scoops of ice cream from 5 flavors (repeats allowed) gives C(5+3−1, 3) = C(7, 3) = 35. This calculator does not handle that case directly, but you can compute it using the same nCr function with modified inputs.

Why does the calculator show an error when r > n?

Because you cannot choose more items than exist. The mathematical definition of C(n, r) is 0 when r > n, but many calculators return an error to avoid confusion. If you see an error, check that your r is not larger than n.

How do I calculate combinations for very large numbers?

For n up to about 170, you can use the factorial formula directly. For larger n, use the logarithmic form or a specialized arbitrary‑precision calculator. This tool uses exact integer arithmetic, so it can handle moderately large values, but extremely large n may be slow.

What does the “nCr� notation mean?

nCr is a common shorthand for the number of combinations of n items taken r at a time. It’s read as “n choose r� and equals n! / (r! × (n−r)!). It appears in probability, statistics, and combinatorics.

Related

Formula used
in n | Total items (n) | items | 10 | 0
in r | Chosen (r) | items | 3 | 0
out comb | Combinations (nCr) | ways | ncr(n,r) | 0
out perm | Permutations (nPr) | ways | 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.