Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Partial Permutations

How to use
  1. The Mode switch at the left of the control bar toggles between ● Balls (numbered coloured balls) and A Letters (letter labels). Learn more about the mode switch
  2. The n stepper (3 to 5) sets the source row and the r stepper (1 to n) sets the number of slots; lowering nn below rr pulls rr down with it, and either change resets the build. Learn more about adjusting n and r
  3. Set r equal to n to use every item and get n!n!, or set r to 1 for one card per item. Learn more about the r = n limit
  4. Step ▶ moves one ball into the next slot, ◀ Back undoes one step, ▶ Play builds every arrangement, ↺ Reset clears the completed list, and the Speed slider (0.3 to 3) sets the pace. Learn more about the transport controls
  5. The two lines at the top right of the scene show P(n,r)P(n, r) with its total and the status: the current step and its count, or Complete. Learn more about getting started
  6. In the build area only rr slots appear; each ball flies in along a dotted guide line, used items dim, and the unused ones stay bright. Learn more about the build area
  7. Finished arrangements land under COMPLETED, one tinted row per first item, each holding (n−1)!/(n−r)!(n-1)!/(n-r)! cards. Learn more about grouping by first item
  8. The right panel adds a row for each first-item group with its progress and a one-line narration of how the remaining slots are filled. Learn more about the right panel


Press ▶ Play to build all P(n, r) arrangements, or Step ▶ to advance one ball at a time. Switch balls / letters and adjust n and r.
● BallsA Letters
n =3?
r =2?
Speed
P(3, 2) = 6Press Play or Step to beginSOURCE (n = 3)123BUILD AREA (r = 2)#1#2
Building partial permutations
P(3, 2) = 3! / (3−2)! = 3 × 2 = 6
Choose and arrange r items out of n — order matters, no repetition. Each step builds the family of arrangements starting with one fixed first item; there are n such families, each containing (n−1)! / (n−r)! arrangements.
r dashed slots wait below the n source balls — the scenario: choose r of the n items and put them in order (at r = n it is a full permutation). Learn more about getting started · Adjusting n and r





Key Terms



Key Terms

Partial permutation — an ordered selection of rr items from a set of nn distinct items, with no item reused. The count is P(n,r)=n!/(n−r)!P(n, r) = n! / (n - r)!.

P(n,r)P(n, r) — standard notation for the number of partial permutations of size rr taken from nn items. Also written nPr_nP_r or PrnP^n_r.

Order matters — two selections with the same items in different positions count as different partial permutations. This is what distinguishes partial permutations from combinations.

Position — a slot in the arrangement, numbered #1\#1 through #r\#r from left to right in the build area.

First-item group — the family of partial permutations that share the same item in position #1\#1. There are nn such groups, each containing (n−1)!/(n−r)!(n - 1)! / (n - r)! partial permutations.

Source row — the set of nn available items shown at the top of the scene. Items already placed in the current build are dimmed.

Getting Started

The tool opens with n=3n = 3 and r=2r = 2, ready to build. The scene splits into three areas:

• A source row at the top showing all nn available items.

• A build area in the middle with exactly rr slots labeled #1\#1 through #r\#r.

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

To run the visualization:

• Press ▶ Play to auto-build all P(n,r)P(n, r) partial permutations.

• 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 in the top right shows P(n,r)=totalP(n, r) = \text{total} alongside a live status line such as *Step X (item name): kk / (n−1)!/(n−r)!(n-1)!/(n-r)!* while building, or *Complete · total / total* when done.
P(3, 2) = 6Press Play or Step to beginSOURCE (n = 3)123BUILD AREA (r = 2)#1#2
(n, r) = (3, 2), idle, frozen

Three source balls and only two slots: the build area is deliberately shorter than the source row — the defining picture of a partial permutation.

The frozen frame above is the opening position, and its geometry already states the problem: three balls in the source row, but only two dashed slots below. A partial permutation never intends to use everything — the mismatch between pool and positions is the point.

Every run therefore ends with someone left out. Which items are left out, and in what order the chosen ones stand, together determine the count — the build area shows the mechanics.

The Build Area

