Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Permutations with Identical Items


Press ▶ Play to build all n! / (k₁!·k₂!·…) distinct arrangements of the chosen multiset, or Step ▶ to advance one ball at a time. Cycle the multiset to try different duplicate patterns.
● BallsA Letters
multiset =AAB?
Speed
3!/(2! · 1!) = 3Press Play or Step to beginSOURCE — MULTISET AAB (n = 3)112BUILD AREA#1#2#3
Permutations with identical items
3! / (2! · 1!) = 3
Arrange a multiset of n items where some are identical. Swapping two copies of the same item doesn't produce a new arrangement, so we divide the total n! by k! for each group of identical copies.





Key Terms



Key Terms

Multiset — a collection of items where some may be identical. Unlike a set, a multiset records how many copies of each item are present. In this tool the multiset is encoded as a string like *AABBC*.

Permutation with identical items — a distinct arrangement of a multiset in a line. Swapping two identical copies does not produce a new permutation. The count is n!/(k1!k2!)n! / (k_1! \cdot k_2! \cdots) where each kik_i is the size of an identical group.

Multinomial coefficient — the formula (nk1,k2,)=n!/(k1!k2!)\binom{n}{k_1, k_2, \dots} = n! / (k_1! \cdot k_2! \cdots). The generalization of the binomial coefficient to more than two groups.

Distinct first item — a unique item value in the multiset. The completed section groups arrangements by which distinct item appears in position #1\#1, so there is one group per distinct item, not one per source position.

Positional dimming — the source row shows every copy in its own position. When a copy is used in the current build, only that position dims — the other copies of the same item stay fully visible.

Group size — the number of distinct arrangements in a first-item group. With kik_i copies of the chosen first item, that count is (n1)!/((ki1)!jikj!)(n - 1)! / ((k_i - 1)! \cdot \prod_{j \neq i} k_j!), which varies between groups.

Getting Started

The tool opens with multiset *AAB* selected: two copies of AA and one copy of BB. The scene splits into three areas:

• A source row at the top showing the multiset as separate balls, including duplicates side by side.

• A build area in the middle with nn slots, where nn is the total size of the multiset (counting duplicates).

• A completed section below, where every finished distinct permutation is filed under the row matching its first item.

To run the visualization:

• Press ▶ Play to auto-build all distinct permutations of the current multiset.

• Press Step ▶ to advance one ball at a time.

• Press to step backward through the animation.

• Adjust the Speed slider to control how fast play advances.

The header shows the formula n!/(k1!k2!)=totaln! / (k_1! \cdot k_2! \cdots) = \text{total} together with a live status line like *Group A: kk / size* while building.

The Build Area

The build area is where one distinct permutation at a time is constructed. The label above the area simply reads *BUILD AREA*; the slot count equals the size of the chosen multiset.

What to watch:

Empty slot outlines with dashed borders, labeled #1,#2,,#n\#1, \#2, \dots, \#n from left to right.

• When a ball is in flight from the source row to a slot, a dotted guide line traces the trajectory in the color of the item being moved.

• Each ball lands in its assigned slot and stays put until the permutation completes.

• In the source row, only the specific copy being used dims — not every copy of that item. So when one of the two AA balls flies into a slot, the other AA stays bright. This is the visual signature of positional dimming.

• When all nn slots are filled, a flash ring briefly pulses around the build area, and the completed arrangement is filed in the appropriate first-item row below.

The Multiset Stepper

Instead of an nn stepper, this tool has a multiset stepper that cycles through six curated presets, increasing in complexity:

AAB — two of AA, one of BB. 3!/(2!1!)=33! / (2! \cdot 1!) = 3 distinct permutations.

AAAB — three of AA, one of BB. 4!/(3!1!)=44! / (3! \cdot 1!) = 4 permutations.

AABB — two each of AA and BB. 4!/(2!2!)=64! / (2! \cdot 2!) = 6 permutations.

AABC — two of AA, one each of BB and CC. 4!/(2!1!1!)=124! / (2! \cdot 1! \cdot 1!) = 12 permutations.

AAABB — three of AA, two of BB. 5!/(3!2!)=105! / (3! \cdot 2!) = 10 permutations.

AABBC — two each of AA and BB, one of CC. 5!/(2!2!1!)=305! / (2! \cdot 2! \cdot 1!) = 30 permutations.

Use the and buttons next to *multiset =* to cycle. Each preset resets the build, refreshes the formula in the header, and rebuilds the completed section into the new set of first-item rows.

Grouping by Distinct First Item

The completed section organizes permutations into distinct first-item groups — one row per distinct value in the multiset, not one per source position. So *AAB* has two groups (AA and BB), not three.

Group sizes vary because the remaining multiset depends on which item was used first. For example with *AABB*:

• Starting with AA: remaining multiset is ABBABB, giving 3!/(1!2!)=33! / (1! \cdot 2!) = 3 arrangements.

• Starting with BB: remaining multiset is AABAAB, also giving 3!/(2!1!)=33! / (2! \cdot 1!) = 3 arrangements.

For *AABC*:

• Starting with AA: remaining is ABCABC (no repeats), giving 3!=63! = 6 arrangements.

• Starting with BB: remaining is AACAAC, giving 3!/2!=33! / 2! = 3.

• Starting with CC: remaining is AABAAB, giving 3!/2!=33! / 2! = 3.

This is why each row in the completed area has its own height — the tool computes a separate row size per group to keep proportions clean. The total across all groups always equals the multinomial coefficient n!/(k1!k2!)n! / (k_1! \cdot k_2! \cdots).

