In short

When repetition is allowed, r positions from n types give n^r arrangements. When some objects are identical, the count of distinct arrangements of n objects (with groups of size p_1, p_2, \dots) is \frac{n!}{p_1!\, p_2!\, \cdots}. Circular permutations of n distinct objects number (n-1)!, and necklaces (which can be flipped) halve that to \frac{(n-1)!}{2}.

A lock on a gym locker has 4 dials, and each dial can be set to any digit from 0 to 9. How many 4-digit codes are possible?

If you reach for the permutation formula {}^{10}P_4 = 10 \times 9 \times 8 \times 7 = 5{,}040, you will undercount badly. The code 7777 is valid — all four dials can show the same digit — but {}^{10}P_4 forbids reuse. Each dial operates independently, with 10 choices regardless of what the other dials show. By the multiplication principle:

10 \times 10 \times 10 \times 10 = 10^4 = 10{,}000

The lock has 10{,}000 possible codes, nearly double the 5{,}040 from the no-repetition formula. The difference comes from a single word in the problem: repetition allowed. This article covers four situations where the standard {}^nP_r = n!/(n-r)! needs modification — permutations with repetition, permutations of objects not all different, circular permutations, and necklace (garland) problems.

Permutations with repetition

When repetition is allowed — meaning each object can be used as many times as you like — the counting argument changes in a fundamental way. The choices at each position do not shrink. Position 1 has n options; position 2 also has n options (the same pool, since objects are not "used up"); position 3 also has n options; and so on through position r.

Permutations with repetition

The number of ordered arrangements of r positions, where each position can be filled by any of n types (repetition allowed), is:

n^r

The formula is the multiplication principle in its simplest form: r independent choices, each with n options.

Four dials each with 10 choicesFour boxes in a row, each labelled with 10 choices. Below, the total is shown as 10 to the power 4 equals 10000. Unlike the no-repetition case, the choices do not decrease from one position to the next. dial 1 dial 2 dial 3 dial 4 10 10 10 10 choices choices choices choices 10⁴ = 10,000 codes
With repetition allowed, every dial has $10$ choices regardless of what the other dials show. The total is $10^4 = 10{,}000$, not ${}^{10}P_4 = 5{,}040$.

Contrast with the no-repetition formula. When repetition is forbidden, the choices shrink: n, n-1, n-2, \dots, n-r+1, giving {}^nP_r = n!/(n-r)!. When repetition is allowed, the choices stay flat at n, n, n, \dots, n, giving n^r. The no-repetition count is always \leq the repetition count (for r \geq 2, it is strictly less).

Some more instances:

Permutations of objects not all different

Take the word MISSISSIPPI. It has 11 letters, but they are not all distinct: 1 M, 4 I's, 4 S's, 2 P's. If all 11 letters were different, the number of arrangements would be 11!. But swapping two identical S's does not produce a new word — MISSISSIPPI looks the same. The formula 11! overcounts.

The fix is clean. Among the 11! arrangements, every distinct word has been counted multiple times — once for each way you can rearrange the identical letters among themselves without changing the word. The 4 I's can be rearranged in 4! ways, the 4 S's in 4! ways, the 2 P's in 2! ways, and the 1 M in 1! way. Each rearrangement of identical letters produces the same word. So the number of distinct arrangements is:

\frac{11!}{1!\cdot 4!\cdot 4!\cdot 2!} = \frac{39{,}916{,}800}{1 \cdot 24 \cdot 24 \cdot 2} = \frac{39{,}916{,}800}{1{,}152} = 34{,}650

Permutations of objects not all different

Given n objects where p_1 are of type 1, p_2 are of type 2, \dots, p_k are of type k (with p_1 + p_2 + \dots + p_k = n), the number of distinct arrangements is:

\frac{n!}{p_1!\, p_2!\, \cdots\, p_k!}

Why the formula works. Start by imagining all n objects are distinguishable (paint different shades on identical letters). The total arrangements would be n!. Now erase the paint — identical objects become indistinguishable. Each distinct arrangement of the "painted" objects maps to one of the "unpainted" arrangements, and exactly p_1! \cdot p_2! \cdots p_k! painted arrangements map to each unpainted one (because the identical items in each group can be permuted among themselves in p_i! ways). So the distinct count is n! divided by the product of all those factorials.