DemoTwo slots, one ball left out
Step 0 of 5
The build area is where one partial permutation at a time is constructed. Unlike a full permutation, only rr slots appear — not nn. The label above the area reads *BUILD AREA (r = R)* with the current rr.

What to watch:

• Empty slot outlines with dashed borders, labeled #1,#2,…,#r\#1, \#2, \dots, \#r. The label tells you the position number being filled.

• When a ball is in flight from the source row to a slot, a dotted guide line in that ball's color traces the trajectory.

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

• In the source row above, every item already placed in the current build (plus the one in flight) is dimmed to indicate it's out of play.

• When all rr slots are filled, a flash ring briefly pulses around the build area. The completed arrangement is then copied to the appropriate first-item row in the completed section below.
P(3, 2) = 6Step 2 (Blue): 0 / 2SOURCE (n = 3)123BUILD AREA (r = 2)#1#221COMPLETED2 / 6112132
(3, 2) mid-build, frozen

The third arrangement begins: B has claimed slot #1, A is dropping into #2 — while C stays bright, available but about to be left out.

The frozen frame above catches the third arrangement mid-build: B has claimed slot #1, A is dropping into #2 along its dotted guide, and both are dimmed above. Green C stays bright — available, but about to be left out of this particular pair.

The stop-after-r discipline is what separates this build from the full permutation's: when slot #2 fills, the arrangement is finished, with a bright ball still sitting unused in the source row. That permanent leftover is the (n−r)!(n - r)! that the formula divides away.

Adjusting n and r

Demon, r and the clamp
Step 0 of 5
Two steppers in the control bar control the size:

• n sets the size of the source set — the pool of available items.

• r sets the number of positions to fill. The constraint r≤nr \leq n is enforced; if you reduce nn below the current rr, the tool clamps rr down automatically.

Common combinations:

• n=3,r=2n = 3, r = 2: P(3,2)=6P(3, 2) = 6 partial permutations — the default configuration.

• n=4,r=2n = 4, r = 2: P(4,2)=12P(4, 2) = 12 partial permutations.

• n=4,r=3n = 4, r = 3: P(4,3)=24P(4, 3) = 24 partial permutations.

• n=5,r=3n = 5, r = 3: P(5,3)=60P(5, 3) = 60 partial permutations — the largest worked example on this page.

• n=5,r=5n = 5, r = 5: P(5,5)=120P(5, 5) = 120 — this is the full permutation case, where r=nr = n and the formula reduces to n!n!.

Changing either nn or rr resets the build, refreshes the formula in the header, and reorganizes the completed grid into the new number of first-item rows. Two boundary settings repay a visit of their own: r = n, where nothing is left out, and r = 1, where nothing is ordered.

Grouping by First Item

DemoRows by first item
Step 0 of 5
The completed section organizes partial permutations into first-item groups — every arrangement starting with the same item appears in the same row.

There are exactly nn groups (one per item in the source set), and each group holds exactly (n−1)!/(n−r)!(n - 1)! / (n - r)! partial permutations. So the total is:

n×(n−1)!(n−r)!=n!(n−r)!=P(n,r)n \times \frac{(n - 1)!}{(n - r)!} = \frac{n!}{(n - r)!} = P(n, r)


This is the visual proof of the partial permutation formula. Pick any item to put in position #1\#1: nn choices. For each choice, fill the remaining r−1r - 1 positions with r−1r - 1 items chosen in order from the remaining n−1n - 1 items: (n−1)!/(n−r)!(n - 1)! / (n - r)! ways. Multiply.

Each group row in the completed area has:

• A tinted background in a faint version of the group's color.

• A colored accent stripe on the left edge.

• A left-side avatar showing the first item — a colored circle with the item's number in balls mode, or the letter in letters mode.

• Mini partial-permutation cards, each one a full arrangement of rr items starting with that first item.
P(3, 2) = 6Complete · 6 / 6SOURCE (n = 3)123BUILD AREA (r = 2)#1#2COMPLETED6 / 6112132212333132
P(3, 2) complete, frozen

Six ordered pairs in three rows of two: each first choice leaves two ways to fill the one remaining slot — 3 × 2 = 6.

The frozen frame above is the default P(3,2)P(3, 2) completed: six ordered pairs in three rows of two. Read any row and the factoring appears — first slot fixed, one slot to fill, two candidates for it.

