Permutation Calculator (nPr)
Calculate permutations using the formula P(n, r) = n! / (n - r)!. Permutations count the number of ways to arrange items where order matters.
Permutations count the number of ways to arrange r items from a group of n, where order matters. The notation P(n,r) or nPr appears in problems involving arrangements, sequences, rankings, and ordered selections. Real-world examples: arranging 5 books on a shelf, choosing first/second/third place finishers in a race, assigning seats at a table, or password possibilities with restrictions.
This calculator returns P(n,r) = n!/(n-r)!. The result can be much larger than the corresponding combination C(n,r) — by a factor of r!. For example, P(10,3) = 720 while C(10,3) = 120, a factor of 6 = 3! difference.
Permutations are essential for: - **Rankings and orderings**: 1st/2nd/3rd place, race positions. - **Combinatorial enumeration**: counting possibilities. - **Cryptography**: password complexity calculations. - **Genetics**: ordered gene sequences. - **Scheduling**: arranging events in order. - **Statistics**: sample sequence enumeration.
Inputs
Results
Permutations (nPr)
720
Formula
P(10, 3) = 10! / 7!
Combinations (nCr)
120
For comparison (order ignored)
Formula
How to use this calculator
- Enter total items (n).
- Enter items being arranged (r).
- Calculator returns P(n, r) = n! / (n-r)!.
- Use when order matters (rankings, sequences).
- Use combinations instead when order doesn't matter.
- Watch out for huge numbers — n! grows extremely fast.
Worked examples
Race results
**Scenario:** 10 runners. How many possible orders of 1st, 2nd, and 3rd place? **Calculation:** P(10, 3) = 10 × 9 × 8 = 720. **Result:** 720 distinct podium orderings. Order matters (1st ≠ 2nd ≠ 3rd). If choosing top 3 without order (just "the 3 winners"), use combinations: C(10, 3) = 120.
PIN security
**Scenario:** 4-digit PIN, digits 0-9 with repetition allowed. How many possible PINs? **Calculation:** 10^4 = 10,000 possible PINs (permutations with repetition). **Result:** 10,000 possible 4-digit PINs. Guessing probability: 1/10,000 = 0.01% per attempt. With 3 attempts allowed: ~0.03% chance.
Word arrangements
**Scenario:** How many ways to arrange letters in "MATH"? **Calculation:** 4 distinct letters: P(4, 4) = 4! = 24 arrangements. **Result:** 24 different arrangements (MATH, MAHT, MTHA, etc.). For words with repeated letters (like "STATS"): use multinomial coefficient. 5!/2! = 60 arrangements of STATS.
When to use this calculator
**Use permutations when:**
- Order matters in selection. - Ranking or arrangement matters. - Sequencing items. - Selecting in specific order (1st, 2nd, 3rd). - Calculating possibilities with order. - Password security.
**Use combinations instead when:**
- Order doesn't matter. - Just selecting a group. - Subset of size r.
**Distinguishing examples:**
| Example | Use | Why | |---|---|---| | 1st, 2nd, 3rd place | Permutation | Order matters | | Top 3 winners | Combination | Just which 3 | | 5-card hand | Combination | Order in hand doesn't matter | | Card sequence dealt | Permutation | Order of dealing matters | | Committee chairman, secretary, treasurer | Permutation | Different roles | | 3-person committee (no roles) | Combination | Anyone can be any | | Coffee ingredients (order) | Permutation | Hot then milk vs milk then hot | | Coffee ingredients (set) | Combination | Same final drink |
**Common permutation calculations:**
| Application | Formula | |---|---| | Distinct items in order | n! | | Subset in order | n!/(n-r)! | | With repetition | n^r | | Circular arrangement | (n-1)! | | Multiset arrangement | n!/(r₁!r₂!...rₖ!) | | Necklace (rotations equivalent) | n!/(2n) for n ≥ 3 |
**Permutation probability:**
For random arrangement, P(specific permutation) = 1 / P(n, r).
For partial information (some constraints): - Calculate constrained possibilities. - Use conditional probability.
**Common applications:**
- **Olympic events**: medal positions. - **Business**: organizational rankings. - **Sports**: bracket arrangements. - **Sequencing**: gene order, story order. - **Logistics**: route arrangements (Traveling Salesman). - **Scheduling**: task ordering. - **Music**: note sequences. - **Cryptography**: cipher permutations.
**Permutation generation:**
For small n, can enumerate all explicitly. For larger n: programmatic generation needed. For very large n: only count, can't enumerate.
**Memorization tip:**
- P → Position/Place/Procedure (order) - C → Choose/Collect/Cluster (no order)
**Practical examples:**
1. **Race**: 12 runners, top 3 medals. P(12, 3) = 1320 different podium configurations.
2. **Phone number**: 7-digit number. Each digit 0-9. With first digit not 0 or 1: 8 × 10^6 = 80M.
3. **License plate** (state varies): 3 letters + 3 digits. 26^3 × 10^3 = 17.6M plates.
4. **Lock combination**: 4-digit code, digits 0-9 with repetition: 10,000.
5. **Class roster**: ordering 30 students for graduation: 30! ≈ 2.6 × 10^32.
**Stirling approximation for n!:**
For large n: n! ≈ √(2πn) × (n/e)^n.
Useful for very large calculations.
**Algorithmic complexity:**
Permutation problems often have factorial complexity (NP-hard for many). - Generating all permutations: O(n!). - Finding optimal: often exponential or factorial. - Special cases may have polynomial solutions.
**Real-world limits:**
- 52-card shuffle: ~10^67 possible orderings (more than atoms in observable universe). - This is why card shuffling is "essentially random" — almost no two shuffles are identical.
**Identities:**
- P(n, r) = n! / (n-r)! - P(n, n) = n! - P(n, 1) = n - P(n, 0) = 1 - P(n, r) = C(n, r) × r!
**Common errors:**
- Confusing P(n, r) with C(n, r). Permutations include order. - Using simple factorials when subset arrangements needed. - Forgetting repetition rules. - Computing very large factorials without consideration.
Common mistakes to avoid
- Confusing permutations with combinations. P respects order; C ignores.
- Trying to compute P(n, r) where r > n. Mathematically zero.
- Using simple factorial when permutation needed. P(n,r) = n!/(n-r)!, not n!.
- Forgetting repetition rules. With/without repetition gives different counts.
- Treating P(n, 0) and P(n, n) consistently. P(n, 0) = 1; P(n, n) = n!.
- Computing very large factorials directly. Use logarithms or approximations.
- Confusing arrangements (ordered) with combinations (unordered).