Permutations & Combinations
Permutations count arrangements where order matters; combinations count selections where it does not. This calculator finds nPr = n!/(n−r)!, nCr = n!/(r!(n−r)!) and the factorial n!, showing each step.
One quantity, divided or not
Counting selections sounds elementary until the question of order arrives. Picking three people from ten for a committee and picking three for first, second and third place look like the same question, and they are not: the second has six times as many answers, because each committee can be ordered six different ways.
That factor of six is the whole distinction. This calculator reports both counts and the factorial they are built from, so the relationship between them is visible rather than asserted.
Permutations and combinations are not independent formulas to memorise. The permutation count comes first, and dividing it by the number of ways to arrange the chosen items gives the combination count. Everything else follows from noticing which of the two the question is asking for.
Reporting them together makes that division concrete. When the two agree the selection is trivial; when they differ by a large factor, the arrangement count is doing most of the work, and seeing that is more useful than either figure alone.
How to use this calculator
- Enter the total number of items A whole number of zero or more. It is the size of the pool being drawn from, with every item treated as distinct.
- Enter how many are chosen Also a whole number, and never larger than the total. Choosing more items than exist is rejected with an explicit message rather than returning zero.
- Read all three results The ordered count, the unordered count, and the factorial of the total. The middle one is the first divided by the arrangements of the chosen items.
The formula, and where it comes from
nPr = n! / (n − r)! nCr = n! / (r!·(n − r)!) = nPr / r! n! = n·(n−1)···1
The permutation count is best understood as a running product rather than a ratio of factorials. Filling the first position offers n choices, the second n − 1, and so on for r positions — and the implementation computes it exactly that way, multiplying r terms rather than dividing two enormous factorials.
That matters numerically. Ten items taken three at a time is a product of three numbers, whereas the factorial form would compute a ten-digit number and divide it by a seven-digit one to reach the same answer. The running product stays accurate for far larger inputs.
The combination count divides the permutation count by the number of orderings of the chosen items. Each unordered selection appears exactly that many times among the ordered ones, so the division removes the duplication precisely.
The factorial of the total is reported separately, and it grows explosively — twenty items already exceed two quintillion arrangements. That growth is why the ratio forms matter and why factorials are almost never evaluated in full when the answer is a ratio.
What each input means
- n Total items — form field “Total items n”
- The size of the pool, a whole number of zero or more. Every item is treated as distinguishable from every other.
- r Chosen items — form field “Chosen items r”
- How many are selected. A whole number between zero and the total; anything larger is refused.
- nPr, nCr Ordered and unordered counts
- Arrangements and selections respectively. The first is always at least as large as the second, and larger whenever more than one item is chosen.
Worked examples
Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.
Choosing three from ten
Ten items with three selected. The classic committee-versus-podium comparison, where the two counts differ by a factor of six.
Inputs Total items n = 10, Chosen items r = 3
- Given n = 10, r = 3
- Permutations nPr = n! / (n − r)! = 10! / 7! = 720
- Combinations nCr = n! / (r!·(n − r)!) = nPr / r! = 720 / 6 = 120
- Factorial n! = 3628800
Result nPr = 720, nCr = 120
The ordered count is the product of ten, nine and eight. The unordered count divides that by the six ways three chosen items can be arranged among themselves, which is exactly the redundancy that ordering introduces.
The factorial of ten is over three million, vastly larger than either answer. Neither result requires computing it, which is why the running product is the sensible implementation.
Ordering five from eight
Eight items with five selected in order. A larger fraction of the pool is taken, so the divisor grows sharply.
Inputs Total items n = 8, Chosen items r = 5
- Given n = 8, r = 5
- Permutations nPr = n! / (n − r)! = 8! / 3! = 6720
- Combinations nCr = n! / (r!·(n − r)!) = nPr / r! = 6720 / 120 = 56
- Factorial n! = 40320
Result nPr = 6720, nCr = 56
The ordered count is a product of five descending terms. Dividing by the 120 arrangements of five chosen items leaves a combination count under sixty — the two figures now differ by more than two orders of magnitude.
The gap widens as more items are chosen, because the number of arrangements grows factorially in the count selected. For small selections the two figures are close; for large ones they are not comparable.
Reading the result
Deciding which count the question wants
Ask whether swapping two chosen items produces a different outcome. Podium places, passwords and seatings say yes and need the ordered count; committees, hands of cards and subsets say no and need the unordered one.
The two extremes
Choosing none or choosing all gives exactly one combination, since there is only one empty selection and only one full one. The ordered count at the full size is the factorial itself, which is the number of ways to arrange everything.
Symmetry of the unordered count
Choosing r items from n is the same as choosing which n − r to leave behind, so the combination count is unchanged by replacing one with the other. That symmetry is a useful check and often the faster way to compute by hand.
When you would use this
Counting outcomes for a probability
Many probability questions reduce to a count of favourable selections over a count of all selections. Both are combination counts when order is irrelevant, and the ratio is the answer.
Sizing an arrangement problem
Seatings, orderings, schedules and passwords are all permutation counts. The figure grows quickly enough that it is often the answer to whether an exhaustive search is feasible at all.
Assumptions and limitations
What this calculator assumes
- All items are distinguishable; repeated identical items would need a different count.
- Selection is without replacement — each item is chosen at most once.
- Both inputs are whole numbers, and the count chosen does not exceed the total.
- The ordered count is computed as a running product rather than as a ratio of factorials.
Where it stops being the right tool
- No selection with replacement, and no multiset permutations where some items repeat.
- Circular arrangements, which have their own count, are not covered.
- Very large totals lose precision once the factorial exceeds what floating point represents exactly.
- One pair of values at a time: a table across several selection sizes has to be built by repeated runs.
Common mistakes
Using the ordered count for an unordered question
Why it happens. The permutation formula is often taught first and looks like the general case, so it gets applied by default. It overcounts by exactly the number of arrangements of the chosen items.
How to avoid it. Test whether reordering the selection changes the answer. If it does not, divide by the arrangements — or read the second line instead of the first.
Computing factorials in full
Why it happens. The formula is written with three factorials, so evaluating each looks like the way to proceed. For anything beyond small numbers they overflow long before the ratio does.
How to avoid it. Cancel first. The ratio of two factorials is a short running product, which is both faster and far more accurate.
Choosing more items than exist
Why it happens. The formula appears to accept it, and a negative factorial in the denominator is not obviously impossible until you try to evaluate it.
How to avoid it. Keep the chosen count within the total. Without replacement there is no way to select more items than the pool contains.
Key terms
Frequently asked questions
What is the difference between a permutation and a combination?
A permutation counts ordered arrangements, so ABC and CBA are two different outcomes. A combination ignores order, counting them as one. The permutation count is always the larger, by exactly the number of ways the chosen items can be arranged.
What does nCr mean?
The number of ways to choose r items from n when order does not matter, equal to n! / (r!·(n − r)!). It is the permutation count divided by r!, which removes the duplicate orderings of each selection.
Can r be larger than n?
No. Selection here is without replacement, so more items cannot be chosen than the pool contains. The calculator rejects that input rather than returning zero.
Why is choosing 3 from 10 the same as choosing 7?
Because deciding which three to take is the same decision as deciding which seven to leave. That symmetry holds for every pair summing to the total, and it is often the quicker calculation.