Overcounting when letters repeat: the word AABTop row shows all 3 factorial equals 6 arrangements of A1 A2 B, treating the two A's as different. Bottom row shows how pairs collapse into 3 distinct arrangements when the A's are identical: AAB, ABA, BAA. The factor of 2 factorial equals 2 connects the two rows. Pretend the two A's are different: A₁, A₂, B A₁ A₂ B A₂ A₁ B A₁ B A₂ A₂ B A₁ B A₁ A₂ B A₂ A₁ 3! = 6 "painted" arrangements Erase paint — identical A's merge A A B A B A B A A 3!/2! = 3 distinct arrangements each distinct word ← 2! = 2 painted versions
With $3$ objects where $2$ are identical (A, A, B), the "painted" count $3! = 6$ overcounts by a factor of $2! = 2$. Dividing gives $3!/2! = 3$ distinct words: AAB, ABA, BAA.

This formula is sometimes called the multinomial coefficient and written \binom{n}{p_1, p_2, \dots, p_k}. It appears in the multinomial theorem, which generalises the binomial theorem.

Circular permutations

Seat 4 friends — Anil, Bina, Charu, Devi — around a round table for dinner. In a row, there would be 4! = 24 arrangements. But a round table has no "first chair." If everyone shifts one seat clockwise, the relative arrangement is unchanged — Bina is still to Anil's right, Charu is still across from Anil, and so on.

Four linear arrangements that become the same circular arrangementFour rows show the linear arrangements ABCD, BCDA, CDAB, DABC. An arrow points from all four to a single circle with A B C D around it, showing that rotations of a circular arrangement are identical. Linear arrangements Circular (all same) A B C D B C D A C D A B D A B C 4 rotations of the same seating A B C D (4−1)! = 3! = 6 circular arrangements
The four linear arrangements ABCD, BCDA, CDAB, DABC all represent the same circular seating — each is a rotation of the others. Every group of $n$ rotations collapses to $1$ circular arrangement, so the count drops from $n!$ to $n!/n = (n-1)!$.

How many of the 24 linear arrangements map to the same circular seating? Exactly 4 — the four rotations of the circle (shift by 0, 1, 2, or 3 seats). So the number of distinct circular arrangements is:

\frac{4!}{4} = \frac{24}{4} = 6

In general, for n distinct objects in a circle, every group of n rotated linear arrangements is the same circular arrangement. The count is:

Circular permutations

The number of ways to arrange n distinct objects in a circle is:

(n-1)!

An equivalent way to see it. Fix one person's seat (say Anil always sits in the "north" chair). Now the remaining 3 friends can be arranged in 3! = 6 ways in the remaining 3 chairs. Fixing one person eliminates the rotational symmetry, and the count is (n-1)! directly.

Fixing one person to break rotational symmetryA circle with four seats. Anil is fixed at the top, shown with a bold accent border. The remaining three seats are numbered 1, 2, 3, and the text shows 3 factorial equals 6 ways to fill them. A fixed ? 3 choices ? 2 choices ? 1 choice 3! = 6 circular arrangements
Fix Anil at the top. The $3$ remaining seats are filled by $3, 2, 1$ choices respectively — giving $3! = 6$ circular arrangements of $4$ people. This "fix one, permute the rest" method is the standard approach to circular permutation problems.

When does circular permutation apply?

Use (n-1)! whenever the arrangement is on a circle and rotations are considered identical. Sitting around a round dining table, dancers in a ring, beads on a wire loop (where the loop cannot be flipped) — all of these are circular permutation problems.

If the circle has a distinguished point (a head of the table, a starting gate), rotations are not identical, and you revert to n!.

Necklace and garland problems

A necklace (or a garland of flowers) can be flipped — turned over so that clockwise becomes anticlockwise. This introduces a second symmetry beyond rotation.

Consider 5 differently coloured beads on a necklace. As a circular arrangement, the count would be (5-1)! = 4! = 24. But a necklace can be flipped (picked up and turned over), and the flipped version is considered the same necklace. Each circular arrangement pairs with its mirror image. So the number of distinct necklaces is:

\frac{(5-1)!}{2} = \frac{24}{2} = 12
A necklace and its mirror image are the sameTwo circles, each with 5 coloured beads labelled A through E. The left circle has beads in clockwise order A B C D E. The right circle has them in anticlockwise order A E D C B. A double-headed arrow labelled flip connects them, and text below says these count as one necklace. A B C D E clockwise: ABCDE flip A E D C B anticlockwise: AEDCB same necklace → count once
The clockwise arrangement ABCDE and the anticlockwise arrangement AEDCB are the same necklace — you get one from the other by flipping. Each such pair is counted once, so the necklace count is half the circular count.

