Combinatorics

Permutation & Combination Calculator — nPr & nCr

Enter n (total items) and r (items chosen) to instantly calculate both nPr (ordered arrangements) and nCr (unordered selections).

Advertisement

🔢 Enter n and r

🔢 Result

Enter n and r (with r ≤ n) to see permutations and combinations
⚠️

Disclaimer: This tool performs standard mathematical calculations for educational and reference purposes. Always double-check results independently for graded coursework, exams, or safety-critical applications.

Permutations vs. Combinations

Both permutations and combinations count the number of ways to choose r items out of a total of n, but they answer slightly different questions. A permutation (written nPr) counts ordered arrangements — it matters which item comes first, second, third, and so on. A combination (written nCr) counts unordered selections — only which items are chosen matters, not the order they're picked in.

The Formulas

nPr = n! / (n − r)! — the number of ways to arrange r items out of n, where order counts.

nCr = n! / (r! × (n − r)!) — the number of ways to choose r items out of n, where order doesn't count. Equivalently, nCr = nPr ÷ r!, since dividing out the r! ways to reorder any chosen group collapses permutations down to combinations.

Worked Example

Suppose n = 5 and r = 3 — picking 3 items from a group of 5.

  1. nPr: 5 × 4 × 3 = 60 ordered arrangements (multiplying the 3 numbers counting down from 5)
  2. r! (3!): 3 × 2 × 1 = 6
  3. nCr: 60 ÷ 6 = 10 unordered selections

So there are 60 ways to arrange 3 items from a group of 5 in order, but only 10 distinct groups of 3 if order doesn't matter.

Frequently Asked Questions

Order. A permutation counts arrangements where the sequence matters (1st place, 2nd place, 3rd place in a race), while a combination counts selections where it doesn't (picking 3 people for a committee, where each person's role is identical). Because nPr counts every ordering of the same group separately, nPr is always greater than or equal to nCr for the same n and r.
Every unordered group of r items can be arranged in r! different orders. nPr counts each of those orderings as a separate outcome, while nCr wants to count the group only once. Dividing nPr by r! collapses all those duplicate orderings back down to a single count per group.
Factorials grow extremely fast — 20! is already over 2 quintillion, and standard JavaScript numbers start losing exact precision well before that. Instead, this tool multiplies only the numbers actually needed (from n down to nāˆ’r+1), which keeps results accurate for much larger inputs than computing full factorials first.
Advertisement