Permutation Calculator
nPr · With Repetition · Multinomial
Compute ordered arrangements with three modes: P(n,r) = n!/(n−r)!, permutations with repetition nʳ, and multinomial permutations for multisets. BigInt support for large numbers.
Quick Examples
Formula & Step-by-Step
Comparison Table
| Formula | Name | Value | Relationship |
|---|
Quick Examples
Formula & Step-by-Step
Comparison Table
| Formula | Name | Value |
|---|
Quick Examples
Formula & Step-by-Step
What Is a Permutation?
A permutation is an ordered arrangement of items. The defining characteristic is that order matters — placing the same items in a different sequence creates a completely different permutation. For instance, choosing three runners for 1st, 2nd, and 3rd place from a group of 10 is a permutation problem because the ranking distinguishes each outcome.
Permutations are foundational in combinatorics, probability theory, cryptography, and computer science. Whether you are counting possible passwords, scheduling tasks, or determining the number of race outcomes, permutation formulas give precise counts without manual enumeration.
Permutation vs. Combination
The key distinction between permutations and combinations is whether order matters. A combination selects a subset of items where arrangement is irrelevant (choosing a lottery ticket). A permutation selects and arranges — every different ordering is a distinct outcome.
| Concept | Order Matters? | Formula | Example (10 items, 3 chosen) |
|---|---|---|---|
| Permutation nPr | Yes | n! / (n−r)! | P(10,3) = 720 |
| Combination nCr | No | n! / (r!(n−r)!) | C(10,3) = 120 |
| With Repetition | Yes | nʳ | 10³ = 1,000 |
The ratio P(n,r) / C(n,r) = r! tells you how many ways to order each combination. Here, 720 / 120 = 6 = 3!, confirming that each group of 3 can be arranged in 6 different orders.
Formula 1: nPr — Permutations Without Repetition
When selecting r items from n distinct items without replacement, each item can only appear once in an arrangement. The formula is:
P(n, r) = n! / (n − r)! = n × (n−1) × (n−2) × ... × (n−r+1)
The numerator n! counts all full arrangements of n items. Dividing by (n−r)! cancels out the items we do not select, leaving only the falling factorial product. For P(10, 3): 10 × 9 × 8 = 720.
Real-World nPr Examples
- Race podium: 10 runners competing for gold, silver, bronze → P(10,3) = 720
- License plates: 4 different letters from 26, order matters → P(26,4) = 358,800
- Committee officer positions: Choosing president, VP, treasurer from 8 → P(8,3) = 336
- Ordered poker hands: 5 cards dealt in order from 52 → P(52,5) = 311,875,200
Formula 2: nʳ — Permutations With Repetition
When items can be reused across positions, each of the r positions independently has n choices. The total count is the product of n multiplied r times:
Permutations with repetition = nʳ
This applies whenever selections are made with replacement — like a combination lock, a PIN pad, or a password that allows repeated characters. Since the restriction n ≥ r is removed, nʳ is always at least as large as P(n,r) for r ≥ 2.
Real-World nʳ Examples
- 4-digit PIN: Each digit 0–9 → 10⁴ = 10,000 PINs
- 8-character password (62 chars): Letters + digits → 62⁸ ≈ 218 trillion combinations
- Binary strings of length 10: 2¹⁰ = 1,024 strings
- DNA codons: 4 nucleotides, 3 positions → 4³ = 64 codons
Formula 3: Multinomial Permutations (Multiset Arrangements)
When a collection contains groups of identical items, swapping identical items within a group produces the same arrangement — so we must divide by the factorial of each group's size. For n total items with group sizes n₁, n₂, ..., nₖ where n₁ + n₂ + ... + nₖ = n:
Multinomial = n! / (n₁! × n₂! × ... × nₖ!)
The classic example is MISSISSIPPI: 11 letters with 1 M, 4 I's, 4 S's, 2 P's. Result: 11! / (1! × 4! × 4! × 2!) = 34,650. Without accounting for repetition, 11! = 39,916,800 would massively overcount identical arrangements.
Circular Permutations
In a circular permutation, items are arranged around a circle where rotations of the same arrangement are considered identical. One item is fixed as a reference point, and the remaining (n−1) items fill the other positions. The count is (n−1)!.
For example, 6 people at a round table: (6−1)! = 120 distinct seatings, versus 6! = 720 for a linear arrangement. Circular permutations arise in scheduling rotations, necklace designs, and round-robin tournaments.
Factorial Relationship
All permutation formulas hinge on factorials. The factorial n! represents the total number of ways to arrange all n distinct items in a line. Partial permutations P(n,r) use the ratio of two factorials; multinomials divide n! by a product of factorials. Knowing how to compute and manipulate factorials — especially for large n using BigInt arithmetic — is essential for accurate permutation calculations.
Applications Across Fields
- Cybersecurity: Password strength depends on nʳ — more characters and positions exponentially increase the search space for attackers.
- Genetics: Counting DNA sequence arrangements uses multinomial permutations over the four nucleotides A, T, C, G.
- Operations Research: Scheduling n jobs on r machines, or determining optimal task sequences, relies on nPr calculations.
- Statistics: Permutation tests are non-parametric hypothesis tests that enumerate all possible rearrangements of observed data.
- Game Theory: Card games, tournament rankings, and board game strategies all require permutation counts to assess probabilities.