SOLVETUTORMATH SOLVER

Instrument MI-07-040 · Statistics

Combinations with Repetition Calculator

Three scoops of the same ice cream flavor is a perfectly valid order — this instrument counts unordered selections under exactly that rule: repeats are not just allowed, they're expected.

Instrument MI-07-040
Sheet 1 OF 1
Rev A
Verified
Type 07 — Combinatorics SER. 2026-07040

Combinations with repetition

35

C(n+r-1, r) — the stars-and-bars formula

The working Every figure verified twice
  1. c = comb(5 + 3 − 1, 3) = 35
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

Combinations with repetition count unordered selections of r items from n available types, where the same type can be chosen more than once. Order still doesn't matter — 3 scoops of chocolate is one outcome, not three — but unlike the plain combination formula, the pool never runs out, since nothing stops you from picking the same flavor again and again. The formula is C(n + r − 1, r), often called the stars-and-bars formula because of the classic proof: represent r selections as r stars and use n − 1 bars to divide them among n categories, then count the arrangements of that combined row of stars and bars.

Because repeats are allowed, r is never capped by n the way it is in ordinary combinations — you can choose 3 scoops from only 2 flavors, or 10 toppings from a menu of 4, and the formula handles it without complaint. That's the clearest tell that a problem calls for this version rather than the plain combination or permutation formulas: ask whether the same item could legitimately be picked more than once in a single selection, and whether more picks than available types is still a sensible request.

The n − 1 in the formula comes directly from the stars-and-bars construction: dividing r stars into n groups only needs n − 1 dividing bars, since the last group's boundary is implied once the first n − 1 are placed. That's why the total number of symbols being arranged is n + r − 1, and why the formula chooses r of those positions (or equivalently n − 1 of them) to be stars rather than bars.

(n+r1r)=(n+r1)!r!(n1)!\binom{n+r-1}{r} = \dfrac{(n+r-1)!}{r!\,(n-1)!}
n — number of distinct types available · r — items chosen, with repeats permitted · order doesn't matter, only how many of each type are chosen · known as the stars-and-bars formula.
  • Enter the number of distinct types available into n (types available) — for example, 5 ice cream flavors.
  • Enter how many items are being chosen into r (items chosen, repeats allowed) — for example, 3 scoops.
  • Read Combinations with repetition beneath the inputs; the instrument computes C(n + r − 1, r) for you.
  • Unlike the plain combination instrument, r is allowed to exceed n here — since repeats are permitted, you can choose more picks than there are types available.
  • If repeats genuinely cannot happen in your scenario — each item usable at most once — use the combination or combinations-without-repetition instrument instead, which follows C(n, r) rather than C(n + r − 1, r).

Worked example — 3 scoops chosen from 5 ice cream flavors

An ice cream counter offers 5 flavors, and a cone gets 3 scoops, with repeats allowed — 3 scoops of the same flavor is a valid order, and the order the scoops are stacked in doesn't matter. Enter n = 5 and r = 3. The instrument computes C(5 + 3 − 1, 3) = C(7,3) = 7! / (3! × 4!) = (7 × 6 × 5) / (3 × 2 × 1) = 210 / 6 = 35. Combinations with repetition reads 35.

That 35 counts every distinct way to fill a 3-scoop cone from 5 flavors, including cones with two or three scoops of the same flavor, which a plain no-repeats combination count would exclude entirely. Choosing 3 different flavors out of 5 with no repeats allowed would instead give the much smaller C(5,3) = 10 — the extra 25 outcomes here all involve at least one flavor being picked more than once.

Questions

What does "stars and bars" mean?

It's the standard proof technique behind this formula: represent the r items you're choosing as r stars in a row, and use n − 1 bars to split that row into n groups, one group per type. The number of ways to arrange r stars and n − 1 bars together is C(n + r − 1, r) — exactly the combinations-with-repetition count, because each arrangement corresponds to a distinct count of how many of each type was chosen.

How is this different from ordinary combinations (nCr)?

Ordinary combinations, C(n, r), assume each item can be chosen at most once, so r can never exceed n. This instrument assumes repeats are allowed — the same type can be picked more than once — so the formula becomes C(n + r − 1, r) instead, and r is free to exceed n. Choosing 3 flavors from 5 with no repeats gives C(5,3) = 10; allowing repeats gives C(7,3) = 35.

Can r be larger than n here?

Yes, and that's actually a hallmark of this formula. Since the same type can be selected more than once, you can choose more items than there are types available — 10 scoops from just 3 flavors is a perfectly valid request. The combinations-without-repetition instrument, by contrast, rejects r > n outright, since it can't reuse an item once it's been picked.

What happens when r = 1?

Repetition becomes moot with a single pick, and the formula reduces to C(n, 1) = n — simply the number of types available, since there's exactly one way to "repeat" a single choice: not at all. Choosing 1 item from 10 types with repetition allowed, for example, gives C(10 + 1 − 1, 1) = C(10,1) = 10.

What's a real-world example besides ice cream flavors?

Choosing toppings where a topping can be doubled up, filling a box of 6 donuts from 4 available types, or distributing identical prizes among winners are all combinations-with-repetition problems. The common thread is always the same: order doesn't matter, and the same option can legitimately be selected more than once.

References