Permutation and Combination Calculator: nPr and nCr
Short answer
This calculator determines the total possible ways to select a subset of items from a larger set, both when arrangement order matters (permutations) and when it does not (combinations). For instance, selecting 3 items from a group of 10 yields 120 unique combinations, 720 ordered permutations, and 1,000 possibilities if repetition is permitted.
Formula
nPr = n! / (n - r)! | nCr = n! / [r! * (n - r)!] | Repetition = n^r
n represents the total number of items in the set; r represents the number of items being selected or chosen; ! denotes the factorial operation (the product of all positive integers less than or equal to that number, with 0! defined as 1); nPr represents the number of permutations where order matters; nCr represents the number of combinations where order does not matter; n^r represents the total possibilities when items can be selected repeatedly in an ordered sequence.
Worked example
- Total items (n)
- 10
- Chosen (r)
- 3
- Combinations (nCr): 120
- Permutations (nPr): 720
- With repetition (nʳ): 1,000
What Permutations and Combinations Calculate
Combinatorics is the branch of mathematics dealing with counting, arrangement, and grouping. When analyzing a set of distinct items, two fundamental questions arise: how many items are available in total ($n$), and how many are being selected ($r$)?
The Permutation and Combination Calculator computes three primary values:
- Combinations ($nCr$): The number of ways to pick $r$ items from $n$ distinct items when the order of selection does not matter.
- Permutations ($nPr$): The number of ways to pick and arrange $r$ items from $n$ distinct items when the order of selection is strictly important.
- With Repetition ($n^r$): The total number of ordered arrangements possible if items can be chosen multiple times (sampling with replacement).
These principles form the foundation of discrete mathematics, probability theory, computer science data structures, cryptography, statistical mechanics, and experimental design.
Step-by-Step Worked Example
To understand how these formulas operate, consider an example with a total pool of $n = 10$ items, from which $r = 3$ items are selected.
1. Combinations ($nCr$)
Combinations determine how many unique subsets of size 3 can be formed from 10 items, regardless of sequence: $$ \text{Formula: } nCr = \frac{n!}{r!(n - r)!} $$ Substitute the values: $$ {}{10}C_3 = \frac{10!}{3!(10 - 3)!} = \frac{10!}{3! \times 7!} $$ Expand the factorials and cancel out the common $7!$ terms: $$ {}{10}C_3 = \frac{10 \times 9 \times 8 \times 7!}{3 \times 2 \times 1 \times 7!} = \frac{10 \times 9 \times 8}{3 \times 2 \times 1} = \frac{720}{6} = 120 $$ There are 120 distinct combinations.
2. Permutations ($nPr$)
Permutations determine how many ordered arrangements of 3 items can be made from 10 unique items: $$ \text{Formula: } nPr = \frac{n!}{(n - r)!} $$ Substitute the values: $$ {}_{10}P_3 = \frac{10!}{(10 - 3)!} = \frac{10!}{7!} = \frac{10 \times 9 \times 8 \times 7!}{7!} = 10 \times 9 \times 8 = 720 $$ There are 720 distinct permutations. Notice that $720 = 120 \times 3!$.
3. Ordered Selection with Repetition ($n^r$)
If an item can be reused after being selected (such as choosing a 3-digit PIN using digits 0–9): $$ \text{Formula: } n^r = 10^3 = 10 \times 10 \times 10 = 1,000 $$ There are 1,000 total possibilities when repetition is permitted.
Input Sensitivity Comparison
Changing the total set size ($n$) while holding the selected subset ($r = 3$) constant highlights how combinatorial spaces expand:
- Lower Input ($n = 8, r = 3$): $${}_8C_3 = \frac{8 \times 7 \times 6}{3 \times 2 \times 1} = 56$$
- Base Example ($n = 10, r = 3$): $${}_{10}C_3 = \frac{10 \times 9 \times 8}{3 \times 2 \times 1} = 120$$
- Higher Input ($n = 12, r = 3$): $${}_{12}C_3 = \frac{12 \times 11 \times 10}{3 \times 2 \times 1} = 220$$
As $n$ grows, possible combinations increase rapidly, demonstrating non-linear factorial growth.
How to Read and Interpret Results
- Order Irrelevant vs. Order Critical: If creating a committee of 3 people from 10 candidates, use $nCr$ (120) because a committee has no sequential hierarchy. If assigning specific roles (President, Vice President, Treasurer) to those 3 people, use $nPr$ (720) because job titles introduce order.
- Symmetry Property of Combinations: Combinations exhibit symmetry where $nCr = nC(n - r)$. Choosing 3 items out of 10 (${}{10}C_3 = 120$) produces the exact same number of outcomes as leaving 7 items behind (${}{10}C_7 = 120$).
- Extremes: Selecting 0 items ($nC0$) or all items ($nCn$) always equals 1. Selecting 1 item ($nC1$) always equals $n$.
Practical Tips for Counting Problems
- Identify the Physical Process: Ask whether swapping two elements creates a new outcome. If yes, compute permutations; if no, compute combinations.
- Break Down Multi-Stage Selections: When selecting from multiple distinct pools (e.g., choosing 2 men from 5 and 3 women from 6), calculate the combinations of each pool separately and multiply the totals: ${}_5C_2 \times {}_6C_3$.
- Cancel Early When Working by Hand: Avoid multiplying full factorials directly. Always cancel the largest common factorial between the numerator and denominator before multiplying the remaining terms.
When Not to Rely on Basic Permutation and Combination Formulas
Standard $nPr$ and $nCr$ models assume two strict conditions: all $n$ items are distinct, and selections are made without replacement. Do not use these baseline formulas if:
- Duplicates Exist in the Set: If rearranging letters in words with repeated characters (like "LEVEL"), standard $n!$ overcounts identical arrangements. You must divide by duplicate factorials ($5! / (2! \times 2!)$).
- Unordered Grouping with Replacement: If selecting an unordered collection where items can be picked multiple times (such as selecting 5 scoops of ice cream from 3 available flavors), use multiset combinations: $\binom{n + r - 1}{r}$.
- Circular Arrangements: Items arranged in a circle eliminate fixed endpoints, changing total permutations to $(n - 1)!$.
Comparison
| Scenario | Input | Result |
|---|---|---|
| Lower input | Total items (n): 8 | Combinations (nCr): 56 |
| Base example | Total items (n): 10 | Combinations (nCr): 120 |
| Higher input | Total items (n): 12 | Combinations (nCr): 220 |
Common mistakes
- Confusing permutations with combinations by treating ordered sequences as unordered groups.
- Setting r greater than n when sampling without replacement, which is mathematically impossible in standard counting.
- Assuming 0! equals 0 rather than 1, leading to false division-by-zero errors in formulas.
- Using standard nPr or nCr formulas when items can be picked multiple times instead of applying exponential or multiset rules.
- Ignoring indistinguishable items, which overcounts unique outcomes (e.g., anagrams with duplicate letters).
Checklist
- Verify that the total items (n) is a non-negative integer.
- Ensure the chosen items (r) is a non-negative integer less than or equal to n for standard nPr and nCr.
- Determine whether the sequence or arrangement order matters for your scenario.
- Check whether items can be selected multiple times (sampling with replacement versus without replacement).
- Identify identical or indistinguishable items within the total set before running standard formulas.
- Use factorial expansion cancellations to simplify large manual calculations.
Calculators Percentage Editorial Team
Calculator guides from the Calculators Percentage team. These introductory examples are educational, not professional advice.
Last reviewed:
This tool provides mathematical calculations based on classical discrete probability formulas. It assumes all items in the total set are distinct and that inputs are whole non-negative integers.
