ThisCalculator

Technology

Combination Formula Calculator: nCr Explained

Updated · Standard formula, shown below

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

Combination Formula Calculator: nCr Explained

This combination calculator works out the number of ways to choose a subset of items from a larger set, where the order of the chosen items does not matter. You enter the total number of items (n) and the number of items to choose (r), and you get back the exact count of possible combinations, often written as nCr or C(n,r). The result tells you how many distinct groups can be formed, which is essential in probability, statistics, and many real-world counting problems.

Formula

The combination formula is:

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

Where:

  • n = total number of distinct items (a positive integer)
  • r = number of items chosen (a positive integer, 0 ≤ r ≤ n)
  • ! = factorial (e.g., 5! = 5 × 4 × 3 × 2 × 1 = 120)

The formula counts the number of subsets of size r from a set of n elements. It is derived by taking the number of permutations (n!/(n−r)!) and dividing by r! to remove the orderings that are counted as identical in combinations.

Worked Example

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

  1. Compute 10! = 3,628,800
  2. Compute 3! = 6
  3. Compute (10−3)! = 7! = 5,040
  4. Apply the formula: C(10,3) = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240 = 120

The calculator gives 120 combinations, matching the step-by-step result. The default also shows the number of permutations (nPr) for the same inputs: 10! / 7! = 720, which is 6 times larger because each group of 3 can be ordered in 3! = 6 ways.

When to Use Combinations vs. Permutations

The key question is: Does order matter?

  • Use combinations (nCr) when order does not matter. Examples: choosing 3 committee members from 10 people, picking 5 cards from a deck, selecting 2 toppings from a menu.
  • Use permutations (nPr) when order matters. Examples: assigning 3 distinct roles (president, secretary, treasurer) from 10 candidates, arranging 3 books on a shelf, ranking 5 finishers.

If you are unsure, ask: Would swapping two chosen items produce a different outcome? If yes, it is a permutation; if no, it is a combination.

Common Mistakes and Misconceptions

  • Mistaking combinations for permutations: This is the most frequent error. For the same n and r, permutations are always larger (by a factor of r!).
  • Using r > n: The formula is undefined when r exceeds n. The calculator enforces this by returning an error, but keep it in mind when doing manual calculations.
  • Forgetting that 0! = 1: This is a special case. C(n,0) = C(n,n) = 1, because there is exactly one way to choose nothing or everything.
  • Rounding errors: If you compute factorials manually with a regular calculator, large n (like 50) produce huge numbers that may overflow. Use a tool that handles big integers or logarithms.
  • Thinking combinations include order: They never do. The formula explicitly removes order by dividing by r!.

Limits of the Formula

The combination formula assumes all n items are distinct and that each item can be chosen at most once (no repetition). It does not apply to:

  • Combinations with repetition (e.g., choosing 3 scoops of ice cream from 5 flavors, where flavors can repeat). That formula is C(n+r−1, r).
  • Indistinguishable items (e.g., counting arrangements of letters with duplicates). You would need to divide by factorials of repeated counts.
  • Ordered selections – those are permutations, not combinations.

Also, the result can be astronomically large for moderate n and r. For example, C(100,50) is about 1.0 × 10^29, which exceeds the precision of many standard calculators. The calculator here uses exact integer arithmetic, so it will show the full number for n up to a few hundred.

How to Use the Calculator Effectively

  1. Enter the total number of items (n). This must be a non-negative integer.
  2. Enter the number of items you are choosing (r). It must be between 0 and n.
  3. Read the combination result as the number of possible groups.
  4. Optionally, check the permutation result if you are curious about the ordered count.

For example, to find how many 5-card poker hands can be dealt from a 52-card deck, enter n=52 and r=5. The calculator returns 2,598,960, which is the exact number of possible hands. That number is used in probability calculations for poker hands.

Real-World Applications

  • Lottery odds: The chance of winning a 6/49 lottery is 1 / C(49,6).
  • Sports brackets: Counting possible outcomes of a tournament.
  • Genetics: Predicting combinations of alleles.
  • Computer science: Analyzing algorithms that involve subsets.
  • Business: Choosing which projects to fund from a list.

In probability, combinations are used to count favorable outcomes. For instance, if you draw 3 cards from a deck, the number of ways to get exactly 2 hearts is C(13,2) × C(39,1). The total outcomes are C(52,3).

Frequently Asked Questions

What is the difference between nCr and nPr?

nCr counts combinations (order does not matter), while nPr counts permutations (order matters). For the same n and r, nPr = nCr × r!. For example, C(5,2) = 10, but P(5,2) = 20 because each pair can be arranged in 2 ways.

Can r be larger than n?

No. The formula is only defined for 0 ≤ r ≤ n. If r > n, the result is zero in a combinatorial sense because you cannot choose more items than exist. The calculator will show an error because the factorial of a negative number is undefined.

What does C(n,0) equal?

C(n,0) = 1. There is exactly one way to choose nothing from a set, regardless of n. Similarly, C(n,n) = 1 because there is one way to choose all items.

How do I calculate combinations with repetition?

Use the formula C(n+r−1, r). For example, choosing 3 scoops from 5 flavors (allowing repeats) gives C(5+3−1,3) = C(7,3) = 35. This calculator does not handle repetition, but the formula is simple to apply separately.

Why does the calculator also show permutations?

It is a convenience. Many people confuse the two, and seeing both side-by-side helps clarify the difference. The permutation result is always larger, and the ratio is r!.

What if my numbers are very large?

For n up to about 170, the factorial is too large for standard floating-point storage, but this calculator uses exact integer arithmetic, so it can handle n up to a few hundred. However, the result may be displayed in scientific notation if it exceeds a certain length, which is fine for most purposes.

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 perm | 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.