Transport Controls

The control bar offers four transport buttons plus a speed slider:

(Step back) — walks the animation one step backward. Useful for re-examining a single arrangement or pausing mid-build.

Step ▶ (Step forward) — advances one ball into one slot. Stop after each step to read the partial arrangement.

▶ Play / ⏸ Pause — runs the animation continuously until all distinct permutations are built, then auto-pauses.

↺ Reset — clears the completed section and starts over from the first arrangement.

The Speed slider controls how fast play advances. At higher speeds the fly and land timings shrink proportionally; at slower speeds you can clearly see each ball travel from its source position to the assigned slot.

Mode Switch

The Mode switch at the start of the control bar toggles how each item is rendered:

Balls mode (default) — items appear as colored circles. Identical copies share the same color, so the multiset *AABB* shows two circles of one color and two of another. The first-item avatar in each completed group is a circle with the item's number.

Letters mode — items appear with letter labels (A, B, C, …). The multiset display becomes literal — *AABB* shows as A,A,B,BA, A, B, B in the source row. The first-item avatar in each completed group is just the letter, colored to match.

The encoding is consistent across the source row, the build slots, the flying ball, every mini permutation card in the completed grid, and the right-panel narration. Letters mode is especially useful for this scenario because the multiset names themselves are letter strings.

Right Panel and Progress

The right panel narrates the build as it unfolds, anchored by the header *Permutations with identical items* and the full multinomial formula for the current multiset.

A StepRow is added for each distinct first-item group as soon as a permutation in that group starts or completes. Each StepRow shows:

• The first item as a chip plus its name — for instance, *First item: A*.

• A progress counter like k/group sizek / \text{group size} tracking how many distinct permutations in this group have completed.

• A short narration of the structure: *Position 1 is locked to A. The remaining positions hold 1 A, 2 Bs, and 1 C, arranged in 4!/(1!2!1!)=124! / (1! \cdot 2! \cdot 1!) = 12 distinct ways.* The formula uses the leftover multiplicities after one copy of the first item is removed.

When all groups complete, every StepRow shows *done* with a checkmark, and the counter reaches *total / total*.

What Is a Permutation with Identical Items

A permutation with identical items is a distinct arrangement of a multiset — a collection of nn items where some are repeated. Two arrangements count as the same if they only differ by swapping copies of the same item. The number of distinct arrangements is:

n!k1!k2!km!\frac{n!}{k_1! \cdot k_2! \cdots k_m!}


where kik_i is the number of copies of the iith distinct item and k1+k2++km=nk_1 + k_2 + \dots + k_m = n. This is the multinomial coefficient (nk1,k2,,km)\binom{n}{k_1, k_2, \dots, k_m}.

Examples:

• Distinct arrangements of the letters in *MISSISSIPPI* (11 letters: 1 M, 4 I, 4 S, 2 P): 11!/(1!4!4!2!)=34,65011! / (1! \cdot 4! \cdot 4! \cdot 2!) = 34{,}650.

• Distinct arrangements of the word *DATA* (4 letters with 2 A): 4!/2!=124! / 2! = 12.

• Lining up 8 students where 3 wear identical red shirts and 5 wear identical blue shirts: 8!/(3!5!)=568! / (3! \cdot 5!) = 56 distinguishable lineups.

For deeper coverage, see the permutation with identical items section on the permutations theory page.

Why Divide by k!

Start with the multiset treated as if every item were distinct — say by tagging copies A1,A2A_1, A_2 and B1,B2B_1, B_2 for *AABB*. There are n!=4!=24n! = 4! = 24 full permutations of the tagged set.

But the tags are fake. When we remove them and look at the actual multiset, many of those 2424 permutations collapse into the same arrangement:

• The two AA copies can swap in 2!=22! = 2 ways without changing what we see.

• The two BB copies can swap in 2!=22! = 2 ways without changing what we see.

• Together, 2!2!=42! \cdot 2! = 4 tagged permutations map to each distinct untagged arrangement.

So the distinct count is 24/4=624 / 4 = 6, matching the formula 4!/(2!2!)4! / (2! \cdot 2!).

Generalizing: for each identical group of size kik_i, exactly ki!k_i! tagged permutations collapse into one untagged arrangement. Dividing n!n! by the product of all such ki!k_i! removes every layer of redundancy:

distinct count=n!k1!k2!km!\text{distinct count} = \frac{n!}{k_1! \cdot k_2! \cdots k_m!}

Related Concepts

Full permutation — the case where every item is distinct, so all ki=1k_i = 1. The formula reduces to n!n! because every factorial in the denominator is 11.

Partial permutation without repetition — pick and arrange only rr items from a distinct set of nn. Formula n!/(nr)!n! / (n - r)!.

Permutation with repetition — items can be reused, but a fixed pool of nn distinct options is used for rr positions. Formula nrn^r.

Circular permutation — arrange items around a circle where rotations are identical. Formula (n1)!(n - 1)!.

Multinomial coefficient — the direct algebraic name for n!/(k1!k2!)n! / (k_1! \cdot k_2! \cdots). Generalizes the binomial coefficient and appears in the multinomial theorem.

Binomial coefficient — the special case with exactly two groups: (nk)=n!/(k!(nk)!)\binom{n}{k} = n! / (k! \cdot (n - k)!). Counts arrangements of a multiset with two distinct items.

Combinatorics calculator — to compute n!/(k1!k2!)n! / (k_1! \cdot k_2! \cdots) for any multiset, see the multiset permutation calculator.