Combinations Permutations Calculator
Calculate combinations (nCr) and permutations (nPr) with step-by-step factorial cancellation.
The combinations and permutations calculator computes nCr and nPr for any non-negative integers n and r where r ≤ n. It uses arbitrary-precision arithmetic for exact integer results and shows step-by-step factorial cancellation.
Combinations vs Permutations
Combinations (nCr) count unordered selections. For example, choosing a 3-person committee from 10 people — the order of selection does not matter. The formula is:
C(n, r) = n! / (r! × (n - r)!)
Permutations (nPr) count ordered arrangements. Awarding gold, silver, and bronze medals to 3 of 10 finalists — the order matters. The formula is:
P(n, r) = n! / (n - r)!
How to Use
Select either combinations or permutations. Enter the total number of items (n) and the number of items to choose (r). The calculator displays the result with a step-by-step breakdown showing the factorial cancellation process. Results update in real time.
Key Properties
- P(n, r) = C(n, r) × r! — each unordered selection can be arranged in r! distinct orders.
- C(n, 0) = C(n, n) = 1 — exactly one way to choose nothing or everything.
- C(n, r) = C(n, n - r) — symmetry property, choosing r items is the same as leaving n - r items out.
- The calculator supports n up to 170, after which factorial values exceed JavaScript's safe integer range.
Frequently Asked Questions
What is the difference between a combination and a permutation?
Combinations count unordered selections while permutations count ordered arrangements. Permutations are always at least as large as combinations because each unordered selection of r items can be arranged in r! distinct orders.
How do you calculate nCr?
Use C(n, r) = n! / (r! × (n - r)!). For efficiency, compute as the descending product of r terms divided by r!. For example, C(10, 3) = (10 × 9 × 8) / (3 × 2 × 1) = 120.
How do you calculate nPr?
Use P(n, r) = n! / (n - r)!, which simplifies to the descending product of r terms. For example, P(10, 3) = 10 × 9 × 8 = 720.
Is nCr the same as the binomial coefficient?
Yes. C(n, r) is exactly the binomial coefficient that appears in the binomial theorem and Pascal's triangle.
Why is C(n, 0) equal to 1?
There is exactly one way to choose nothing from a set: pick no items. Algebraically, C(n, 0) = n! / (0! × n!) = 1 because 0! = 1 by definition.