Two cards per row instead of the full permutation's (n−1)!(n-1)! is the visible effect of stopping early: the second slot exhausts the arrangement, so the deeper orderings of the leftover item never happen. Multiply rows by row size — 3×2=63 \times 2 = 6 — and you have P(3,2)P(3, 2) without touching a factorial.

When r = n: The Full Permutation Limit

Push rr all the way up to nn and the partial permutation stops being partial: every item from the source row is used, nothing is left out, and the tool momentarily becomes a full permutation visualizer.

The formula agrees gracefully. With r=nr = n the denominator is (n−n)!=0!(n - n)! = 0!, and by the convention 0!=10! = 1:

P(n,n)=n!0!=n!P(n, n) = \frac{n!}{0!} = n!


This is where the otherwise odd-looking convention earns its keep — without 0!=10! = 1, the boundary case would break a formula that works everywhere else.

Set n=4,r=4n = 4, r = 4 and run: 2424 cards fill four rows of six, exactly the 4!4! enumeration, built with the same fix-the-first-item structure.
P(4, 4) = 24Complete · 24 / 24SOURCE (n = 4)1234BUILD AREA (r = 4)#1#2#3#4COMPLETED24 / 241123412431324134214231432221342143231423412413243133124314232143241341234214412341324213423143124321
P(4, 4) complete, frozen

With r = n the build uses every item: 24 cards in four rows of six — the full permutation 4! recovered as a boundary case.

Boundary cases like this are how counting formulas are sanity-checked: a good formula degrades into a known one when its parameters hit their extremes. Here the extreme also explains the plateau noted under the derivation: P(5,4)=P(5,5)=120P(5, 4) = P(5, 5) = 120, because once only one item remains, its "placement" is forced — a last factor of 11 that changes nothing.

The opposite boundary tells the complementary story: see r = 1, where the arrangement collapses into a bare choice.

When r = 1: A Single Choice

Push rr down to 11 and the arrangement disappears: one slot, one landing, done. The count is as small as it gets:

P(n,1)=n!(n−1)!=nP(n, 1) = \frac{n!}{(n - 1)!} = n


Set n=4,r=1n = 4, r = 1 and run: four cards, one per item, each first-item group holding exactly one arrangement — a group structure where every family is a family of one.

With a single position, "order matters" has nothing to bite on. That is why P(n,1)P(n, 1) coincides with the combination count C(n,1)=nC(n, 1) = n: choosing one item and arranging one item are the same act.
P(4, 1) = 4Complete · 4 / 4SOURCE (n = 4)1234BUILD AREA (r = 1)#1COMPLETED4 / 411223344
P(4, 1) complete, frozen

One slot, four outcomes: with r = 1 each "arrangement" is just a choice, and every group row holds a single card.

The case is also the base of the recursion the whole tool enacts: P(n,r)=n⋅P(n−1,r−1)P(n, r) = n \cdot P(n - 1, r - 1), falling step by step until it lands on P(n−r+1,1)=n−r+1P(n - r + 1, 1) = n - r + 1 — the last factor of the multiplication chain.

The agreement between permutations and combinations at r=1r = 1 is worth remembering when the two are later divided: the gap between P(n,r)P(n, r) and C(n,r)C(n, r) is a factor of r!r!, which equals 11 here and grows with every extra slot — see the combination entry under related concepts.

Transport Controls

DemoSlow speed, Back, Reset
Step 0 of 5
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 partial permutation or pausing mid-build.

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

• ▶ Play / ⏸ Pause — runs the animation continuously until all P(n,r)P(n, r) partial 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 source to slot and follow the dotted guide line in detail.

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. The first-item avatar in each completed group is a circle with the item's number. Best for tracking position and group membership visually.

• Letters mode — items appear with letter labels (A, B, C, …). The first-item avatar in each completed group is just the letter, colored to match. Best for reading off the sequence in each partial permutation and matching it to algebraic notation like (A,C)(A, C) or (B,A,D)(B, A, D).

The encoding is consistent across the source row, the build slots, the flying ball, every mini card in the completed grid, and the right-panel narration. Switching modes mid-animation is safe — the build state preserves; only the rendering changes.

