ToolNimba Browse

🔢 Combinations with Repetition Calculator

By ToolNimba Math Team · Updated 2026-06-19

With repetition allowed, C(n+r-1, r)
-
Without repetition, standard C(n, r)
-
How the answer is built
-

Enter n (number of distinct types, 1 or more) and r (how many you pick, 0 or more). Repetition lets you pick the same type more than once.

Combinations with repetition count how many ways you can choose r items from n types when you are allowed to pick the same type more than once and the order does not matter. Think of scooping 3 ice cream cones from 5 flavors where doubles are fine. Enter n (the number of types) and r (how many you choose), and this calculator returns the multiset coefficient C(n+r-1, r) instantly, along with the standard no-repeats count for comparison.

What is the Combinations with Repetition Calculator?

A combination with repetition (also called a multiset, a combination with replacement, or n multichoose r) is a selection of r items drawn from n distinct types, where any type may appear any number of times and the arrangement does not matter. Because repeats are allowed, the result is usually larger than an ordinary combination. The count is given by the multiset coefficient C(n + r − 1, r), which equals (n + r − 1)! ÷ (r! (n − 1)!). The same value can be written C(n + r − 1, n − 1), since those two binomial coefficients are equal by symmetry.

The cleanest way to understand the formula is the stars and bars argument. Imagine you must place r identical stars into n labelled bins, one bin per type, where the number of stars in a bin says how many of that type you chose. To mark the boundaries between the n bins you need n − 1 dividers, the bars. Lay out the r stars and n − 1 bars in a single row: every distinct arrangement of that row corresponds to exactly one valid selection. There are r + (n − 1) positions in total, and you simply choose which r of them hold stars, which is C(n + r − 1, r). That single picture explains where every part of the formula comes from.

Combinations with repetition differ from the three other counting cases you meet alongside them. Ordinary combinations C(n, r) forbid repeats and ignore order. Permutations nPr forbid repeats but respect order. Permutations with repetition give n^r when order matters and repeats are allowed. Combinations with repetition are the remaining case: repeats allowed, order ignored. Choosing the right one hinges on two yes or no questions, can an item be picked again, and does the order of the picks matter. Get those two answers right and the formula follows.

When to use it

  • Counting the ways to choose a handful of scoops, donuts, or sweets from a fixed set of flavors where repeats are allowed.
  • Working out how many non-negative integer solutions an equation like x1 + x2 + ... + xn = r has, a direct stars and bars problem.
  • Counting distinct outcomes when rolling several identical dice, where only the multiset of faces matters, not which die showed what.
  • Finding the number of monomials of a given degree in several variables, a common step in algebra and combinatorics courses.

How to use the Combinations with Repetition Calculator

  1. Enter n, the number of distinct types you can choose from (must be 1 or more).
  2. Enter r, how many items you are selecting in total (0 or more, and repeats are allowed).
  3. Read the combinations-with-repetition count C(n+r-1, r) from the highlighted box.
  4. Compare it with the standard no-repeats count C(n, r) shown alongside, and check the working line to see the formula applied.

Formula & method

Combinations with repetition = C(n + r − 1, r) = (n + r − 1)! ÷ (r! (n − 1)!), where n is the number of distinct types and r is the number of items chosen. By stars and bars this is the number of ways to place r identical stars into n bins separated by n − 1 bars.

Worked examples

An ice cream shop has 5 flavors. You buy a cup with 3 scoops and doubles are allowed. How many distinct cups are possible if order does not matter?

  1. Here n = 5 types and r = 3 picks, with repetition allowed.
  2. Apply the formula: C(n + r − 1, r) = C(5 + 3 − 1, 3) = C(7, 3).
  3. C(7, 3) = 7 × 6 × 5 ÷ (3 × 2 × 1) = 210 ÷ 6 = 35.
  4. For comparison, with no repeats it would be C(5, 3) = 10, so allowing doubles more than triples the count.

Result: C(7, 3) = 35 distinct cups with repetition (versus 10 without).

