Permutation Calculator
Calculation Mode
Quick examples
Max n = 20 for readability
| r | Formula | Multiplication | Result |
|---|
Use the Calculate nPr tab to enter values, then come back here for the full step-by-step solution.
What Is a Permutation?
A permutation is an ordered arrangement of items where changing the order produces a different result. The sequence ABC and the sequence BAC are two distinct permutations of the same three letters, because the positions differ. This is the central property that separates permutations from combinations: in a permutation, position matters.
Think about awarding gold, silver, and bronze medals to runners. Placing Alice first, Bob second, and Carol third is a different outcome from placing Bob first, Alice second, and Carol third — even though the same three people are on the podium. That ordering sensitivity is exactly what a permutation captures. Combinations, by contrast, count only which items are selected, ignoring their order entirely.
Permutation Formulas Explained
There are three formulas you choose between depending on whether items can repeat, whether you are arranging a subset or the full set, and whether the arrangement forms a line or a circle.
Without Repetition (standard nPr)
P(n, r) = n! / (n - r)!
n = total distinct items
r = positions to fill
Example: 5P3
= 5! / 2! = 120 / 2 = 60
With Repetition
Pᵣ(n, r) = nʳ
Each position can hold
any of the n items.
Example: 10-digit PIN (length 4)
= 10⁴ = 10,000
Arrange All n Items
P(n, n) = n!
When r equals n, every
item is placed.
Example: 5 people, 5 seats
= 5! = 120
Circular Permutation
(n - 1)!
Rotations of the same
arrangement are identical.
Example: 6 people, round table
= 5! = 120
The multiplication form of the standard formula — n × (n−1) × (n−2) × … × (n−r+1) — reaches the same result without computing the full factorial of n first. For 10P3 that gives 10 × 9 × 8 = 720, which is faster than computing 10! and dividing by 7!. Programming implementations and scientific calculators usually use this approach to avoid overflow.
How to Calculate Permutations — Step by Step
To calculate nPr by hand: identify n and r, compute n!, compute (n−r)!, then divide. The result is the number of distinct ordered arrangements of r items from n.
n is the total pool of distinct items available. r is the number of positions to fill. For "3 medals from 10 competitors," n = 10 and r = 3. Make sure both are non-negative whole numbers and, for the standard formula, that r does not exceed n.
For the first position there are n choices. The second position has n−1 choices, because one item is already placed. Continue until r positions are filled: n × (n−1) × … × (n−r+1). For 10P3: 10 × 9 × 8 = 720.
Compute n! and (n−r)!, then divide: P(n,r) = n! / (n−r)!. For 10P3: 10! / 7! = 3,628,800 / 5,040 = 720. Both methods give the same answer; the multiplication method is simpler for larger values.
P(n, 0) = 1 always (one way to arrange zero items: the empty arrangement). P(n, n) = n! (all items arranged). These edge cases are mathematically sound and the calculator above handles them correctly.
The number you get is the count of distinct ordered sequences. For 10P3 = 720, there are exactly 720 ways to award gold, silver, and bronze to 3 competitors chosen from 10, where finishing position determines which medal they receive.
Worked example: How many ways can you arrange 4 letters from the 26-letter alphabet without repeating any letter? Answer: 26P4 = 26 × 25 × 24 × 23 = 358,800. Enter n = 26, r = 4 in the calculator above to verify, and see the full factorial breakdown in the Step-by-Step tab.
Permutation vs. Combination: The Essential Difference
The single question that determines which formula to use: does the order of selection matter? If yes, use a permutation. If no, use a combination.
Choosing a president, vice-president, and secretary from 10 candidates is a permutation — the three roles are distinct, so placing Alice as president and Bob as VP differs from placing Bob as president and Alice as VP. Choosing any three people for a committee from the same 10 candidates is a combination — the group Alice, Bob, Carol is the same committee regardless of which name you list first.
Table: Permutation vs. Combination Direct Comparison
| Property | Permutation | Combination |
|---|---|---|
| Does order matter? | Yes — ABC ≠ BAC | No — ABC = BAC |
| Formula | n! / (n−r)! | n! / [r!(n−r)!] |
| Notation | nPr or P(n,r) | nCr or C(n,r) or ⁿCᵣ |
| Result for n=5, r=3 | 60 | 10 |
| Relationship | P(n,r) = C(n,r) × r! | C(n,r) = P(n,r) / r! |
| Typical scenarios | Rankings, roles, ordered codes, sequences | Teams, committees, selections without rank |
The relationship P(n,r) = C(n,r) × r! makes intuitive sense: first choose which r items are included (that is the combination), then count the r! ways to order that chosen group (that is the ordering factor). For 5P3 = 60: C(5,3) = 10 groups, each orderable in 3! = 6 ways, giving 10 × 6 = 60. The calculator above shows this breakdown in the Full Results section after every calculation.
Which Formula Do You Need?
Three questions determine the right counting formula for any arrangement problem.
Permutations Without Repetition
In a standard permutation without repetition, once an item occupies a position it cannot appear again. Each arrangement draws from a shrinking pool.
This is the most common type students encounter. The reasoning behind the formula is sequential: the first slot has n options, the second slot has n−1 (one item gone), the third has n−2, and so on for r slots. The product n × (n−1) × … × (n−r+1) equals n! / (n−r)!, which is the formula written compactly. For 10P3: 10 × 9 × 8 = 720.
Table: Common nPr Values for Reference
| n | r | nPr | Multiplication | Example |
|---|---|---|---|---|
| 5 | 3 | 60 | 5 × 4 × 3 | 3 from 5 distinct books on a shelf |
| 10 | 3 | 720 | 10 × 9 × 8 | Gold/silver/bronze from 10 runners |
| 10 | 4 | 5,040 | 10 × 9 × 8 × 7 | 4-digit code, no digit repeats |
| 26 | 4 | 358,800 | 26 × 25 × 24 × 23 | 4-letter word, no repeated letters |
| 52 | 5 | 311,875,200 | 52 × 51 × 50 × 49 × 48 | 5-card ordered hand from a deck |
Permutations With Repetition
When each position can hold any of the n available items independently, the formula is simply nr. Because no item is "used up," the pool stays at n for every position.
The classic example is a numeric PIN code. A 4-digit PIN from digits 0–9 allows repetition (0000 is a valid PIN), so the count is 104 = 10,000. Compare that to a 4-digit code where no digit repeats: 10P4 = 10 × 9 × 8 × 7 = 5,040. The repetition-allowed version always gives a larger result, which makes sense because it covers strictly more possibilities.
Circular Permutations
When n distinct objects are arranged around a circle, two arrangements that are simple rotations of each other are considered the same. One person's seat is fixed to remove this redundancy, giving (n−1)! distinct arrangements.
Seat 6 people at a round table: instead of 6! = 720 (as you would for a row of 6 chairs), fix one person and arrange the remaining 5, giving 5! = 120 distinct seatings. The distinction matters whenever the starting point is arbitrary — a round table, a rotating carousel, a necklace.
For necklaces and bracelets, flipping the arrangement produces a physically identical result, which halves the count further to (n−1)! / 2. The circular mode in the calculator above uses (n−1)! and labels the result clearly so you know which assumption applies.
Permutations of Sets With Identical Items
When some items in the full set are identical to each other, swapping those identical items does not create a new arrangement. The count is n! divided by the factorial of each repeated item's frequency.
Common Mistakes When Calculating Permutations
Table: Frequent Errors and How to Avoid Them
| Mistake | What happens | Fix |
|---|---|---|
| Using nPr when order does not matter | Overcounts arrangements that are actually the same selection | Ask "does swapping positions produce a new outcome?" If not, use nCr |
| Using nCr when order matters | Undercounts — misses all distinct orderings of each selection | Use nPr, which equals nCr × r! |
| Ignoring whether repetition is allowed | Wrong formula and wrong answer | Read the problem for "digits can repeat," "letters may be reused," etc. |
| Setting r > n without repetition | Mathematically undefined — no factorial of a negative number | With repetition, r can exceed n. Without repetition, r ≤ n is required |
| Using linear formula for circular arrangements | Counts each arrangement n times (once per rotation) | Divide by n or use (n−1)! directly |
| Confusing repeated-items problem with repetition-allowed problem | Wrong formula applied to correct input | Repeated items in the set → n!/product of factorials. Repetition in selection → nr |
| Forgetting 0! = 1 | Division by zero error or incorrect step | 0! equals 1 by definition. P(n,0) = 1 and P(n,n) = n! are both correct |
Real-World Permutation Examples
Related Calculators and Topics on Statistics Fundamentals
Permutations connect directly to counting principles, probability, and combinatorics. These pages build the surrounding picture.
Frequently Asked Questions
A permutation is an ordered arrangement of items where changing the order produces a different result. If you arrange three letters A, B, C, the sequences ABC and BAC are two different permutations. Because each distinct ordering counts separately, permutations always produce a result equal to or larger than the corresponding combination count for the same n and r values.
Use the formula P(n,r) = n! / (n−r)! or the equivalent multiplication n × (n−1) × … × (n−r+1). For example, 10P3 = 10 × 9 × 8 = 720. On a scientific calculator, look for the nPr button. The multiplication form is generally easier for mental arithmetic or programming because it avoids computing the full factorial of n.
nPr counts ordered arrangements — every different ordering of the same items is a separate result. nCr counts unordered selections — the same items in a different order count only once. The relationship between them is P(n,r) = C(n,r) × r!. For n = 5, r = 3: nCr = 10 selections, nPr = 60 arrangements (each of the 10 groups can be ordered 3! = 6 ways).
Yes. When repetition is allowed, use nr instead of n!/(n−r)!. A 4-digit PIN from digits 0–9 with repetition allowed gives 104 = 10,000 possibilities. Without repetition (no digit may appear twice in the same PIN), it gives 10P4 = 5,040. The two formulas answer different questions, so identifying whether repetition is permitted is the first step in every permutation problem.
A circular permutation arranges n distinct objects around a circle where rotations of the same arrangement are treated as identical. The formula is (n−1)!. For 6 people around a round table: (6−1)! = 5! = 120 arrangements, compared to 6! = 720 for a straight row of 6 chairs. The reduction by a factor of n reflects that each circular arrangement can be rotated n ways, and all rotations represent the same seating.
P(n,n) = n! because you are arranging every available item. For 5 items: 5P5 = 5! = 120. The (n−r)! term in the denominator becomes 0! = 1, so the formula reduces to n!/1 = n!. This case represents the total number of ways to order a complete set, which is the classic factorial result.
There is exactly one way to arrange zero items: the empty arrangement. Substituting into the formula: P(n,0) = n! / n! = 1. This is consistent with the convention that 0! = 1, which is defined to make factorials and permutations behave correctly at the boundary. The result is not zero; an empty sequence still counts as one valid arrangement.
No. Without repetition, you cannot fill more positions than you have distinct items to fill them with. The formula would require computing the factorial of a negative number, which is undefined. If r exceeds n and each position must hold a different item, the answer is zero (no valid arrangements exist). With repetition allowed, r can freely exceed n because items are reused.
Use permutations whenever the positions or roles assigned are distinct: race rankings (1st, 2nd, 3rd are different), job assignments (president, VP, secretary), passwords and codes (digit order matters), or any scenario where swapping two selected items changes the outcome. Use combinations whenever you are simply selecting a group where membership matters but internal order does not: a committee, a hand of cards where the cards are played simultaneously, choosing toppings for a pizza.
Permutation counts are often the denominator or numerator in probability calculations. The probability that a specific ordered arrangement occurs when selecting r items from n without repetition is 1 / P(n,r). More broadly, probability = (favorable outcomes) / (total outcomes), and permutation formulas count both. For example, the probability that 3 specific runners finish 1st, 2nd, and 3rd in exactly that order among 10 is 1 / 10P3 = 1 / 720.