Permutations are arrangements where order matters. As we discussed on the main combinatorics page, this is what distinguishes permutations from combinations.
Each scenario has specific formulas and real-world applications. Ready to dive into the details, or want to compare with combinations where order doesn't matter?
Mastering these permutation types gives you the tools to solve ordering problems across mathematics, computer science, and everyday scenarios. The key is recognizing which type fits your specific situation.
The Logic behind permutations
Lining things up in order gets out of hand quickly.
Two items can stand in a row in 2 ways: AB or BA. Three letters A, B, C already give more, and the list is easy to get wrong — skip one order or write another twice. Ten books on a shelf could not be listed by hand at all. There has to be a way to count the orders without writing them out.
Building the orders one position at a time gives the count.
Fill the three places of the row in turn. The first place can take any of the 3 letters. Once it is filled, 2 letters are left for the second place. Then 1 letter is left for the third. Every first choice combines with every second choice and every third, so the counts multiply.
Factorial of 3
3×2×1=6(n!)
Six orders: ABC, ACB, BAC, BCA, CAB, CBA — exactly the list above, with nothing missed and nothing repeated.
Nothing in that count was chosen; every factor was forced.
Each factor is one less than the one before because a letter, once placed, cannot be used again. The factors multiply because the choices are made in sequence — the multiplication principle. Nothing depended on there being three letters: with n items the first place has n options, the next n−1, and so on down to 1.
items n
choices, position by position
arrangements
1
1
1
2
2 × 1
2
3
3 × 2 × 1
6
4
4 × 3 × 2 × 1
24
5
5 × 4 × 3 × 2 × 1
120
The definition
A permutation of a set of distinct items is an arrangement of all of them in a definite order. For n distinct objects, the number of permutations is:
The product n×(n−1)×⋯×1 is the factorial n!; for 3 letters, 3!=6.
A permutation is an ordered arrangement, and n! is a count of them.
Each permutation is a sequence: ABC and BAC contain the same letters but are different permutations, because order is the whole point. In every type of permutation, the order of arrangement matters — that is exactly what separates permutations from combinations, where only the group counts. The number n! is how many such sequences there are.
The multiplying generalizes; the rest was particular to this example.
What generalizes is the mechanism: fill positions one by one and multiply the options at each step. What was particular: every item was used, every item was different, none could repeat, and the row had a first and last place. Change any of these — use only some items, allow identical items or repetition, seat them in a circle — and the factors change, which is what the types of permutations below sort out. And the count grows fast: 4 items already give 24 orders, and 10 give 3,628,800.
All 24 orders of 4 items, grouped by the item in first place: 4 groups of 6, the 3!=6 orders of the rest. The same state is on the full permutation visualizer.
The rest of the page goes through the types of permutations — full, with identical items, partial, with repetition, circular — their notation, and derangements, where no item may stay in its place.
Types of Permutations
Although in all types of permutations the order of arrangement matters, the key differences between them arise from other considerations: Can items be repeated? Are some items identical? Is the arrangement linear or circular? The table below summarizes these distinctions, showing how different scenarios lead to different counting formulas.
By addressing these additional questions, we can classify permutations into several types, each with its own counting method. Understanding these distinctions helps in correctly applying the appropriate formula for a given arrangement problem.
Permutation (Full)
Full Permutation applies when you arrange all distinct items in a specific order with no repetitions allowed.
Property
Full Permutation
Use all items
✓
Order matters
✓
Identical items
✗
Repetitions
✗
Linear arrangement
✓
Full Permutation — Examples: Arranging all books on a shelf, deciding the lineup of all players in a team, organizing all photos in an album, setting the order of speakers in a presentation, ordering all tasks in a workflow, ranking all competitors in a contest, scheduling all meetings in a day, sorting all files in a folder.
All 3! = 6 arrangements of three items
Three distinct items, every order they can stand in: 3 choices for the first place, 2 for the second, 1 for the last, and the six results laid out in groups by their first item. Each group has the same size because whatever goes first, the rest can still be ordered in 2! ways. Build the arrangements for 4 and 5 items on the full permutation visualizer.
Every extra item multiplies the count again: 4 items give 24 arrangements, 5 give 120.
The intuition and logic we use for this kind of permutation has been explained pretty well in previous section and it works basically for all types of permutations. Just in case of full permutations (unlike in other types) no further modifications needed and the calculation is simple. Notation: In combinatorics, we use specific notation to represent different types of permutations. For arranging r objects selected from n distinct objects, the standard notation is P(n,r) or nPr. When applied to full permutations, apparently r=n (because we use all the items ), and the notation turns into :
Stirling's formula n!≈2πn(en)n gives about 3,598,696 for n=10, less than 1% below 10!=3,628,800. Its relative error is close to 12n1, so it keeps shrinking as n grows.
The factorial soon outgrows every everyday quantity. Each new item multiplies the count by a larger number than the item before it did, so n! eventually overtakes 2n, 10n and any other fixed number raised to the power n. Already 13!=6,227,020,800 is more than six billion, and 20! has 19 digits. Most pocket calculators give up at 70!, the first factorial above 10100, because they show only two digits for the power of ten.
Permutation with Identical Items
Permutation with Identical Items applies when arranging all items where some identical elements appear multiple times in your collection. Classic examples include arranging all letters in words like "MISSISSIPPI" or organizing all colored balls when you have multiple balls of the same color.
Property
Permutation with Identical Items
Use all items
✓
Order matters
✓
Identical items
✓
Repetitions
✗
Linear arrangement
✓
Permutation with Identical Items — Examples: Rearranging letters in the word “BALLOON,” organizing colored balls where some colors repeat, sequencing identical files and unique ones in storage, arranging identical chairs and distinct tables in a layout, ordering repeated ingredients in a recipe list.
The multinomial coefficient counts distinct arrangements of n items split into groups of sizes n1,n2,…,nk. Use combinatorics calculator →
Pitfall: Missing a repeated letter
Computing 4!⋅4!11!=69,300 for MISSISSIPPI divides out the Is and the Ss but not the two Ps, so every word is counted twice. With 2! in the denominator, the count is 34,650.
MISSISSIPPI is the standard case for this formula. Its 11 letters fall into four groups: one M, four Is, four Ss and two Ps, so n=11 and the group sizes are 1,4,4 and 2. Swapping two letters of the same group gives back the same word, and the denominator removes these swaps group by group. A letter that appears only once forms a group of size one and contributes 1!=1.
Swapping identical items changes nothing, so each group's factorial in the denominator removes exactly those swaps.
Partial Permutation without Repetition
Partial Permutation without Repetition applies when selecting and arranging only some items from a larger collection, with all items being distinct. Classic examples include choosing and ordering contestants from a group or selecting and arranging books from a library shelf.
Property
Partial Permutation without Repetition
Use all items
✗
Order matters
✓
Identical items
✗
Repetitions
✗
Linear arrangement
✓
Partial Permutation (without repetition) — Examples: Selecting and ordering finalists from a group of contestants, arranging a subset of books on a display, picking and sequencing players for a relay team, choosing and ordering questions for an interview, organizing a limited set of tasks for a project phase.
Where n! counts all arrangements, dividing by (n−r)! removes the unused positions. Use combinatorics calculator →
Pitfall: Dividing by r! when order matters
Using (310)=120 for gold, silver and bronze among 10 runners counts only which three runners win a medal. Each such trio can receive the three medals in 3!=6 orders, so the count is P(10,3)=720.
A race with 10 runners and medals for the first three places is the typical case: n=10 runners and r=3 places. The formula keeps only the first r factors of 10!, one for each place to fill: 10 choices for the gold, 9 for the silver and 8 for the bronze. The remaining factors 7⋅6⋯1 are exactly the (n−r)!=7! that the division removes.
Filling only r places keeps the first r factors of n! and drops the rest.
Permutation Notation
Notation
Permutation Notation
Three marks carry every count on this page: the exclamation that multiplies downward, the two-letter family that orders selections, and the same exclamation moved out front to count the restless. Each scenario section keeps its own Notation block for the variant spellings.
The choose-family marks (rn) and C(n,r) belong to the binomial coefficient; the set-size bars behind the counting arguments to cardinality.
n!
n factorial
The postfix count of complete rearrangements: n!=n×(n−1)×⋯×1, introduced in The Logic behind permutations above. The convention 0!=1 is load-bearing — it keeps every counting formula honest at the edges.
CasesThe mark binds tight — 2n! means 2⋅(n!), and (2n)! needs its brackets; stacked marks are different animals: (n!)! iterates, while n!! skips every second factor (the double factorial), not a repeat.
Do not confusePunctuation. A sentence ending on 5 with an exclamation and the operator in 5! share a glyph — and in programming ! negates; position and context carry the meaning.
P(n,r) · nPr
P n r; n permute r
The arrangement-count family: P(n,r)=(n−r)!n! orders r items chosen from n — functional P(n,r) in texts, subscripted nPr on calculator keys, as the Notation blocks of Permutation (Full) and Partial Permutation without Repetition above list.
CasesAnr — the Arrangements letter of French and Russian textbooks, same count in a different alphabet; the full case collapses the second argument: P(n,n)=P(n)=n!.
Do not confuseThe choose family. P(n,r) counts ordered selections, (rn) unordered ones — they differ by exactly the factor r!, and the binomial coefficient owns the other side of that ledger.
!n · Dn
subfactorial n; derangements of n
The factorial's mirror image: !n counts permutations that leave nothing in place — the prefix position is the entire distinction, as Derangement below explains. Dn is the older spelling, still common.
CasesThe two interchange freely — !5=D5=44; the prefix form reads badly mid-sentence, which is precisely what keeps the subscripted Dn alive in running text.
Do not confusen! read backwards. !4=9 while 4!=24 — position flips the meaning entirely, and a hasty transcription trades all arrangements for only the restless ones.
Permutation with Repetition applies when arranging items where you can reuse the same element multiple times during the arrangement process. Classic examples include creating PIN codes where digits can repeat, or forming passwords where letters can be used multiple times.
Property
Permutation with Repetition
Use all items
✗
Order matters
✓
Identical items
✗
Repetitions
✓
Linear arrangement
✓
Permutation with Repetition — Examples: Generating PIN codes from digits, creating letter sequences for passwords, setting the dials of a combination lock, composing license plate numbers, assigning seats with multiple people allowed in the same category.
Fact: A combination lock counts permutations
A lock set to 4-7-2 does not open at 2-7-4, and two dials may show the same digit, so its codes are ordered and may repeat: three dials give 103=1000 codes. A true combination of three different digits would leave only (310)=120.
The combination lock in this list is a small case of the same count. A padlock with three dials, each showing the digits 0 to 9, has one position for every dial and one option for every digit, so it fits the formula below with n=10 and r=3. Nothing stops two dials, or all three, from showing the same digit, and a code such as 0-0-0 is as valid as any other.
A 4-digit PIN is the standard example. Each of the r=4 positions can hold any of the n=10 digits, whatever was entered before, so the same digit may appear in several positions, as in 0707 or 1111. The count is built position by position, exactly as for a full permutation, except that the number of options never shrinks from one position to the next.
Circular Permutation
Circular Permutation applies when arranging items around a circle where rotations are considered identical arrangements. Classic examples include seating people around a round table or arranging objects in a circular pattern.
Property
Circular Permutation
Use all items
✓
Order matters
✓
Identical items
✗
Repetitions
✗
Linear arrangement
✗
Circular Permutation — Examples: Arranging guests around a round table, seating participants in a circular panel, ordering beads on a ring that is never flipped over, organizing tasks in a repeating cycle, setting positions for players in a circular game arrangement.
Five people at a round table show how this works. Fix one of them in a seat; every seating can then be read from that seat clockwise, and the other four people fill the remaining seats in any order. Turning the whole table moves everyone at once but leaves each person with the same neighbours on the left and on the right, which is why a turn does not create a new arrangement.
A circle has no first seat, so fixing one item turns the circle into a row of the remaining n−1.
Derangement
A derangement is a permutation with an added constraint: no element appears in its original position. The other five permutation types vary the question of which arrangements to count — all items or a subset, with or without repetition, linear or circular. The derangement varies the constraint on the arrangement itself: same items, same order-matters property, same linear shape, with the extra requirement that every item must have moved.
The classical motivation is the hat-check problem. n guests check n hats, and the attendant returns them in a random order. In how many of those orderings does no guest receive their own hat? Each such ordering is a derangement of the n hats.
Notation
Two notations are in common use:
• !n — the subfactorial, the modern standard. The exclamation precedes the operand, mirroring the factorial in reverse. • Dn — an alternative notation, common in older texts.
It is derived by applying the inclusion–exclusion principle to the set of all permutations: start with n! total, subtract those that fix at least one specific position, add back those that fix at least two, and continue with alternating signs through all n positions. The full derivation lives on the inclusion–exclusion page; the permutations page uses the result.
The proportion of permutations that are derangements approaches a fixed limit rather than vanishing or filling the space — for any sufficiently large n, roughly 36.8% of all permutations of n items are derangements.
Small Values
The first few subfactorials:
• !1=0 — with one item, the only permutation leaves it in place • !2=1 — the swap • !3=2 • !4=9 • !5=44 • !6=265
Example
In the hat-check problem with 4 guests, the number of orderings in which no guest receives their own hat is
!4=4!k=0∑4k!(−1)k=24(1−1+21−61+241)=9.
Out of the 4!=24 possible orderings of the four hats, exactly 9 satisfy the no-fixed-point condition.
Pitfall: Subtracting only the single fixed points
Taking 24−4⋅3!=0 for the 4 hats removes every order that returns two or more hats several times. Adding back pairs and subtracting triples gives 24−24+12−4+1=9.
Behind the five terms of the sum are the counts of orders with chosen hats fixed. Fixing the hat of one chosen guest leaves 3!=6 orders, and there are 4 guests to choose. Fixing a chosen pair leaves 2!=2 orders for each of the (24)=6 pairs, a chosen three leaves 1 order for each of the 4 triples, and all four fixed is the single order that returns every hat. An order that returns two hats correctly is among the orders counted for each of those two guests.
The factorial calculator also computes the subfactorial !n, which counts derangements directly.
Three guests, three hats
Guests A, B and C each checked a hat, and the six rows are every order the hats can come back in. A red circle marks a guest who got their own hat back. Four orders return at least one hat correctly; only B C A and C A B leave every guest holding someone else’s hat — the two derangements, so !3 = 2. The alternating sum under the table is the formula for n = 3: start from all 3! orders and correct for the ones that fix a place.
Both derangements are rotations: in B C A every hat moves one seat one way, in C A B one seat the other way.
Beyond a handful of items, the share of orders that move every item settles near 1 in e, about 37%.
Common Pitfalls
Five mistakes come up again and again when counting permutations. Each is marked where it happens in the sections above; here each is worked through in full, with the wrong and the right working side by side.
Missing a repeated letter
In a word with several repeated letters, the factorial of one group or of two groups goes into the denominator and another group is left out. Every arrangement is then counted once for each order of the letters in the missing group.
Wrong working: MISSISSIPPI has 11 letters with four Is, four Ss and two Ps, and the count is given as 4!⋅4!11!=57639,916,800=69,300.
Right working: every repeated group gets its factorial: 1!⋅4!⋅4!⋅2!11!=115239,916,800=34,650.
Why it happens: the large groups catch the eye, and a group of two looks too small to matter. Yet a group of two halves the count.
How to check: list the letters with their counts before writing the formula, and make sure the counts add up to n: here 1+4+4+2=11. Each count in that list must appear as a factorial in the denominator.
Dividing by r! when order matters
The places in the arrangement are different, but the count is done with the binomial coefficient (rn), which treats the chosen items as a group with no order.
Wrong working: gold, silver and bronze among 10 runners: (310)=120.
Right working: the medals are different, so the order of the three winners matters: P(10,3)=10⋅9⋅8=720. This is 120⋅3!=720: each group of three winners can receive the medals in 6 orders.
Why it happens: "choose 3 of 10" sounds like a selection, and the binomial coefficient is the more familiar formula. The words gold, silver and bronze are what make the places different.
How to check: swap two of the winners and ask whether the result changes. If gold and silver swapped gives a different outcome, order matters and P(n,r) is the count.
Swapping the base and the exponent
In a count with repetition, the number of positions is used as the base and the number of options as the exponent.
Wrong working: a 4-digit PIN from the digits 0 to 9 is counted as 410=1,048,576.
Right working: there are 4 positions and each can hold any of 10 digits, so the count is 10⋅10⋅10⋅10=104=10,000.
Why it happens: nr is remembered as a pattern of two numbers, without the product of choices behind it.
How to check: write the count as a product of choices, one factor for each position. The number of factors is the exponent and each factor is the base. For a 4-digit PIN the codes 0000 to 9999 give exactly 10,000.
Using n! for a round table
Seats around a round table are treated like places in a row, so the count is n!. A row has a first place; a round table does not, and turning the whole table gives the same seating.
Wrong working: 5 people around a round table: 5!=120 seatings.
Right working: each seating appears 5 times among the 120 rows, once for each person who could sit in the first place of the row. So the count is 55!=4!=24. Equivalently, fix one person and arrange the other 4: 4!=24.
Why it happens: the people are distinct and order matters, which is exactly the description of a full permutation. The extra condition that turns count as the same arrangement is easy to overlook.
How to check: take n=3. Three people around a table have only 2 seatings: the order clockwise is either A, B, C or A, C, B. The formula (3−1)!=2 agrees, while 3!=6 does not.
Subtracting only the single fixed points
When counting derangements, the orders that return at least one hat are counted as n⋅(n−1)! and subtracted once. Orders that return two or more hats are inside several of these counts, so they are subtracted more than once.
Wrong working: for 4 guests, 4!−4⋅3!=24−24=0 derangements.
Right working: continue the alternating sum: 24−(14)3!+(24)2!−(34)1!+(44)0!=24−24+12−4+1=9.
Why it happens: "subtract the orders where someone gets their own hat" sounds like one subtraction, and n⋅(n−1)! looks like the number of such orders. It is not: it counts the identity order 4 times, once for each guest.
How to check: the answer 0 is impossible for n≥2, since moving every hat one seat along is always a derangement. For small n the small values listed above give a direct check: !3=2 and !4=9.
Permutations FAQ
What is a permutation?
+
An arrangement of items where the order counts. Listing three books on a shelf in a different sequence produces a different permutation, even though the same books are involved. This is the defining contrast with selections, where rearranging the chosen items changes nothing about the result.Read more →
What is the difference between permutations with and without repetition?
+
Without repetition each item can be used once, so the pool shrinks with every position filled and the count is a descending product. With repetition the full pool is available every time, so the count is one number raised to the power of the number of positions. A PIN allows repeats; seating people does not. Compare both on the permutation calculator.Read more →
How do you count arrangements when some items are identical?
+
Count as if every item were distinct, then divide by the factorial of each repeated group's size. The division removes the rearrangements among identical items, which produce no visibly different result. Arranging the letters of a word with repeated letters is the standard case where this correction is needed.Read more →
Why do you divide by n when counting circular permutations?
+
Because rotating the whole arrangement produces the same circular seating. Every distinct circle corresponds to n straight-line arrangements, one for each starting position, so the linear count overcounts by exactly that factor. Fixing one person in place and arranging the rest gives the same answer more directly.Read more →
What is the difference between nPr and n factorial?
+
Factorial arranges every item, while nPr arranges only r of them chosen from n. Factorial is the special case where r equals n, so all positions are filled. Reading nPr as a factorial of something is a common slip; it is a descending product that stops after r terms rather than continuing to one.Read more →
What does an exclamation mark before a number mean?
+
It is the subfactorial: !n counts the derangements of n items, the orders that leave no item in its original place. Older texts write it Dn. The position of the mark is the whole difference, since !4=9 while 4!=24: of the 24 orders of four items, only 9 move every item.Read more →
Is a combination lock really a combination?
+
No, its codes are permutations with repetition. A lock set to 4-7-2 does not open at 2-7-4, so order matters, and two dials may show the same digit. Three dials with the digits 0 to 9 therefore give 103=1000 codes. A true combination of three different digits, where only the set of digits counts, would leave just (310)=120.Read more →
How accurate is Stirling's formula?
+
Very, even for small n. Stirling's formula n!≈2πn(en)n gives about 3,598,696 for n=10, less than 1% below 10!=3,628,800. It comes out slightly low, with a relative error close to 12n1, so the error keeps shrinking: about 1.7% at n=5 and 0.4% at n=20.Read more →
What is the chance that nobody gets their own hat back?
+
About 37%, close to e1, for any group beyond a handful. The share of orders with no fixed point is n!!n: 249=0.375 for 4 guests and 12044≈0.367 for 5, already near e1≈0.3679. So the chance that at least one guest gets their own hat settles near 63%, almost whatever the number of guests.Read more →