How permutations and combinations differ
Both count ways to pick r items from n distinct items. A permutation counts ordered arrangements, so ABC and CBA are different. A combination counts unordered selections, so ABC and CBA are the same — which is why nCr divides nPr by r!, the number of orderings of the r chosen items.
- n — total number of distinct items
- r — how many are chosen
- n! — factorial: n × (n−1) × … × 1
More detail
Order matters vs. order doesn't
Choosing 2 people from 5 for President and Vice-President is a permutation (5P2 = 20) because the two roles are different. Choosing 2 people from 5 for an unranked committee is a combination (5C2 = 10) because swapping who was “picked first” changes nothing. There are always r! more permutations than combinations — here 2! = 2, and 20 ÷ 2 = 10.
Quick sanity check. nCr is symmetric: nCr = nC(n−r). So choosing 2 from 5 (10 ways) equals choosing 3 from 5 — picking who's in is the same as picking who's out. nPr is always ≥ nCr, and they're equal only when r is 0 or 1.
Frequently asked questions
What's the difference between a permutation and a combination?
A permutation counts ordered arrangements (order matters); a combination counts unordered selections (order doesn't). For 5 items choosing 2, there are 5P2 = 20 permutations but only 5C2 = 10 combinations — exactly 2! = 2 times fewer, since each pair can be ordered two ways.
How many ways can I choose 2 from 5?
As a combination (order doesn't matter): 5C2 = 5! / (2!·3!) = 10. As a permutation (order matters): 5P2 = 5! / 3! = 20. Enter n = 5, r = 2 above to see both.
What is 10P3 and 10C3?
10P3 = 10 × 9 × 8 = 720 ordered arrangements. 10C3 = 720 ÷ 3! = 720 ÷ 6 = 120 unordered selections. Enter n = 10, r = 3 to check.
What happens if r is larger than n?
You can't choose more distinct items than exist, so both nPr and nCr are 0 — this calculator shows “—”. The formulas require 0 ≤ r ≤ n; nP0 and nC0 both equal 1 (one way to choose nothing).
What happens if n and r are large, like 30 and 15, or 60 and 30?
nPr and nCr are checked separately, because nCr = nPr ÷ r! is never larger (they are equal only when r is 0 or 1). With n = 30, r = 15, nPr exceeds 2^53−1 and shows “—”, but nCr = 155,117,520 still fits and is shown. Only when nCr itself exceeds 2^53−1 (like 60C30) do both show “—” — 2^53−1 is the largest integer a JavaScript number can represent exactly.