Right Panel and Progress

The right panel narrates the build as it unfolds, anchored by the header Building partial permutations with the full formula P(n,r)=n!/(n−r)!=n×(n−1)×⋯=totalP(n, r) = n! / (n - r)! = n \times (n - 1) \times \dots = \text{total}.

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

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

• A progress counter like k/((n−1)!/(n−r)!)k / ((n - 1)!/(n - r)!) tracking how many partial permutations in this group have completed.

• A short narration of the structure: *Position 1 is locked to A. The next r−1r - 1 positions are filled from B, C, D, or E in (n−1)×(n−2)×⋯=M(n - 1) \times (n - 2) \times \dots = M ways.* When r=1r = 1 the narration adjusts: with only one position, the outcome is just the first item alone.

When all groups complete, every StepRow shows done with a checkmark, and the header counter reaches total/total\text{total} / \text{total}.

What Is a Partial Permutation

A partial permutation is an ordered selection of rr items from a set of nn distinct items, with no item used twice. The count of such selections is:

P(n,r)=n!(n−r)!=n×(n−1)×⋯×(n−r+1)P(n, r) = \frac{n!}{(n - r)!} = n \times (n - 1) \times \dots \times (n - r + 1)


The formula collapses to n!n! when r = n — the full permutation. When r<nr < n, the multiplication stops after rr factors instead of continuing all the way down to 11.

Examples:

• Picking a 11st, 22nd, and 33rd place from 88 runners: P(8,3)=8×7×6=336P(8, 3) = 8 \times 7 \times 6 = 336 podiums.

• Choosing a president and a vice-president from 1010 candidates: P(10,2)=90P(10, 2) = 90 outcomes.

• Forming a 44-digit code from 1010 digits with no repeats: P(10,4)=5040P(10, 4) = 5040 codes.

The partial permutation is the right model whenever you need both which items and what order — and reuse is not allowed.

For deeper coverage of the formula and its derivation, see the partial permutation without repetition section on the permutations theory page.

Deriving P(n,r) Step by Step

Apply the multiplication principle of counting one position at a time:

• Position #1\#1: any of the nn items. nn choices.

• Position #2\#2: any of the remaining n−1n - 1 items. n−1n - 1 choices.

• Position #3\#3: any of the remaining n−2n - 2 items. n−2n - 2 choices.

• …\dots

• Position #r\#r: any of the remaining n−r+1n - r + 1 items. n−r+1n - r + 1 choices.

Multiply the rr factors:

P(n,r)=n×(n−1)×(n−2)×⋯×(n−r+1)P(n, r) = n \times (n - 1) \times (n - 2) \times \dots \times (n - r + 1)


This product equals n!/(n−r)!n! / (n - r)! because the rr factors are exactly the top rr terms of n!n!, with the bottom n−rn - r terms canceled by the (n−r)!(n - r)! in the denominator.

The tool visualizes the equivalent factoring: fix the first item (nn ways), then arrange r−1r - 1 of the remaining n−1n - 1 items in order ((n−1)!/(n−r)!(n - 1)!/(n - r)! ways). Every row in the completed section is one of those nn first-item families.
P(5, 3) = 60Complete · 60 / 60SOURCE (n = 5)12345BUILD AREA (r = 3)#1#2#3COMPLETED60 / 6011231241251321341351421431451521531542213214215231234235241243245251253254331231431532132432534134234535135235444124134154214234254314324354514524535512513514521523524531532534541542543
P(5, 3) complete, frozen

Sixty ordered triples in five rows of twelve: the product 5 × 4 × 3 drawn to scale, stopping after exactly three factors.

The frozen frame above is the derivation at full stretch: P(5,3)=5×4×3=60P(5, 3) = 5 \times 4 \times 3 = 60 ordered triples, five rows of twelve. The chain runs exactly three factors and stops — the factors 2×12 \times 1 that a full permutation would keep multiplying belong to the two leftover items and never enter the count.

Sixty is also where enumeration starts arguing for the formula: every card is on screen, but nobody would list them by hand. One stepper click to r=4r = 4 would give 120120, and r=5r = 5 the same 120120 again — a curious plateau explained at the r = n boundary.