Press ▶ Play to build all (n−1)! circular arrangements, or Step ▶ to advance one ball at a time. The first item is anchored at the top so rotations aren't counted twice.
● BallsA Letters
n =3?
Speed
Circular permutations
3! / 3 = (3−1)! = 2 × 1 = 2
Arrange n items around a circle, where rotations of an arrangement are considered the same. Anchoring one item at a reference position breaks the rotational symmetry; the other n−1 can then be freely permuted.
1Anchor: Red0 / 2
Red is fixed at the top of the ring to anchor the arrangement against rotation. The remaining 2 items (Blue and Green) can be arranged in the other 2 positions in (3−1)! = 2 distinct ways. If we did not fix one item, every arrangement would be counted 3 times — once per rotation — so we divide 3! by 3.
Circular permutation — an arrangement of n distinct items around a circle where arrangements that differ only by rotation are considered identical.
Anchor — the item fixed at a reference position to break the rotational symmetry. Once anchored, the other items are arranged relative to it.
Rotational symmetry — the property that rotating a circular arrangement by any number of positions produces an arrangement that should be counted as the same one.
(n-1)! formula — the count of distinct circular permutations of n distinct items, equal to n! divided by the n rotations of each arrangement.
Linear permutation — for comparison: an arrangement of n items in a line, counted by n!. The circular case factors out the n rotations, giving n!/n=(n−1)!.
Reference position — the slot on the circle where the anchor is placed. In this tool, the top of the build ring.
Getting Started
The tool opens with n=3 items ready to build. The scene is split into three areas:
• A source row at the top showing the available items.
• A build ring in the middle with n slots arranged around a circle. The top slot is labeled FIXED and already holds the anchor.
• A completed grid below, where every finished circular arrangement is recorded as a mini circle card.
To run it:
• Press ▶ Play to build all (n−1)! arrangements automatically.
• 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 badge in the top right shows the formula (n−1)! for the current n and the running count k/(n−1)! so progress against the total is always visible.
The Anchor
The tool's central pedagogical move is the anchor: the first item is fixed at the top slot of the build ring throughout every arrangement. This is what makes the count (n−1)! instead of n!.
Without anchoring, every circular arrangement would be counted n times — once for each rotation that brings a different item to the top. Anchoring eliminates that redundancy: by pinning one item, only one representative of each rotation class ever appears.
The visual shows this directly:
• The top slot has a solid border and a FIXED label above it.
• The other slots have dashed borders and are numbered #2,#3,…,#n clockwise around the ring.
• Only the dashed slots get filled by the animation. The anchor never moves.
• In the source row, the anchor item stays dimmed throughout — it's out of play because it's already placed.
Adjusting n
The n stepper in the control bar sets the number of items. The visual layout supports:
• n = 3 — produces (3−1)!=2 arrangements. The minimum interesting case: with one anchor, only two items vary.
• n = 4 — produces (4−1)!=6 arrangements. Three items rotate around the anchor.
• n = 5 — produces (5−1)!=24 arrangements. Mini cards shrink to fit a 6-column grid.
Changing n resets the build state: the build ring repopulates with new slots, the source row updates, the completed grid empties, and the formula in the top-right corner refreshes.
The counts grow quickly — by n=5 you're already at 24 distinct circular arrangements, which is why the visual caps there. For larger n, use a calculator: (6−1)!=120, (7−1)!=720, (10−1)!=362,880.
The Build Ring
The build ring is the live workspace where one arrangement at a time is constructed:
• The top slot (slot #1) is the anchor. Always filled with the first item, never modified.
• The other slots are numbered #2 through #n going clockwise. They fill in order as the animation runs.
• When a ball is in flight from the source row to a slot, a dotted guide line traces the path in the ball's own color, so you can track which item is moving where.
• In the source row above, an item that's already been placed in the current arrangement (or is the anchor) is dimmed. Only available items appear in full opacity.
• When all slots are filled, a flash ring briefly pulses around the build area. The completed arrangement is then copied to the grid below and the ring resets for the next one.
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 an arrangement or pausing mid-build.
• Step ▶ (Step forward) — advances one ball into one slot. Stop after each step to read off the partial arrangement.
• ▶ Play / ⏸ Pause — runs the animation continuously until all (n−1)! arrangements are built, then auto-pauses.
• ↺ Reset — clears the completed grid 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 source to its assigned slot and watch the dotted guide line in detail.
Mode Switch
The Mode switch at the start of the control bar toggles how items are rendered:
• Balls mode (default) — items appear as colored circles. Better for seeing positional structure at a glance and for tracking which item went where in the completed grid.
• Letters mode — items appear with letter labels. Better for reading off the actual sequence in each arrangement and matching it to algebraic notation like (A,B,C,D).
The encoding is consistent across the source row, the build ring, the flying ball, and every mini card in the completed grid. The anchor keeps its identity across modes — it's always the first item, always at the top of every ring.
The narration panel on the right also adapts to the current mode, so prose references match the visual.
The Completed Grid
Below the build ring, the completed section catalogs every arrangement the tool has produced. Each entry is a mini circle card showing:
• The anchor at the top of its own small ring.
• The other n−1 items in their assigned positions for that arrangement.
The grid layout adapts to n:
• n = 3: 2 cards in 2 columns.
• n = 4: 6 cards in 3 columns.
• n = 5: 24 cards in 6 columns.
Card size shrinks as the count grows so the whole catalog fits within the scene. A counter above the grid shows the running tally k/(n−1)!. When all arrangements complete, the counter reaches the total and the animation auto-pauses, leaving every distinct circular permutation visible side by side.
What Is a Circular Permutation
A circular permutation is an arrangement of n distinct items around a circle, with the convention that two arrangements are the same if one is a rotation of the other. The count of distinct circular permutations is:
Pcirc(n)=(n−1)!
The classic setting is a round table with n guests. If you labeled the seats 1 through n and counted arrangements, you would get n! — but a round table doesn't have labeled seats. Spinning the table doesn't change who is next to whom, which is the only structural information a circular arrangement carries.
The formula applies to any cyclic arrangement where positions matter only relative to each other: people around a campfire, keys on a circular keyring, beads on a closed loop, or steps in a periodic schedule.
For deeper coverage, see the circular permutation section on the permutations theory page.
Why (n-1)! Instead of n!
Two equivalent derivations of (n−1)!.
By symmetry. Start with all n! linear arrangements. Wrap each one into a circle by joining the ends. Every distinct circular arrangement corresponds to exactly n different linear ones — you can read the same circle starting from any of the n positions. So divide:
nn!=(n−1)!
By anchoring. Fix one item at a reference position. The remaining n−1 items occupy the other n−1 positions, in any order. That's a linear permutation of n−1 items, which is (n−1)!. No double counting, because the anchor uniquely identifies each rotation class.
The tool uses the anchoring approach because it produces unique arrangements directly. You never have to build n! candidates and then collapse n-fold redundancy — every arrangement on screen is already a distinct circular permutation.
Related Concepts
Full permutation — the linear case, n! arrangements. The circular formula divides out the n rotations of each linear one.
Permutation with identical items — when some of the n items are indistinguishable. Reduces the count by the factorial of each repeat group's size.
Partial permutation without repetition — pick and arrange only r items from a set of n. Formula (n−r)!n!.
Combinations — selecting items where order doesn't matter. The companion concept to permutations.
Necklace and bracelet counting — generalizations where reflections (flips) are also factored out alongside rotations. The bracelet count for n≥3 is (n−1)!/2.
Cyclic groups — the algebraic structure behind rotational symmetry. The group of rotations of a circle with n marked positions is Z/nZ.
Combinatorics calculator — to compute (n−1)! for arbitrary n values beyond the visual cap, see the circular permutation calculator.