Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Simple Combinations

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 subset size; 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 and the only subset is the whole set: one card, C(n,n)=1C(n, n) = 1. Learn more about the r = n case
  4. Step ▶ moves one ball into the build set, ◀ Back undoes one step, ▶ Play builds every subset, ↺ Reset clears the completed rows, 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 C(n,r)C(n, r) with its total and the status: Group of the current smallest item with its count, or Complete. Learn more about getting started
  6. The build set has rr slots with no position numbers; balls land smallest first along a dotted guide line, and used items dim in the source row. Learn more about the build set
  7. Finished subsets land under COMPLETED, one tinted row per smallest item; the rows shrink as the smallest item gets larger. Learn more about grouping by smallest item
  8. The right panel adds a row for each smallest-item group with its progress and a one-line count of how the rest of the subset is picked. Learn more about the right panel


Press ▶ Play to build all C(n, r) subsets, or Step ▶ to advance one ball at a time. Subsets are unordered — balls are shown in canonical order, smallest first.
● BallsA Letters
n =3?
r =2?
Speed
C(3, 2) = 3Press Play or Step to beginSOURCE (n = 3)123BUILD SET (size r = 2)
Simple combinations
C(3, 2) = 3! / (2! · (3−2)!) = 3
Choose r items from n distinct items — order does not matter, no repetition. Each subset is counted r! times among the partial permutations, so C(n, r) = P(n, r) / r! = n! / (r! · (n−r)!).
The slots carry no numbers — a subset has no first or second member, and that absence is the whole difference from the permutation tools. Learn more about getting started · What is a combination





Key Terms



Key Terms

Combination — an unordered selection of rr items from a set of nn distinct items, with no item reused. The count is C(n,r)=n!/(r!⋅(n−r)!)C(n, r) = n! / (r! \cdot (n - r)!).

C(n,r)C(n, r) / (nr)\binom{n}{r} / "nn choose rr" — three notations for the same value, the binomial coefficient. All count the number of size-rr subsets of an nn-element set.

Order doesn't matter — {A,B,C}\{A, B, C\} and {C,A,B}\{C, A, B\} are the same combination. This is what distinguishes combinations from permutations.

Canonical order — the visual convention for showing each subset: always smallest element first, then in increasing order. This keeps equivalent subsets from looking different on screen.

Smallest-item group — the family of combinations whose smallest element is a given item. The completed section groups results this way. Group sizes vary: the group whose smallest is index ii has (n−1−ir−1)\binom{n - 1 - i}{r - 1} subsets.

Build set — the build area for this scenario. Slots have no #1,#2,…\#1, \#2, \dots labels because position is meaningless inside a set.

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 set in the middle with rr unlabeled slots — the absence of numbers signals that order doesn't matter inside a combination.

• A completed section below, where every finished subset is filed under the row matching its smallest element.

To run the visualization:

• Press ▶ Play to auto-build all C(n,r)C(n, r) subsets.

• 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 C(n,r)=totalC(n, r) = \text{total} alongside a live status line such as *Group A: kk / size* while building, or *Complete · total / total* when done.
C(3, 2) = 3Press Play or Step to beginSOURCE (n = 3)123BUILD SET (size r = 2)
(n, r) = (3, 2), idle, frozen

Two waiting slots with no position numbers — the only build area on these pages with nothing to label, because a subset has no first member.

The frozen frame above is the opening position, and its most eloquent feature is a small absence: the two waiting slots carry no position numbers. Every other build area on these pages labels its slots #1, #2, … — here there is nothing to label, because a subset has no first or second member.

Everything else about the frame is familiar from the ordered tools: same balls, same source row, same machinery. The entire difference between P(n,r)P(n, r) and C(n,r)C(n, r) lives in those missing labels.

The Build Set

DemoUnlabeled slots, smallest first
Step 0 of 5
The build area is labeled *BUILD SET (size r = R)* — set, not sequence, because order doesn't matter. What to watch:

