CalcMountain

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)

Last updated:

Formula

**Permutation formula (nPr):** P(n, r) = n! / (n-r)! Where: - **n!**: n factorial = n × (n-1) × ... × 2 × 1 - **r**: items arranged - **n-r**: items left **Worked example: P(10, 3)** P(10, 3) = 10! / 7! = (10 × 9 × 8 × 7!) / 7! = 10 × 9 × 8 = 720 There are 720 ways to arrange 3 items from 10 in order. **Properties:** - **P(n, 0) = 1**: only one way to arrange nothing. - **P(n, n) = n!**: all arrangements (permutations of the entire set). - **P(n, 1) = n**: n ways to choose 1 in order (= unordered). **Permutations vs combinations:** - **Permutations** consider order: ABC ≠ ACB. - **Combinations** ignore order: ABC = ACB. - **Relationship**: P(n, r) = C(n, r) × r! **Common permutations:** | Problem | Calculation | Result | |---|---|---| | 4-letter words from 26 letters | P(26, 4) | 358,800 | | Arrange 5 books | 5! | 120 | | Race results (top 3) | P(10, 3) | 720 | | License plate (3 letters + 4 digits) | 26³ × 10⁴ | 175,760,000 | | 4-digit PIN (1-9 each, no repeat) | P(10, 4) | 5,040 | | Arrange book stack (52 books) | 52! | ~8.07 × 10⁶⁷ | | Card shuffle | 52! | 80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000 | **Permutation types:** **Distinct items, no repetition:** P(n, r) = n! / (n-r)! Standard formula. **Distinct items, with repetition:** P(n, r) with repetition = n^r Choose r items from n with replacement. Example: 4-digit PIN (10 digits with repetition) = 10^4 = 10,000. **Items with identical groups:** Multinomial = n! / (r₁! × r₂! × ... × rₖ!) For sequences with repeated values. Example: arrangements of "AABBC": 5! / (2! × 2! × 1!) = 30. **Worked example: arranging letters of "STATISTICS"** Letters: S(3), T(3), I(2), A(1), C(1) = 10 total. Arrangements = 10! / (3! × 3! × 2! × 1! × 1!) = 50,400. **Common applications:** - **Race results**: ranking finishers. - **Election**: rank choice voting. - **Code locks**: order matters. - **Combination locks** (despite name, actually permutations): order matters. - **License plates**: letter and number sequences. - **Password security**: letter sequences. - **Genetic sequences**: DNA, RNA, protein. - **Sports brackets**: order of advancement. **Permutation count examples:** | n | P(n, n) = n! | |---|---| | 5 | 120 | | 8 | 40,320 | | 10 | 3,628,800 | | 15 | 1.3 × 10¹² | | 20 | 2.4 × 10¹⁸ | | 25 | 1.6 × 10²⁵ | | 50 | 3.0 × 10⁶⁴ | | 100 | 9.3 × 10¹⁵⁷ | Numbers grow extremely fast. **Stirling approximation (for large n):** n! ≈ √(2πn) × (n/e)^n Useful for very large permutation calculations. **Permutation count in probability:** For random arrangement: P(specific arrangement) = 1 / P(n, r) Example: probability of guessing specific 4-digit PIN without repetition: 1/5,040 = 0.0002. **Circular permutations:** For arrangements around a circle: (n-1)! Example: 5 people around a round table: 4! = 24 arrangements (vs 5! = 120 if linear). **Permutations with restrictions:** When some items must be together: treat together as one item. When some items must be separate: arrange others first. **Programming permutations:** - Python: itertools.permutations(iterable, r) generates all. - R: combn() can do permutations. - Excel: PERMUT(n, r) for count; no built-in arrangement generator. - Recursive algorithms generate all explicitly. **Cryptography:** Password complexity = number of possible permutations. Example: 8-character password with case + digits + symbols (~80 unique characters): 80^8 = 1.68 × 10¹⁵ possibilities. **Real-world arrangements:** | Arrangement | Calculation | |---|---| | 8 chess pieces | 8! = 40,320 | | Race finish order (10 runners) | 10! = 3,628,800 | | 5-card stud poker hand order | P(52, 5) = 311,875,200 | | 7 cars in parking lot | 7! = 5,040 | | 26-letter alphabet | 26! = 4 × 10²⁶ | | Deck shuffle | 52! = 8 × 10⁶⁷ |

How to use this calculator

  1. Enter total items (n).
  2. Enter items being arranged (r).
  3. Calculator returns P(n, r) = n! / (n-r)!.
  4. Use when order matters (rankings, sequences).
  5. Use combinations instead when order doesn't matter.
  6. 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).

Frequently Asked Questions

Sources & further reading

SponsoredShop Top Deals on AmazonSupport CalcMountain — browse top-rated products at no extra cost to you.

Related Calculators