Permutation and Combination

Compare Calculations

Downloads

Includes your inputs and results for this calculation, plus any additional calculations you've compared.

Counting Arrangements and Selections From a Group

A permutation (nPr) counts how many ways to arrange r items out of n where order matters, while a combination (nCr) counts how many ways to choose r items out of n where order doesn’t matter. Enter a total number of items (n) and how many you’re choosing (r), and this calculator finds both related answers at once.

The Formulas

  • Permutations: P(n,r)=n!(nr)!P(\vA{n}, \vB{r}) = \frac{\vA{n}!}{(\vA{n} - \vB{r})!} — equivalently, the product of r\vB{r} descending numbers starting at n\vA{n}: n×(n1)××(nr+1)\vA{n} \times (\vA{n}-1) \times \cdots \times (\vA{n}-\vB{r}+1).
  • Combinations: C(n,r)=P(n,r)r!C(\vA{n}, \vB{r}) = \frac{P(\vA{n}, \vB{r})}{\vB{r}!} — the same permutations count, divided by the r!\vB{r}! ways those same r\vB{r} items could themselves be reordered (since order doesn’t matter for a combination).

Worked Example

Choosing 3 items from a group of 10, where order matters (permutations):

P(10,3)=10×9×8=720P(10,3) = 10 \times 9 \times 8 = 720

The same choice where order does NOT matter (combinations):

C(10,3)=720÷3!=720÷6=120C(10,3) = 720 \div 3! = 720 \div 6 = 120

A Real-World Check

The odds of matching all 6 numbers in a 6-from-49 lottery draw are 1 in C(49,6) — exactly 13,983,816 — since the order the numbers are drawn in doesn’t change whether you’ve won.

Key Factors to Consider

  • Whether order matters is the single question that determines which formula applies. Arranging medal winners on a podium (1st, 2nd, 3rd place matters) is a permutation problem, while choosing which 3 people make a committee (no ranking involved) is a combination problem — identifying this distinction correctly is the most common source of error when applying these formulas.
  • Combinations always produce an equal or smaller count than permutations for the same n and r. Since a combination groups together every possible ordering of the same r items into a single count, C(n,r) is always P(n,r) divided by r! — the two values only match exactly when r is 0 or 1, since there’s only one way to arrange 0 or 1 items regardless of order.
  • Both permutation and combination counts grow extremely fast as n and r increase. This explosive growth (called combinatorial explosion) is exactly why lottery-style odds get so astronomically small with just a modest increase in how many numbers are drawn from — going from a 6-from-49 lottery to a 6-from-59 lottery, for example, meaningfully worsens the odds despite the pool only growing by 10 numbers.
  • These formulas assume every item is distinct and none can be chosen more than once. A scenario allowing repeated selections (like a 4-digit PIN where digits can repeat) uses a different counting formula entirely — always confirm whether repetition is allowed before applying the standard nPr/nCr formulas here.

Common Mistakes

  • Using the permutation count when order genuinely doesn’t matter, or vice versa. This is the single most common error — always ask first whether swapping two selected items would count as a different outcome before picking a formula, rather than guessing based on how the problem is worded.
  • Forgetting that combinations are never larger than permutations for the same n and r. If a combination count comes out bigger than the corresponding permutation count for the same inputs, something was entered wrong — combinations divide the permutation count down, they never inflate it.
  • Applying these formulas to a situation that allows repeated selections. Both formulas assume every item can be picked at most once — a problem that allows repeats (like generating a 4-digit PIN) needs a different counting approach entirely, not nPr or nCr.

Useful to Know

  • Want to actually calculate the odds of a specific outcome, not just count the possibilities? Probability Calculator turns a combination or permutation count into an actual probability.
  • Working with a full data set instead of just counting arrangements? Statistics Calculator computes mean, standard deviation, and other summary figures from a list of numbers.
  • Need to simplify a ratio or find a common denominator as part of a related combinatorics problem? Greatest Common Factor and Least Common Multiple Calculator finds the greatest common factor and least common multiple of a set of numbers.

Source: Wikipedia: Combination (and Permutation).

Frequently Asked Questions

What's the difference between a permutation and a combination?

A permutation counts arrangements where ORDER matters — 1st, 2nd, and 3rd place in a race are different outcomes even with the same three runners. A combination counts selections where order does NOT matter — a 3-person committee is the same group regardless of who was picked first.

Which one should I use for my problem?

Ask whether swapping the order of your selected items would count as a different outcome. If yes (arranging books on a shelf, assigning 1st/2nd/3rd place), use permutations. If no (picking a team, choosing lottery numbers, selecting a committee), use combinations.

Why is there a limit on how large n can be?

Permutations and combinations grow extremely fast — n! for even moderately large n produces numbers far beyond what can be represented exactly in JavaScript's number type. This calculator caps n at 1000 to keep results meaningful rather than silently returning an imprecise or infinite value.

Confirm Your Age

To create an account, please tell us your birth month and year.