• Empty slot outlines with dashed borders, without #\# labels. Each slot is just a placeholder for one item in the subset; the slot's left-to-right position carries no meaning.

• Balls land in canonical order — smallest item first — so subsets render consistently and visually equivalent subsets look identical.

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

• In the source row, an item already used in the current build (or in flight) is dimmed.

• When all rr slots are filled, a flash ring briefly pulses around the build set, and the completed subset is copied to the appropriate smallest-item row below.

The absence of position numbers is the visual signature of a combination — a deliberate contrast with the labeled #1,#2,…\#1, \#2, \dots slots in the permutation visualizers.
C(3, 2) = 3Group Blue: 0 / 1SOURCE (n = 3)123BUILD SET (size r = 2)23COMPLETED2 / 3112132
(3, 2) mid-build, frozen

The third subset under way: B landed, C on its dotted guide — always smallest-first, a canonical spelling rather than an order.

The frozen frame above catches the third subset mid-build: B has landed, C is riding its dotted guide, and the two completed {A,⋅}\{A, \cdot\} subsets already sit filed above. Because balls always land smallest-first, the arrangement being built is not an order — it is a canonical spelling of a set.

Canonical order is a bookkeeping trick, not a mathematical claim: {B,C}\{B, C\} and {C,B}\{C, B\} are one subset, and the tool simply refuses to draw the second spelling. That refusal, applied everywhere, is exactly the division by r!.

Adjusting n and r

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

• n sets the size of the source set.

• r sets the subset size. The constraint r≤nr \leq n is enforced; reducing nn below the current rr clamps rr down automatically.

Common combinations:

• n=3,r=2n = 3, r = 2: C(3,2)=3C(3, 2) = 3 subsets.

• n=4,r=2n = 4, r = 2: C(4,2)=6C(4, 2) = 6 subsets.

• n=4,r=3n = 4, r = 3: C(4,3)=4C(4, 3) = 4 subsets.

• n=5,r=2n = 5, r = 2: C(5,2)=10C(5, 2) = 10 subsets.

• n=5,r=3n = 5, r = 3: C(5,3)=10C(5, 3) = 10 subsets — the worked grouping example below.

• n=5,r=5n = 5, r = 5: C(5,5)=1C(5, 5) = 1 — the whole set is the only size-nn subset.

A useful symmetry to spot: C(n,r)=C(n,n−r)C(n, r) = C(n, n - r). Picking rr items to include and picking n−rn - r items to exclude give the same count, which is why C(5,2)=C(5,3)=10C(5, 2) = C(5, 3) = 10.
C(5, 2) = 10Complete · 10 / 10SOURCE (n = 5)12345BUILD SET (size r = 2)COMPLETED10 / 10112131415223242533435445
C(5, 2) complete, frozen

Ten pair-cards — and every pair silently names the triple it leaves behind: C(5, 2) = C(5, 3) by include/exclude symmetry.

The frozen frame above is C(5,2)C(5, 2) completed — ten pair-cards — and it is one half of the symmetry stated in the last paragraph. Run C(5,3)C(5, 3) next and count again: ten cards, differently shaped. Every pair in this frame silently names the triple it leaves behind, and vice versa.

The include/exclude reading deserves to be more than a mnemonic: choosing who sits on the committee and choosing who stays home are the same decision. Whenever rr passes n/2n/2, the smaller complement is the easier count — nobody computes C(49,43)C(49, 43) except as C(49,6)C(49, 6).

Grouping by Smallest Item

DemoRows by smallest item
Step 0 of 5
The completed section organizes subsets by their smallest element — every subset whose minimum is the same item appears in the same row.

Group sizes vary. If the smallest item has index ii (counting from 00), then the other r−1r - 1 items must be chosen from the n−1−in - 1 - i items strictly larger than it:

group size at smallest index i=(n−1−ir−1)\text{group size at smallest index } i = \binom{n - 1 - i}{r - 1}