Necklace permutations

The number of distinct necklaces (or garlands) formed by n distinct beads is:

\frac{(n-1)!}{2} \qquad (n \geq 3)

Why divide by 2? A circular arrangement and its mirror image are the same necklace. Since every circular arrangement has exactly one distinct mirror (which is different from itself when n \geq 3), the circular arrangements pair up, and the necklace count is (n-1)!/2.

The n = 2 edge case. With 2 beads on a necklace, there is only 1 arrangement (the two beads are just neighbours, and flipping changes nothing). The formula gives (2-1)!/2 = 1/2, which is not an integer — so it does not apply for n = 2. In practice, necklace problems with n \geq 3 are the ones that appear in exams.

When to use which formula: If the arrangement can be rotated but not flipped (people at a round table — you cannot pick up the table and flip it), use (n-1)!. If the arrangement can be both rotated and flipped (beads on a string, flowers on a garland), use (n-1)!/2.

Summary of four permutation formulasA table with four rows. Row 1: r positions from n types with repetition gives n to the r. Row 2: n objects not all different gives n factorial over product of p i factorial. Row 3: circular permutations gives n minus 1 factorial. Row 4: necklace gives n minus 1 factorial over 2. Situation Formula r positions, n types, repetition allowed n objects, groups of p₁, p₂, … identical n! / (p₁!p₂!⋯) n distinct objects in a circle (n−1)! n distinct beads on a necklace (n−1)! / 2
The four special-case formulas at a glance. Each modifies the basic $n!$ or ${}^nP_r$ by accounting for a specific type of "sameness" — repeated use, identical objects, rotational equivalence, or reflective equivalence.

Two worked examples

Example 1: How many distinct arrangements of the letters of BANANA are there?

The word BANANA has 6 letters: B (1), A (3), N (2). This is a "not all different" problem.

Step 1. Identify the letter counts.

n = 6 total letters. The groups are: B appears 1 time, A appears 3 times, N appears 2 times. Check: 1 + 3 + 2 = 6.

Why: you need to know how many objects are of each type before applying the formula. The sum of all group sizes must equal n.

Step 2. Apply the formula.

\frac{6!}{1!\cdot 3!\cdot 2!} = \frac{720}{1 \cdot 6 \cdot 2} = \frac{720}{12} = 60

Why: 6! = 720 counts the arrangements as if all letters were distinct. Dividing by 3! removes overcounting from the 3 identical A's, dividing by 2! removes overcounting from the 2 identical N's, and dividing by 1! (which is 1) does nothing for the single B.

Step 3. Sanity check with a smaller example.

Take the word ANA (3 letters: A appears 2 times, N appears 1 time). The formula gives 3!/(2!\cdot 1!) = 6/2 = 3. Listing: AAN, ANA, NAA. That matches.

Why: checking with small cases builds confidence that the overcounting division is correct. Three distinct words from three letters with one repeat — the formula works.

Step 4. Interpret the result.

Out of the 720 "painted" arrangements (where each A is uniquely labelled), groups of 3! \times 2! = 12 map to the same word. So 720 / 12 = 60 distinct words.

Result. The letters of BANANA can be arranged in 60 distinct ways.

Letter frequencies of BANANA and the overcounting divisionSix boxes showing the letters B A N A N A. Below, the letters are grouped by type: 1 B, 3 A's, 2 N's. The formula 6 factorial over 1 factorial times 3 factorial times 2 factorial equals 60 is shown. B A N A N A B A N A N A B: 1 A: 3 N: 2 6! / (1! × 3! × 2!) = 720 / 12 = 60 distinct arrangements
BANANA has $6$ letters with $3$ A's, $2$ N's, and $1$ B. The overcounting factor is $3! \times 2! \times 1! = 12$, giving $6!/12 = 60$ distinct arrangements.

