How many ways can 5 runners finish in 1st, 2nd, and 3rd place? How many different 4-digit PIN codes are possible? How many ways can you arrange the letters in your name? All of these are permutation problems — and once you understand the formula, they become straightforward to solve.
What Is a Permutation?
A permutation is an ordered arrangement of items selected from a set. The key word is ordered — in permutations, the sequence matters. Arranging A, B, C as "ABC" is a different permutation from "BAC" or "CAB," even though they contain the same three letters.
Permutations answer the question: "In how many ways can I arrange r items chosen from a group of n items, where order matters?"
Order matters → use permutation
Order does NOT matter → use combination
Example: The 3-digit PIN "1-2-3" is different from "3-2-1" → permutation
Example: A pizza with toppings A, B, C is the same regardless of order → combination
Understanding Factorials First
The permutation formula uses factorials. The factorial of a number n, written n!, is the product of all positive integers from 1 to n.
Special case: 0! = 1 (by mathematical convention)
Here are the factorial values you will encounter most often:
Notice how quickly factorials grow — 10! is already over 3.6 million. This is why the number of possible arrangements grows explosively as n increases.
The Permutation Formula
r = number of items being arranged (chosen)
Order matters, no item is used more than once
If you are arranging ALL items in the set (not just a selection), the formula simplifies to just n! — because (n − n)! = 0! = 1, so the denominator becomes 1.
Example: How many ways can 5 people sit in 5 chairs? P(5,5) = 5! = 120
Step-by-Step Computation
Identify n and r
n is the total number of distinct items available. r is the number of items you are selecting and arranging. Make sure order matters — if not, you need combinations instead.
Compute n! and (n − r)!
Calculate the factorial of n. Then calculate the factorial of (n − r). If r = n, then (n − r)! = 0! = 1.
Divide n! by (n − r)!
Divide your two factorial values. You can simplify by cancelling common factors before multiplying — this avoids computing very large numbers unnecessarily.
State the answer
The result is the number of distinct ordered arrangements possible. Always double-check your n and r values — swapping them gives a very different answer.
Worked Examples
Example 1: Arranging All Items
Example 2: Selecting and Arranging a Subset
Example 3: Letter Arrangements
Example 4: Using the Shortcut (Cancellation)
Instead of computing full factorials, multiply downward from n for exactly r terms:
P(n, r) = n × (n−1) × (n−2) × … (r terms total)
P(10, 4) = 10 × 9 × 8 × 7 = 5,040 — no need to compute 10! or 6! separately.
Permutations WITH Repetition
In the standard formula, each item can only be used once. But sometimes items can be reused — like digits in a PIN where the same digit can appear multiple times.
r = number of positions to fill
Each item can be reused — order still matters
🧮 Permutation Calculator
Enter n and r to compute permutations with or without repetition.
Permutation vs Combination
Order matters. ABC ≠ BAC.
Use for rankings, sequences, arrangements, passwords, schedules.
Order does NOT matter. ABC = BAC.
Use for selections, groups, committees, lottery numbers.
| Scenario | Order Matters? | Use |
|---|---|---|
| Awarding 1st, 2nd, 3rd place | ✅ Yes | Permutation |
| Choosing 3 team members from 10 | ❌ No | Combination |
| Creating a 4-digit PIN | ✅ Yes | Permutation |
| Selecting 5 lottery numbers | ❌ No | Combination |
| Arranging books on a shelf | ✅ Yes | Permutation |
| Choosing pizza toppings | ❌ No | Combination |
| Seating people in numbered chairs | ✅ Yes | Permutation |
Practice Problems
| Problem | Formula | Answer |
|---|---|---|
| How many ways can 6 people stand in a line? | P(6,6) = 6! | 720 |
| How many 2-digit arrangements from {1,2,3,4,5}? | P(5,2) | 20 |
| Top 3 finishers from 10 athletes | P(10,3) | 720 |
| 4-letter codes from A–Z, no repeats | P(26,4) | 358,800 |
| 3-digit codes, digits 1–9, repetition allowed | 9³ | 729 |
| How many ways can the letters of "MATH" be arranged? | P(4,4) = 4! | 24 |
Special Cases
P(n, 0) — Choosing Zero Items
P(n, 0) = n! ÷ n! = 1 for any value of n. There is exactly one way to arrange zero items — the empty arrangement. This is why 0! = 1 by convention.
P(n, 1) — Choosing One Item
P(n, 1) = n! ÷ (n−1)! = n. There are exactly n ways to choose and arrange a single item from n — you simply pick one of them.
Large Numbers and BigInt
Factorials grow extremely fast. 20! = 2,432,902,008,176,640,000 — more than 2 quintillion. Our Permutation Calculator uses JavaScript BigInt to handle arbitrarily large permutation values accurately without rounding errors.
1. Permutation = ordered arrangement — order matters
2. Without repetition: P(n,r) = n! ÷ (n−r)!
3. With repetition: P = nʳ
4. Shortcut: multiply downward from n for r terms: P(n,r) = n × (n−1) × … (r times)
5. P(n,n) = n! — arranging all items
6. P(n,0) = 1 — one way to arrange nothing
7. Use permutation when order matters; use combination when it does not
🧮 Try the Permutation Calculator
Calculate nPr instantly — with and without repetition, plus BigInt support for very large values.
Try the Permutation Calculator →