A permutation is an ordered arrangement of items selected from a larger set — a counting scenario where sequence matters. If you pick three runners to finish a race in first, second, and third place, swapping any two of them produces a different outcome. That sensitivity to order is the defining feature of a permutation, and it separates this counting technique from a combination, where only the membership of a group matters, not the order in which its members are listed.
Understanding permutations unlocks a wide class of counting problems: how many possible passwords exist, how many ways a committee can be ranked, how many distinct letter arrangements a word admits. Once you know the permutation formula, you can solve any such problem in seconds rather than listing every possibility by hand.
This article explains what a permutation is, derives the permutation formula from first principles, walks through multiple fully worked numeric examples, covers the key special cases including repetition, and answers the most common questions students ask.
What Is a Permutation?
A permutation is a specific ordering of a collection of distinct objects. More formally, a permutation of n objects taken r at a time is an arrangement of r of those n objects placed into a definite, ordered sequence — where the positions are distinguishable and the same object cannot occupy two positions at once.
Consider a simple illustration. You have three books labeled A, B, and C, and you want to arrange any two of them side by side on a shelf. The position each book occupies matters: placing A on the left and B on the right is a different arrangement from B on the left and A on the right. Working through all possibilities:
AB, AC, BA, BC, CA, CB
That gives 6 distinct arrangements — 6 permutations of 3 objects taken 2 at a time. If the question were instead “which two books did you choose?” without caring about shelf order, you would have only three answers: the pairs (A, B), (A, C), and (B, C). That unordered count is a combination, not a permutation.
The Latin root permutare means “to change thoroughly,” which captures the spirit of the concept well. A permutation reassigns every selected element to a position, and rearranging those assignments produces a genuinely new outcome.
The Core Test: Does Order Add Information?
In practice, the quickest way to decide whether you face a permutation or combination problem is to ask: would swapping two elements produce a meaningfully different result?
- A podium finish (gold, silver, bronze) — yes, swapping first and third places is a completely different outcome. Permutation.
- A team of five selected from a squad — no, the team is the same regardless of which name was written first. Combination.
- A 4-digit PIN — yes, 4-7-2-1 and 1-2-7-4 are entirely different codes. Permutation.
- Numbers drawn in a lottery — no, the lottery draws the same winning set regardless of the order balls emerge. Combination.
When position, rank, or sequence adds distinct meaning, count permutations. When only membership counts, use combinations.
Why Order Matters: An Intuitive Argument
Imagine a three-digit combination lock — though, strictly speaking, it should be called a permutation lock, because the correct sequence is 4-7-2 and entering 2-7-4 will not open it. The three digits are identical; the order is not. The sequence is the information.
This example illustrates why distinguishing permutations from mere selections is important: it affects the count by a large factor. Suppose you have four people — Ana, Bo, Cam, and Dee — and you want to fill three distinct roles: president, treasurer, and secretary.
If you simply select three people from four (a combination), there are only four possible groups: (Ana, Bo, Cam), (Ana, Bo, Dee), (Ana, Cam, Dee), and (Bo, Cam, Dee).
But if you assign each of those three to a specific role (a permutation), each of those four groups splits into 3! = 6 ordered assignments, because the three people can be arranged in their three roles in 6 different ways. The total permutation count is 4 × 6 = 24 — six times as many as the combination count.
The ratio is always exactly r! (the factorial of the selection size), because for any unordered group of r items, there are r! ways to arrange them in order. This relationship underpins the connection between the permutation and combination formulas.
The Permutation Formula
Rather than listing every ordered arrangement, mathematicians distilled the counting process into a closed-form expression using factorials.
The Factorial Function
The factorial of a non-negative integer n, written n!, is the product of every positive integer from 1 up to n:
n! = n × (n − 1) × (n − 2) × … × 2 × 1
Key values to memorize:
5! = 120
4! = 24
3! = 6
2! = 2
1! = 1
0! = 1 (the empty product; not zero)
The value 0! = 1 is not an arbitrary convention. It is the standard mathematical definition of the empty product (multiplying zero numbers together yields the multiplicative identity, 1), and it keeps the permutation formula consistent in the special case where you select every item from the set.
Deriving P(n, r)
To count ordered arrangements of r items drawn from n distinct items, fill each position in sequence:
- First position: n choices available.
- Second position: n − 1 choices (one item is already placed).
- Third position: n − 2 choices.
- … and so on until …
- r-th position: n − r + 1 choices.
By the fundamental counting principle, multiply these independent choices:
P(n, r) = n × (n − 1) × (n − 2) × … × (n − r + 1)
This is a product of exactly r descending terms. To express it compactly, note that n! extends this product all the way down to 1, and (n − r)! equals the tail we do not want — the terms from (n − r) down to 1. Dividing removes exactly that tail:
P(n, r) = n! / (n − r)!
This is the permutation formula. You will see it written as P(n, r), nPr, or ₙPᵣ in different textbooks — all equivalent notation for the same calculation.
Step-by-Step Worked Examples
Example 1: Podium Places in a Race
Problem: Eight runners compete. In how many ways can the gold, silver, and bronze medals be awarded?
Step 1 — Identify n and r. Total runners: n = 8. Medals to award: r = 3. Order matters (gold ≠ silver ≠ bronze), so this is a permutation.
Step 2 — Write the formula.
P(8, 3) = 8! / (8 − 3)! = 8! / 5!
Step 3 — Cancel the factorial tail. The 5! in the denominator cancels the lower portion of 8!, leaving only the top three factors:
P(8, 3) = 8 × 7 × 6 = 336
There are 336 ways to award the three medals.
Verify with full factorials: 8! = 40320, 5! = 120, 40320 ÷ 120 = 336. Confirmed.
Example 2: Building a 4-Digit Code
Problem: How many 4-digit codes can be created from the digits 1 through 9 if no digit repeats?
n = 9, r = 4.
P(9, 4) = 9 × 8 × 7 × 6 = 3024
There are 3,024 codes.
Example 3: Arranging All Letters
Problem: In how many ways can the letters in the word STAR be arranged?
STAR has 4 distinct letters, and you use all 4. n = 4, r = 4.
P(4, 4) = 4! / (4 − 4)! = 4! / 0! = 24 / 1 = 24
There are 24 distinct letter arrangements.
Example 4: Ranking Job Candidates
Problem: A hiring panel must rank the top 3 applicants (first, second, third choice) from a pool of 12. How many ranked shortlists are possible?
n = 12, r = 3.
P(12, 3) = 12 × 11 × 10 = 1320
There are 1,320 possible ranked shortlists.
Special Cases in the Permutation Formula
r = n: Arranging All Items
When you arrange every item in the set (r = n), the denominator becomes (n − n)! = 0! = 1:
P(n, n) = n! / 0! = n! / 1 = n!
The number of ways to arrange 5 distinct books on a shelf is 5! = 120. The permutation formula and a direct factorial give the same answer, confirming consistency.
r = 0: Selecting Nothing
P(n, 0) = n! / n! = 1
There is exactly one way to choose and arrange zero items: the empty selection. This case might seem trivial, but it is essential for algebraic consistency and appears in proofs involving the binomial theorem and generating functions.
r = 1: Selecting One Item
P(n, 1) = n! / (n − 1)! = n
There are exactly n ways to choose one item from n and place it. Direct counting confirms this immediately.
Permutations With Repetition
All of the above assumes without repetition: once an item is placed in a position, it is unavailable for subsequent positions. This is the standard interpretation of “permutation” in most statistics and probability curricula.
When repetition is allowed — each position can hold any of the n items regardless of what was placed before — the count is larger:
Permutations with repetition = n^r
Example: 4-digit PIN from digits 0–9 (repetition allowed)
Any of 10 digits can go in each of the 4 positions:
10^4 = 10,000
Comparison without repetition:
P(10, 4) = 10 × 9 × 8 × 7 = 5,040
Allowing repetition increases the count by almost double here, because every position has 10 options rather than a shrinking pool.
The key question to ask: can the same item fill more than one position? A lock digit can repeat; a race competitor cannot appear in two places at once. When in doubt about which formula applies, re-read the problem for phrases like “without replacement,” “no digit may be repeated,” or “once chosen, a member cannot be selected again” — all indicate the standard P(n, r) = n!/(n−r)! formula.
Real-World Applications of Permutations
Permutations arise whenever the order in which items are assigned to positions matters. Some concrete domains:
Cryptography and passwords. The number of possible passwords determines how long a brute-force attack takes. A 6-character password from 26 lowercase letters (no repetition) gives P(26, 6) = 26 × 25 × 24 × 23 × 22 × 21 = 165,765,600 possibilities. Allowing repetition (26^6 = 308,915,776) increases this further.
Sports and ranking. Assigning players to batting order positions in baseball, seeding players in a tournament bracket, awarding medals in a race — all are permutation problems because each position has distinct meaning.
Scheduling. Deciding in what order to schedule five tasks across five time slots, where the completion time of an earlier task affects a later one, requires counting permutations to find the optimal sequence.
Genetics. The order of nucleotides along a DNA strand determines the protein it encodes. Counting the permutations of a sequence tells you how many distinct proteins a given set of nucleotides could theoretically produce.
Logistics. Routing problems — visiting r cities from a network of n in the fewest kilometers — involve counting permutations of paths to evaluate candidates efficiently.
Common Mistakes and How to Avoid Them
Confusing Permutations With Combinations
The most common error is applying P(n, r) when order does not actually matter. If a problem asks how many teams of 3 can be formed from 10 people, without assigning roles, the answer is a combination, not a permutation. Always check: does swapping two elements produce a different answer to the question? If not, use C(n, r) = n! / (r! × (n−r)!).
Treating 0! as 0
Students regularly write 0! = 0, then divide by zero and obtain a nonsensical result or an error. Remember: 0! = 1, always. When r = n, the denominator (n−n)! = 0! = 1, not 0.
Swapping n and r
In P(n, r), n is the total pool size and r is the number of positions to fill, with r ≤ n required. If you have 10 candidates for 3 roles, n = 10 and r = 3. Writing P(3, 10) would require computing (3−10)! = (−7)!, which is undefined. If you find yourself computing P(n, r) with r > n, reread the problem — either repetition is allowed (use n^r) or you have assigned n and r in reverse.
Computing Huge Factorials Directly
For P(20, 3), computing 20! = 2,432,902,008,176,640,000 and then dividing by 17! is unnecessarily cumbersome. The cancellation shortcut gives the same result immediately:
P(20, 3) = 20 × 19 × 18 = 6,840
In general, expand only the top r descending factors from n. The denomintor factorial cancels all the remaining terms.
Using n^r When Repetition Is Forbidden
The formula n^r counts arrangements when repetition is allowed. If the problem specifies no repetition — drawing cards from a deck, choosing race finishers, filling roles from a candidate pool — use P(n, r) = n! / (n−r)!. Using n^r overcounts badly: P(5, 3) = 60, whereas 5^3 = 125.
Frequently Asked Questions
What is a permutation?
A permutation is an ordered arrangement of items selected from a set. Two arrangements are distinct permutations if they differ in at least one position, even if they contain the same elements. The arrangement (A, B, C) and the arrangement (C, B, A) are two different permutations of the same three letters.
What is the permutation formula?
The permutation formula for arranging r items chosen from n distinct items is:
P(n, r) = n! / (n − r)!
The equivalent expanded form is P(n, r) = n × (n−1) × … × (n−r+1), which is the product of the top r descending integers starting at n.
What is the difference between a permutation and a combination?
Permutations count ordered arrangements — the sequence matters. Combinations count unordered groups — only membership matters. The combination formula is C(n, r) = n! / (r! × (n−r)!). The two are related by C(n, r) = P(n, r) / r!, because any unordered group of r items corresponds to exactly r! ordered arrangements.
How do you calculate permutations with repetition?
When items can be reused across positions, the formula is n^r. With 10 possible digits and 4 positions, repetition allowed, the count is 10^4 = 10,000. Without repetition the count is P(10, 4) = 10 × 9 × 8 × 7 = 5,040.
What does P(n, r) mean?
P(n, r) means “the number of ordered arrangements of r items chosen from n distinct items.” The letter P stands for permutation. The first argument (n) is the pool size; the second (r) is the selection size. P(8, 3) = 336 tells you there are 336 ordered ways to pick and place 3 items from a set of 8.
Can r be greater than n?
No — not in the standard without-repetition formula. Choosing more items than exist in the pool is impossible; the denominator (n−r)! becomes undefined for negative integers. If a problem implies r > n, either repetition is allowed (switch to n^r) or there is an error in your setup of n and r.
Is P(n, r) the same as n!?
Only when r = n. In that case you arrange every item: P(n, n) = n!/0! = n!/1 = n!. For r < n, P(n, r) is a proper divisor of n! — specifically, n! divided by (n−r)!.
When should I multiply rather than use the formula?
They are the same calculation in different notation. P(n, r) = n × (n−1) × … × (n−r+1) is the product form; n!/(n−r)! is the compact algebraic form. Both give identical results. Use the product form when n is moderately sized and you want to avoid large factorials; use the formula when working symbolically or writing proofs.
Summary
A permutation is an ordered selection of items from a larger set, where each distinct sequence counts as a separate outcome. The permutation formula
P(n, r) = n! / (n − r)!
counts every ordered arrangement of r items from a pool of n without repetition. The derivation follows directly from the fundamental counting principle: fill the first position with any of n items, the second with any of the remaining n − 1, and so on down to n − r + 1, then multiply.
Three rules to take away: order matters (swapping two elements yields a different permutation), 0! = 1 (so P(n, n) = n!), and repetition allowed changes the formula to n^r. With these in hand you can translate any ordered-counting problem into a calculation.
For a rigorous probability-theory treatment of counting techniques including permutations and combinations, see Penn State STAT 414 — Counting Techniques, Lesson 1.3, which covers both topics as the foundational tools for computing classical probabilities. Math is Fun — Permutations and Combinations is a useful companion for building intuition across worked examples.