What Is a Permutation (nPr)? Definition & Exact Formula
In combinatorics, a permutation counts the total number of distinct ordered arrangements you can form by selecting r items from a pool of n distinct items. Unlike combinations, order strictly matters in every permutation: picking (Alice, Bob, Carol) for Gold, Silver, and Bronze medals is completely different from picking (Carol, Bob, Alice), even though the exact same three athletes stand on the podium.
With Repetition Allowed: P_rep(n, r) = n^r
Multiset (With Identical Copies): P = n! ÷ (k₁! × k₂! × ... × kₘ!)
Circular Ring (Rotation Equivalent): P_circ(n, r) = P(n, r) ÷ r [Full circle r = n gives (n − 1)!]
Because our Permutation Calculator evaluates factorials and falling products using arbitrary-precision BigInt integer arithmetic directly in your browser, you can compute exact integer counts like P(20, 20) = 2,432,902,008,176,640,000 or inspect scientific-notation counts for massive spaces like a full 52-card deck shuffle (52! ≈ 8.0658 × 10^67, 68 digits) without standard 64-bit IEEE floating-point rounding drift.
Permutations vs. Combinations: Understanding the r! Order Factor
Every student eventually wonders whether a problem calls for nPr (permutations) or nCr (combinations). Both start from the same n pool and pick r items without repeating any object, yet permutations always outnumber combinations by exactly r! (read "r factorial"):
To see why, split ordered selection into two simple stages. First, choose which r objects belong to your team in C(n, r) unordered ways. Next, scramble those chosen r objects across r distinct roles, seats, or ranks in r! ways. Multiplying both stages yields P(n, r)! That exact bridge immediately gives intuitive boundary values: when r = 0, there is 1 unique empty ordering (P(n, 0) = 1); when r = 1, P(n, 1) = n; and when r = n, arranging all n items simplifies cleanly to n! ÷ 0! = n! because 0! = 1 by multiplicative identity.
| Formula Variant | Order Matters? | Repeats Allowed? | Expression | Quick Test (n=4, r=2) |
|---|---|---|---|---|
| Standard Permutation | Yes | No | n! ÷ (n − r)! | 4 × 3 = 12 |
| Permutation w/ Repetition | Yes | Yes | n^r | 4² = 16 |
| Multiset Word / Duplicates | Yes | Fixed counts | n! ÷ Π(kᵢ!) | AABB: 4! ÷ (2!2!) = 6 |
| Circular Ring (Fixed Clockwise) | Relative Ring | No | P(n, r) ÷ r | P(4,2)÷2 = 6; Full (4−1)! = 6 |
| Standard Combination | No | No | n! ÷ [r!(n − r)!] | 12 ÷ 2! = 6 |
Permutations With Repetition (n^r) & Password / PIN Entropy
When selecting items with replacement, every position in your sequence retains access to the full pool of n symbols independently. Mode 2 (With Repetition n^r) computes the exponential power n^r, compares it directly against no-repeat P(n, r), and reports cryptographic Shannon / Hartley entropy in bits (r × log₂(n)).
For example, a standard 4-digit bank PIN drawn from digits 0–9 (n = 10, r = 4) permits digits to repeat (such as 1122), producing 10⁴ = 10,000 possible codes (13.29 bits). Prohibiting digit reuse reduces the search space nearly in half to P(10, 4) = 10 × 9 × 8 × 7 = 5,040 codes. Similarly, an 8-character lowercase password (n = 26, r = 8) spans 26⁸ = 208,827,064,576 possibilities (37.60 bits).
Multiset Permutations: Word Anagrams & Identical Objects
How many distinct ways can you scramble the letters of MISSISSIPPI, STATISTICS, or arrange 5 identical green steps and 3 identical right steps on a city street grid? If all n symbols carried distinct subscript labels (say I₁, I₂, I₃, I₄), there would be n! total lineups. However, because swapping identical copies among themselves produces the exact same visible string, every distinct arrangement gets counted k₁! × k₂! × ... × kₘ! times inside n!!
Mode 3 accepts either raw text words (automatically stripping whitespace, uppercasing characters, and tallying character frequencies) or comma-separated duplicate counts (such as 5, 3 for Manhattan lattice paths). Dividing n! by the product of subgroup factorials cancels all indistinguishable duplicate swaps cleanly.
Circular Permutations & Reversible Necklace Symmetry
Arranging people around a round banquet table differs fundamentally from lining them up against a wall because a circle has no starting edge or ending edge. Rotating every guest one chair clockwise changes zero neighbor relationships! Across a ring of n seats, every single circular configuration corresponds to exactly n distinct linear lineups. Dividing linear n! by n rotational equivalents produces the classic circular permutation identity:
Partial Ring (r out of n items in circle): P(n, r) ÷ r
Reversible Necklace / Keyring (r >= 3): P(n, r) ÷ (2 × r) [or (n − 1)! ÷ 2 for full ring]
An easy physical trick guarantees why (n − 1)! works: pin one guest permanently at the top seat as an anchor to break rotational symmetry, then arrange the remaining n − 1 guests into the n − 1 remaining seats in (n − 1)! linear ways! Furthermore, if your physical ring can be picked up and flipped upside down (like a beaded bracelet, keychain, or molecular ring), clockwise and counterclockwise orderings become mirror equivalents, cutting unique physical rings in half once more to (n − 1)! ÷ 2 for n >= 3.
2 Worked Examples
Example 1: Race Podium P(10, 3) vs. 4-Digit Security PIN (Repetition)
Part A (No-Repetition Olympic Final): Ten sprinters compete in a 100-meter final (n = 10), and medals are awarded for 1st, 2nd, and 3rd place (r = 3). How many ordered podium outcomes exist?
- Select Gold (1st): All
10runners are eligible. - Select Silver (2nd): With Gold awarded,
9runners remain. - Select Bronze (3rd): Exactly
8runners remain. - Apply
P(10, 3):10! ÷ (10 − 3)! = 10! ÷ 7! = 10 × 9 × 8 = 720ordered podiums! Dividing by3! = 6gives120unordered top-3 finalist groups (C(10, 3)).
Part B (Repetition PIN Mode 2): How many 4-digit ATM PINs can be constructed from digits 0–9 if repeats are allowed versus forbidden? Allowing repeats yields 10⁴ = 10,000 codes (13.29 bits of entropy), whereas forbidding repeated digits trims the count to P(10, 4) = 10 × 9 × 8 × 7 = 5,040 codes.
Example 2: Word Anagrams of MISSISSIPPI & Round-Table Dinner Seating
Part A (Multiset Mode 3): How many visually distinct 11-letter strings can be formed by rearranging the letters of MISSISSIPPI?
- Count letter frequencies:
M = 1,I = 4,S = 4, andP = 2, summing ton = 1 + 4 + 4 + 2 = 11. - Compute total numerator:
11! = 39,916,800arrangements if every letter were uniquely colored. - Divide by duplicate factorials:
1! × 4! × 4! × 2! = 1 × 24 × 24 × 2 = 1,152. - Final multiset count:
39,916,800 ÷ 1,152 = 34,650unique anagrams!
Part B (Circular Mode 4): Eight diplomats sit around a circular conference table (n = 8, r = 8). Fixing Diplomat #1 as reference eliminates 8 equivalent table rotations, yielding (8 − 1)! = 7! = 5,040 relative seating orders (down from 8! = 40,320 linear row seats). If those same 8 gems were strung onto a flippable bracelet, mirror reflection halves that count again to 5,040 ÷ 2 = 2,520.
Permutation Formulas in Excel, Google Sheets & Python
Compute standard permutations, repetition powers, and exact arbitrary-precision integers directly in spreadsheets or Python:
Excel / Sheets With Repetition: =PERMUTATIONA(n, r) [equivalent to =POWER(n, r)]
Excel Multiset Multinomial Ratio: =MULTINOMIAL(k1, k2, ...)
Python 3.8+ Standard nPr (Exact): math.perm(n, r)
Python Circular / Multiset (Exact): math.factorial(n) // math.prod(math.factorial(k) for k in counts)
5 Common Permutation Mistakes to Avoid
- Using Combinations
C(n, r)When Order Changes Meaning: Passwords, race placements, batting lineups, and sequential task queues all care which item goes first; always usenPrinstead ofnCr. - Evaluating
n! ÷ (n − r)!Numerically Without Canceling: Computing1000!then dividing overflows standard 64-bit floats (Infinity); always expand only therfalling factorsn × (n − 1) × ... × (n − r + 1)or use BigInt arithmetic. - Forgetting
0! = 1: WritingP(5, 5) = 5! ÷ 0!never divides by zero; empty product symmetry guarantees0! = 1, yieldingP(5, 5) = 120. - Treating Repeated Letters as Unique Symbols: Counting anagrams of words like
BOOKorSTATISTICSwith rawn!severely overcounts; always divide by the factorial of every duplicate count. - Applying Linear
n!to Round Tables or Bracelets: Round-table problems depend strictly on relative clockwise neighbors ((n − 1)!), and flippable keyrings divide by an extra factor of2.
Related Probability & Statistical Solvers
Pair exact permutation counts with probability models and sampling calculations across our Math & Statistics hub:
- Probability Calculator: divide favorable permutation counts by total sample-space counts or run exact Binomial & Bayes rules.
- Sample Size Calculator: calculate survey respondent targets
nwith Finite Population Correction. - Z-Score Calculator & Confidence Interval Calculator: connect counting trials to large-sample normal approximations.
- Mean Calculator & Standard Deviation Calculator: summarize empirical outcomes alongside theoretical discrete counts.
Read more about our BigInt exact-precision checks and test coverage in our Editorial & Mathematical Accuracy Policy.
Frequently Asked Questions
What is the formula for permutations P(n, r)?
Without repetition, P(n, r) = n! / (n - r)!. This simplifies to multiplying r descending factors starting from n: n * (n - 1) * ... * (n - r + 1).
What is the difference between permutations (nPr) and combinations (nCr)?
Permutations count ordered arrangements (AB differs from BA), while combinations count unordered subsets (AB and BA are the same group). Therefore P(n, r) = C(n, r) * r!.
How do you calculate permutations when items can repeat?
When repetition is allowed across r positions from n choices (like a 4-digit PIN from 0-9), multiply n by itself r times: n^r. For 10 digits and 4 positions, 10^4 = 10,000.
How do you find permutations of a word with repeated letters like MISSISSIPPI?
Use the multiset permutation formula n! / (k1! * k2! * ... * km!), dividing total factorial n! by the factorial of each repeated symbol count. For MISSISSIPPI (11 letters, M=1, I=4, S=4, P=2), 11! / (1! * 4! * 4! * 2!) = 34,650.
Why is the circular permutation formula (n - 1)! instead of n!?
Because rotating a circle preserves every neighbor relationship, each circular arrangement matches n identical linear rotations. Dividing n! by n rotations leaves (n - 1)!, which is equivalent to pinning 1 anchor seat and arranging the remaining n - 1 items.
When should circular arrangements be divided by 2?
Divide circular permutations by 2 to get (n - 1)! / 2 whenever a ring can be flipped upside down (a free necklace, bracelet, or keyring) and clockwise/counterclockwise mirror reflections count as identical (for n >= 3).
Mathematical References & Standards
- Wikipedia: Permutation: k-Permutations, Cycle Notation & Multiset Counting (Standard mathematical definitions of falling factorials P(n, r), n^r, and circular symmetries)
- Wikipedia: Combination: Relationship P(n, r) = C(n, r) x r! (Derivation connecting ordered arrangements to binomial subsets)
- Wikipedia: Multiset Permutations: Word & Multinomial Coefficients (Proof of n! / (k1! k2! ... km!) division removing duplicate swap symmetries)
- Wikipedia: Combinatorics: Multiplicative Principle & Counting Rules (Survey of enumerative counting frameworks and discrete factorial growth)
- Wikipedia: The Twelvefold Way: Distinct vs. Indistinguishable Counting Taxonomy (Unified classification separating injective, repeated, and equivalence-class mappings)