Combination & Permutation Calculator (nCr / nPr)
Calculate combinations (nCr) and permutations (nPr) with factorials, step-by-step product expansion, and locks/arrangements explanations for probability problems.
nCr / nPr Calculator — interactive calculator, computed instantly in your browser.
nCr vs nPr: Counting Teams, Lotteries, and Rankings with Combinations
52 Cards, 5 Slots — Team vs Podium
Key Takeaway: Same players, different question — a committee is nCr; a ranked shortlist is nPr. Permutations always equal combinations × r!.
Combinations and permutations answer two variants of one question: how many ways can I pick things? If a team of 5 from 49 players matters only as a group, order is irrelevant — that is nCr. If a gold, silver, bronze podium from 8 finalists matters by position, order is everything — that is nPr. Getting the variant backwards is the single most common mistake in probability homework and lottery math.
1. nCr — Unordered Selection
- The extra r! in the denominator divides out every internal reordering of the same group
- Classic checks: 52C5 = 2,598,960 poker hands · 49C6 = 13,983,816 lottery lines · 20C2 = 190 handshakes
- Symmetry trick: C(n, r) = C(n, n−r) — choosing 5 to keep equals choosing 47 to discard; use the smaller k
- Edge cases: C(n, 0) = C(n, n) = 1, and C(n, r) = 0 whenever r > n
2. nPr — Ordered Arrangement
Each position you fill shrinks the pool by one: 8P3 = 8 × 7 × 6 = 336. Because every unordered group of r items can be arranged r! different ways, the two formulas lock together: nPr = nCr × r! — e.g. 52P5 = 2,598,960 × 120 = 311,875,200 ordered 5-card sequences.
3. Factorials & Common Pitfalls
- 0! = 1 by definition (empty product) — without it, C(n, 0) and C(n, n) would break
- Don't expand huge factorials: compute with the running product res = res × (n−k+i) ÷ i, which stays integral and avoids overflow
- Trailing zeros of n! come from pairs of 2 × 5 — count them with ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ …
- Replacement changes the rule: drawing with replacement or unlimited repeats is nʳ, not nCr — permutations of a multiset divide by repeated-item factorials
🔗 Counting, Probability & Data Analysis
Combinations count unordered selections while permutations count ordered arrangements — the backbone of lottery odds, sampling, and handshake problems. Browse our ➗ Math & Statistics Hub for the full probability toolkit.
Pair counting results with central tendency and spread measures for complete statistical summaries.
Frequently Asked Questions (nCr / nPr Calculator)
nCr (combinations) counts selections where order does not matter — teams, committees, lottery lines. nPr (permutations) counts arrangements where order matters — rankings, PINs, race finish orders. They convert via nPr = nCr × r!.
49C6 = 49! ÷ (6! × 43!) = 13,983,816 possible lines — exactly why a full system of every combination would cost millions. Order is irrelevant in a standard lottery, so this is a combination, not a permutation.
Ask: does swapping two picks create a new outcome? Podiums, passwords, and schedules — yes, use nPr. Teams, handshake groups, and lottery tickets — no, use nCr.
It is the empty product — the unique way to arrange zero objects is to do nothing, and defining 0! = 1 keeps nPr = n!/(n−r)! correct at r = n (nPr = n!/0! = n!) and nCr(n, 0) = 1.
It equals 0 — you cannot choose more items than exist, and there is genuinely no way to form such a group. The formula returns 0 automatically once the factorial ratio cannot be arranged.
This tool computes nCr/nPr with a running product instead of raw factorials, so it stays accurate for n up to 1,000. Standalone n! is capped at 170 because 171! ≈ 1.04 × 10³⁰⁸ exceeds 64-bit floating-point range.