How many non-negative integer solutions does x1 + x2 + x3 + x4 = 10 have?

  1. Each unit of the total 10 is a star; the 4 variables are 4 bins, needing n − 1 = 3 bars.
  2. So n = 4 types and r = 10 items, and the answer is C(n + r − 1, r) = C(4 + 10 − 1, 10) = C(13, 10).
  3. C(13, 10) = C(13, 3) = 13 × 12 × 11 ÷ (3 × 2 × 1) = 1716 ÷ 6 = 286.

Result: There are C(13, 10) = 286 non-negative integer solutions.

Combinations with repetition C(n+r-1, r) versus standard C(n, r) for small n and r

n typesr chosenWith repetitionNo repetition
3263
42106
533510
635620
104715210

Which counting formula to use, by repetition and order

Repeats allowed?Order matters?FormulaName
NoNoC(n, r)Combination
NoYesn! ÷ (n − r)!Permutation
YesNoC(n + r − 1, r)Combination with repetition
YesYesn^rPermutation with repetition

Common mistakes to avoid

  • Using n instead of n + r − 1 in the top of the binomial. The combinations-with-repetition formula is C(n + r − 1, r), not C(n, r). Forgetting to add r − 1 to the top index gives the ordinary no-repeats count and badly undercounts the true number of selections.
  • Confusing types (n) with picks (r). n is the number of distinct kinds available to choose from, and r is how many you take in total. Swapping them changes the answer unless n and r happen to be equal, so read each problem carefully before plugging in.
  • Counting order when it should be ignored. If two orderings of the same picks count as the same outcome (like the contents of a bag), use combinations with repetition. If order distinguishes them, you want a permutation count of n^r instead.
  • Assuming r cannot exceed n. With repetition allowed, r can be larger than n because the same type may be chosen many times. Choosing 10 scoops from 5 flavors is perfectly valid, and the formula handles it. Only the no-repeats count needs r at most n.

Glossary

Combination with repetition
A selection of r items from n types where repeats are allowed and order does not matter, counted by C(n + r − 1, r).
Multiset coefficient
Another name for the combinations-with-repetition count, often written as n multichoose r.
Stars and bars
A counting technique that places r identical stars into n bins using n − 1 bars, giving C(n + r − 1, r) arrangements.
Binomial coefficient
The value C(a, b) = a! ÷ (b! (a − b)!), the number of ways to choose b items from a distinct items without repetition.
n (types)
The number of distinct kinds of item available to pick from.
r (picks)
The number of items you select in total, with repeats permitted.

Frequently asked questions

What is the formula for combinations with repetition?

The number of combinations with repetition is the multiset coefficient C(n + r − 1, r) = (n + r − 1)! ÷ (r! (n − 1)!), where n is the number of distinct types and r is how many items you choose. It can also be written C(n + r − 1, n − 1) by the symmetry of binomial coefficients.

How does stars and bars explain the formula?

Picture r identical stars (your picks) and n − 1 bars (dividers between the n types) laid in a row. Every arrangement of stars and bars corresponds to one valid selection. There are n + r − 1 positions, and you choose which r hold stars, giving C(n + r − 1, r).

Can r be larger than n with repetition?

Yes. Because the same type can be chosen many times, r may exceed n. For example you can pick 10 scoops from just 5 flavors. This is different from ordinary combinations, where r must not be larger than n.

What is the difference between combinations with and without repetition?

Without repetition each type can be chosen at most once, counted by C(n, r). With repetition a type can be chosen any number of times, counted by the larger value C(n + r − 1, r). In both cases the order of the picks is ignored.

When should I use combinations with repetition instead of permutations?

Use combinations with repetition when repeats are allowed and order does not matter, such as the contents of a bag. If order matters as well as repeats, use permutations with repetition, which give n^r instead.

Is the multiset coefficient the same as combinations with replacement?

Yes. Combinations with repetition, combinations with replacement, multiset coefficient, and n multichoose r are all names for the same count, C(n + r − 1, r). Different fields favor different terms but the value is identical.