For example with n=5,r=3n = 5, r = 3:

• Smallest is item 1: pick 2 from the 4 items above it. (42)=6\binom{4}{2} = 6 subsets.

• Smallest is item 2: pick 2 from 3. (32)=3\binom{3}{2} = 3 subsets.

• Smallest is item 3: pick 2 from 2. (22)=1\binom{2}{2} = 1 subset.

Total: 6+3+1=10=C(5,3)6 + 3 + 1 = 10 = C(5, 3). This decomposition is the visual proof of Pascal's identity in action — summing (n−1−ir−1)\binom{n - 1 - i}{r - 1} over valid ii values reconstructs (nr)\binom{n}{r}, as laid out under related concepts.

Each row in the completed area sizes itself to its group's count, so rows shrink as the smallest item gets larger.
C(5, 3) = 10Complete · 10 / 10SOURCE (n = 5)12345BUILD SET (size r = 3)COMPLETED10 / 10112312412513413514522342352453345
C(5, 3) complete, frozen

Ten triples in a staircase of rows: 6 + 3 + 1 by smallest element — Pascal’s identity drawn as shrinking shelves.

The frozen frame above is that worked example completed: C(5,3)C(5, 3) as three rows of 66, 33, and 11 triples. The staircase shape is not decoration — each step down reflects a shrinking pool of larger items to draw from.

Notice also which item never fronts a row: with r=3r = 3 from five items, nothing above index 22 can be a minimum, because a smallest element needs at least r−1r - 1 items above it. The grouping teaches its own boundary conditions.

When r = n: One Subset

Push rr up to nn and the choice disappears: taking five items from five leaves nothing to decide. The count collapses to its floor:

C(n,n)=n!n!⋅0!=1C(n, n) = \frac{n!}{n! \cdot 0!} = 1


Run it at n=5,r=5n = 5, r = 5 and the completed section holds a single card containing every ball — the whole set, the only subset of full size. The 0!=10! = 1 convention quietly holds the denominator together, just as it does at the other extreme C(n,0)=1C(n, 0) = 1 (the empty set).

The symmetry C(n,r)=C(n,n−r)C(n, r) = C(n, n - r) frames both extremes at once: choosing everything and choosing nothing are mirror decisions, each with exactly one outcome.
C(5, 5) = 1Complete · 1 / 1SOURCE (n = 5)12345BUILD SET (size r = 5)COMPLETED1 / 1112345
C(5, 5) complete, frozen

One card holding every ball: taking all five from five leaves nothing to decide — the count at its floor of 1.

One is the loneliest count in combinatorics, and it always signals the same thing: no freedom left. Between the two extremes the counts rise and fall along a row of Pascal's triangle, peaking at the middle r≈n/2r \approx n/2 — the setting with the most genuine choice.

The single-card run is also the fastest way to sanity-check the tool's grouping logic: with r=nr = n only one smallest-item group can exist (the group of the very first item), and its size formula (n−1n−1)=1\binom{n-1}{n-1} = 1 agrees. Boundaries are where formulas either shine or break; this one shines — see the derivation for the general machinery.

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 subset or pausing mid-build.

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

• ▶ Play / ⏸ Pause — runs the animation continuously until all C(n,r)C(n, r) subsets are built, then auto-pauses.

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

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.

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 smallest-item avatar in each completed group is a circle with the item's number. Best for tracking which subsets share the same minimum visually.

• Letters mode — items appear with letter labels (A, B, C, …). The smallest-item avatar in each group is just the letter, colored to match. Best for reading off the subset as a set like {A,C,D}\{A, C, D\} and connecting to algebraic notation.

The encoding is consistent across the source row, the build set, 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 Simple combinations with the full formula C(n,r)=n!/(r!⋅(n−r)!)=totalC(n, r) = n! / (r! \cdot (n - r)!) = \text{total} and a one-line reminder that each subset is counted r!r! times among partial permutations, so C(n,r)=P(n,r)/r!C(n, r) = P(n, r) / r!.

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

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

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