The number 60 is far smaller than 720 — the repeated letters collapse a large fraction of the arrangements into duplicates. If even one more letter were repeated (say BAAANA with 4 A's), the count would drop further to 6!/(4!\cdot 1!\cdot 1!) = 720/24 = 30.

Example 2: In how many ways can $6$ people be seated around a circular table? How many necklaces can be formed from $6$ distinct beads?

Step 1. Identify the problem type.

Six distinct people, circular arrangement. This is a circular permutation.

Why: a round table has no head — rotations of the same seating are identical. So you use (n-1)!, not n!.

Step 2. Compute the circular permutation count.

(6-1)! = 5! = 120

Why: fix one person (say Rahul) in a chair. The remaining 5 people can fill the remaining 5 chairs in 5! = 120 ways. Each of these 120 arrangements is a genuinely different seating — no two are rotations of each other.

Step 3. Compute the necklace count.

A necklace (or garland) can be flipped, so clockwise and anticlockwise versions are the same.

\frac{(6-1)!}{2} = \frac{120}{2} = 60

Why: each circular arrangement and its mirror image form a single necklace. Since every arrangement pairs with exactly one distinct mirror (for n \geq 3), the necklace count is half the circular count.

Step 4. Compare all three counts.

Linear arrangements: 6! = 720. Circular: (6-1)! = 120. Necklace: (6-1)!/2 = 60. Each successive symmetry (rotation, then reflection) halves or reduces the count.

Result. 120 circular seatings; 60 necklaces.

Comparing linear, circular, and necklace counts for 6 objectsThree columns. Left column shows a line of 6 boxes labelled 6 factorial equals 720. Middle column shows a circle of 6 dots labelled 5 factorial equals 120. Right column shows a circle with a flip arrow labelled 5 factorial over 2 equals 60. Arrows between columns show division by 6 and then by 2. Linear Circular Necklace 1 2 3 4 5 6 in a row flip ÷ 6 ÷ 2 6! = 720 5! = 120 5!/2 = 60 rotation removes a factor of n = 6 reflection removes another factor of 2
For $6$ objects: $720$ linear arrangements $\to$ $120$ circular arrangements (divide by $6$ rotations) $\to$ $60$ necklaces (divide by $2$ for reflection). Each symmetry reduces the count by a clean factor.

The pattern is consistent: linear count = n!, circular count = n!/n = (n-1)!, necklace count = (n-1)!/2. The "fix one and permute the rest" method gives the circular count directly; dividing by 2 gives the necklace count.

Common confusions

Going deeper

If you can apply the four formulas — n^r, n!/(p_1!\cdots p_k!), (n-1)!, and (n-1)!/2 — to standard problems, you have what you need for permutations with restrictions and combinations. The rest of this section is for readers curious about the group-theoretic framework behind these symmetry arguments.

Burnside's lemma and the orbit-counting theorem

The reason we divide n! by n for circular permutations (and by 2n for necklaces) is a special case of a general principle. A group of symmetries G acts on a set of arrangements. Two arrangements are "the same" if one can be transformed into the other by some symmetry in G. The number of distinct arrangements (called orbits) is given by Burnside's lemma:

\text{number of orbits} = \frac{1}{|G|}\sum_{g \in G} |X^g|

where |X^g| is the number of arrangements fixed by the symmetry g.

For circular permutations of n distinct objects, the symmetry group is the cyclic group of n rotations. Only the identity rotation fixes any arrangement (the others shift everything), so the sum is n! (from the identity alone), and dividing by |G| = n gives n!/n = (n-1)!.

For necklaces, the symmetry group is the dihedral group of n rotations and n reflections (total size 2n). The calculation is a bit more involved, but for distinct beads the result is (n-1)!/2 — matching the simple division.

Burnside's lemma generalises to cases where some beads share colours, where the formula becomes less obvious. The even more powerful Polya enumeration theorem handles such problems systematically — it appears in advanced combinatorics and competitive mathematics.

Multinomial coefficients and the multinomial theorem

The expression \frac{n!}{p_1! p_2! \cdots p_k!} appears in the multinomial theorem:

(x_1 + x_2 + \cdots + x_k)^n = \sum \frac{n!}{p_1! p_2! \cdots p_k!}\, x_1^{p_1} x_2^{p_2} \cdots x_k^{p_k}

where the sum runs over all non-negative integer solutions of p_1 + p_2 + \cdots + p_k = n. The connection to permutations is direct: each term in the expansion corresponds to a way of distributing n factors among k variables, and the coefficient counts the number of such distributions — which is the same as the number of distinct arrangements of n objects with p_i of type i.

When k = 2, this reduces to the binomial theorem, and the multinomial coefficient becomes the familiar \binom{n}{r} = \frac{n!}{r!(n-r)!}.

Where this leads next