Permutation and Combination Calculator
6P2 = 30
- n
- 6
- r
- 2
- 6P2
- 30
- 6C2
- 15
What this calculator does
Permutations and combinations count how many ways you can choose items from a set. The difference is order. A permutation counts every distinct arrangement, so choosing A then B is different from choosing B then A. A combination counts only which items were chosen, so those two arrangements count once.
This calculator takes the total number of items n and the number chosen r, then reports both counts. It is useful for probability problems, lottery odds, seating arrangements, password patterns, and quality-control sampling.
How to use this calculator
- Enter n, the total number of distinct items in the set.
- Enter r, the number of items selected.
- Click Calculate.
Both inputs must be whole numbers, and r cannot be larger than n. The headline shows the permutation count. The summary rows repeat n and r and show the combination count.
Formulas
Permutations: nPr = n! / (n − r)!
Combinations: nCr = n! / (r! × (n − r)!)
The exclamation mark denotes a factorial. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. A permutation arranges r items out of n, while a combination first counts the arrangements and then divides by the r! ways those chosen items can be ordered among themselves.
Default example
The default inputs are n = 6 and r = 2. There are 6 × 5 = 30 ordered pairs, which is 6P2. Because each pair can be ordered in 2! = 2 ways, the number of unordered pairs is 30 / 2 = 15, which is 6C2.
A larger example makes the difference clear. Choosing a 5-card hand from a 52-card deck gives 52C5 = 2,598,960 possible hands. If the order in which the cards are dealt matters, the count rises to 52P5 = 311,875,200.
Assumptions and limitations
- Items are treated as distinct. If some items are identical, the standard formulas overcount and a multiset formula is needed.
- Selection is without replacement. Each item can be chosen at most once. Combinations with repetition use a different formula.
- Order matters for permutations and does not matter for combinations. The calculator reports both so you can choose the interpretation that fits the problem.
- r must be between 0 and n inclusive. The case r = 0 returns 1 for both counts, representing the single empty selection.
- n is limited to 170 because factorials above that exceed the range of JavaScript numbers. Results beyond the safe integer range may lose exact integer precision in their final digits.
- The calculator does not list the actual arrangements or selections; it only returns their counts.
Frequently asked questions
When should I use a permutation instead of a combination?
Use a permutation when the order of the selected items changes the outcome, such as assigning first, second, and third place in a race. Use a combination when only membership matters, such as choosing three toppings for a pizza.
Why does nCr equal nPr divided by r factorial?
A permutation counts every ordering of the chosen items. For any set of r chosen items, there are r! different orders that produce the same combination. Dividing the permutation count by r! removes those duplicate orderings and leaves one count per unordered selection.
What does r = 0 mean?
Choosing zero items from a set has exactly one outcome: the empty selection. Both nP0 and nC0 therefore equal 1, regardless of how many items are in the set. This convention also keeps the factorial formulas consistent.
Source
Reference: Calculator.net — Permutation and Combination Calculator.
Math Calculators
- Scientific Calculator
- Fraction Calculator
- Percentage Calculator
- Percent Error Calculator
- Random Number Generator
- Exponent Calculator
- Binary Calculator
- Hex Calculator
- Half-Life Calculator
- Quadratic Formula Calculator
- Log Calculator
- Ratio Calculator
- Root Calculator
- Least Common Multiple Calculator
- Greatest Common Factor Calculator
- Factor Calculator
- Rounding Calculator
- Matrix Calculator
- More Math Calculators