• A short narration of the structure: *Smallest item is A. Pick the remaining r−1r - 1 from B, C, D, and E: (4r−1)\binom{4}{r-1} subsets.* For r=1r = 1 the narration says the subset is just the single item; when the smallest is the highest valid index, the subset is fully determined.

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

What Is a Combination

A combination is an unordered selection of rr items from a set of nn distinct items, with no item used twice. The count of size-rr subsets is the binomial coefficient:

C(n,r)=(nr)=n!r!⋅(n−r)!C(n, r) = \binom{n}{r} = \frac{n!}{r! \cdot (n - r)!}


The same value is read as *"n choose r"*.

Examples:

• Choosing a committee of 33 from 1010 people: C(10,3)=120C(10, 3) = 120 committees.

• Number of 55-card poker hands from a 5252-card deck: C(52,5)=2,598,960C(52, 5) = 2{,}598{,}960 hands.

• Number of size-22 subsets of {1,2,3,4}\{1, 2, 3, 4\}: C(4,2)=6C(4, 2) = 6, namely {1,2},{1,3},{1,4},{2,3},{2,4},{3,4}\{1, 2\}, \{1, 3\}, \{1, 4\}, \{2, 3\}, \{2, 4\}, \{3, 4\}.

• Drawing a lottery ticket of 66 numbers from 4949: C(49,6)=13,983,816C(49, 6) = 13{,}983{,}816 possible tickets.

The combination is the right model whenever a problem asks which items are chosen but not in what order — and reuse is not allowed.

On this page the idea runs live: from the opening position the unlabeled build set fills smallest-first, results file into smallest-item groups, n and r rescale the count with its include/exclude symmetry, and the boundary r=nr = n collapses everything to a single subset.

For deeper coverage, see the combinations section on the combinations theory page.

Deriving C(n,r)

The cleanest derivation goes through the partial permutation. Start by counting ordered selections of rr items from nn — that's P(n,r)=n!/(n−r)!P(n, r) = n! / (n - r)!.

Now ask: how many of those ordered selections correspond to the same unordered subset? Every subset of size rr can be arranged in r!r! different orders, and the partial permutation counts each order separately. So:

C(n,r)=P(n,r)r!=n!r!⋅(n−r)!C(n, r) = \frac{P(n, r)}{r!} = \frac{n!}{r! \cdot (n - r)!}


Equivalently, by direct counting at the position level:

• If order had mattered, the count would be n×(n−1)×⋯×(n−r+1)n \times (n - 1) \times \dots \times (n - r + 1).

• Because order doesn't matter, divide by the r!r! permutations of each chosen subset.

The tool visualizes the equivalent decomposition: every subset has a unique smallest element. Group by that smallest. The group whose smallest is index ii contributes (n−1−ir−1)\binom{n - 1 - i}{r - 1} subsets — the number of ways to fill the other r−1r - 1 slots from the n−1−in - 1 - i larger items. Summing across all valid ii values yields (nr)\binom{n}{r}.
C(3, 2) = 3Complete · 3 / 3SOURCE (n = 3)123BUILD SET (size r = 2)COMPLETED3 / 311213223
C(3, 2) complete, frozen

Three subset cards where the ordered tool shows six: each card quietly absorbs the 2! spellings of the same pair.

The frozen frame above is the division made visible at the smallest scale: C(3,2)=3C(3, 2) = 3 subsets, where the partial permutation tool shows P(3,2)=6P(3, 2) = 6 ordered pairs for the same inputs. Set the two frames side by side and pair them up — ABAB with BABA, ACAC with CACA, BCBC with CBCB — exactly 2!=22! = 2 ordered spellings collapsing onto each card here.

That two-to-one pairing is the formula. The division by r!r! is not an algebraic trick but a census of duplicates, and at n=3,r=2n = 3, r = 2 it is small enough to check by pointing.