MATH · PERMUTATION AND COMBINATION
Permutation and Combination Calculator
Calculate nPr (ordered permutations) and nCr (unordered combinations). Handles very large n using BigInt — no silent Infinity.
About This Calculator
Permutations count the number of ways to select and arrange r items from n, where order matters. Combinations count the number of ways to select r items where order does not matter. Both grow very rapidly — this calculator uses BigInt arithmetic for large values to avoid silent Infinity results.
How It Works
Select Permutation (nPr) or Combination (nCr), enter n (total items) and r (items to select). The calculator uses a multiplicative algorithm rather than computing raw factorials, which is both faster and avoids overflow for moderate n. For n greater than 170, it falls back to BigInt and returns an exact result as a formatted string.
The Formula
nPr = n! / (n − r)! nCr = n! / (r! × (n − r)!)
- n
- total number of items
- r
- number of items to select
Frequently Asked Questions
- When do I use permutation vs combination?
- Use permutation when order matters — for example, the number of ways to award gold, silver, and bronze from 10 athletes. Use combination when order does not matter — the number of ways to choose 3 toppings from 10 options.
- Why is nCr symmetric (nCr equals nC(n−r))?
- Choosing r items to include is equivalent to choosing n−r items to exclude. The count of either choice is the same.
- What happens for very large n?
- Standard floating-point numbers can represent up to about 9 × 10¹⁵ exactly. For very large results, the calculator automatically uses BigInt arithmetic and returns the exact value as a formatted number string, avoiding the silent Infinity that would occur otherwise.