ThisCalculator

Technology

Combination Factorial Calculator: nCr Formula

Updated · Standard formula, shown below

Combinations (nCr) 120 ways
Permutations (nPr)
720 ways
Result
n!
3,628,800
Result
Total items (n)
10
You entered

Combination Factorial Calculator: nCr Formula

This calculator works out combinations (nCr) — how many ways you can choose r items from a set of n items when order doesn’t matter. You enter the total number of items (n) and the number you’re choosing (r), and it returns the exact number of combinations using the factorial formula n! / (r! × (n−r)!).

Formula

The combination formula is written as:

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

  • n — total number of distinct items (unitless count, must be a non‑negative integer)
  • r — number of items chosen (unitless count, 0 ≤ r ≤ n)
  • ! — factorial, meaning n! = n × (n−1) × (n−2) × … × 1, and 0! = 1

The result is the number of distinct subsets of size r that can be formed from n items. Because order is ignored, choosing {A, B} is the same as {B, A}.

Worked Example

Using the default values n = 10, r = 3:

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

The calculator shows 120 combinations — matching the step-by-step result. It also displays the number of permutations (10P3 = 720) and 10! for reference.

When to Use Combinations vs. Permutations

The single most common mistake is using combinations when order matters, or vice versa. Here’s the quick guide:

  • Combinations (nCr) — order does not matter. Examples: picking 3 winners from 10 contestants (all get the same prize), choosing 5 toppings from a menu of 12, forming a committee of 4 from 20 people.
  • Permutations (nPr) — order does matter. Examples: assigning 3 distinct roles (president, treasurer, secretary) from 10 people, arranging 3 books on a shelf from 10 available, creating a 4‑digit PIN from 10 digits without repetition.

If you’re unsure, ask: would swapping two chosen items produce a different outcome? If yes, it’s a permutation; if no, it’s a combination.

Common Mistakes and Practical Tips

  • Confusing n and r — C(n, r) = C(n, n−r). For example, C(10,3) = C(10,7) = 120. This symmetry can be used to simplify calculations when r is large (e.g., C(100, 98) = C(100, 2) = 4,950).
  • Using r > n — The formula gives a result only when 0 ≤ r ≤ n. If r > n, the combination is undefined (or zero by convention). The calculator forces r ≤ n by design.
  • Forgetting 0! = 1 — This special case is essential. C(n, 0) = C(n, n) = 1 for any n.
  • Rounding errors with large n — Factorials grow extremely fast. 20! ≈ 2.43 × 10^18, which exceeds the safe integer range in many calculators (beyond 2^53 ≈ 9 × 10^15). The calculator uses arbitrary‑precision arithmetic internally, so it stays exact for n up to several hundred, but if you copy results to a spreadsheet, be aware of floating‑point limits.

Limits of the Factorial Formula

The combination formula assumes distinct items and selection without replacement. It does not apply when:

  • Items are identical (e.g., choosing 3 red balls from a bag of 5 identical red balls — that’s just 1 way, not C(5,3)=10).
  • Repetition is allowed (e.g., choosing 3 scoops of ice cream from 5 flavors, where you can pick the same flavor twice). That uses the “combinations with repetitionâ€� formula: C(n+r−1, r).
  • Items are arranged in a circle or other constrained layout — different formulas apply.

For most real‑world counting problems — lottery tickets, card hands, team selections, test questions — the standard nCr formula is exactly what you need.

How to Use the Calculator

  1. Enter the total number of items (n) in the first field. This must be a non‑negative integer.
  2. Enter the number of items to choose (r) in the second field. It must be between 0 and n.
  3. The result appears instantly: the number of combinations in large bold text.
  4. Use the additional outputs to see permutations (nPr) and the factorial n! for cross‑checking.

The calculator is designed for quick, exact answers — no need to simplify factorials by hand, which becomes tedious even for moderate n.

Frequently Asked Questions

What is the difference between nCr and nPr?

nCr counts selections where order doesn’t matter (e.g., choosing 3 friends from 10). nPr counts arrangements where order matters (e.g., assigning 3 different roles to 3 of 10 people). The permutation formula is n! / (n−r)!, which is r! times larger than the combination formula for the same n and r.

Can I use this for lottery odds?

Yes, for the basic “choose k numbers from m� format. For example, in a 6/49 lottery, the number of possible tickets is C(49,6) = 13,983,816. Your chance of winning with one ticket is 1 in that number. However, real lotteries may have bonus balls or other rules, so check the specific game.

What if r is bigger than n?

The calculator won’t let you enter r > n because the formula is undefined in that case. In mathematics, C(n, r) is conventionally 0 when r > n, but it’s not a meaningful selection. If you need that, you can treat the result as 0.

How do I calculate combinations with repetition?

When you can choose the same item more than once (e.g., picking 3 scoops from 5 flavors), the formula changes to C(n+r−1, r). For n=5, r=3, that gives C(7,3) = 35. This calculator does not handle repetition; use the standard nCr formula on the adjusted values.

Why does the calculator show n! as well?

It’s a helpful cross‑check. If you’re verifying the result by hand, you need n!, r!, and (n−r)!. Having n! displayed saves you a step. It also illustrates how quickly factorials grow — 10! is already over 3.6 million.

Can I use this for probability calculations?

Yes, combinations are the building block of many probabilities. For example, the probability of drawing exactly 2 aces in a 5‑card hand from a 52‑card deck is C(4,2) × C(48,3) / C(52,5). You can compute each combination here and then divide manually or with another tool.

Related

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