Combinations with Repetition Calculator

This combinations with repetition calculator counts the ways to choose r items from n types when the same type can be chosen more than once and order does not matter. The stars-and-bars working is shown.

Forces at least this many of every type.

Checks on your data

  • This counts selections where the same type can be chosen several times and order does not matter. Without repetition use C(n, r); if order matters too the answer is simply nʳ. Without repetition →

Results

Combinations with repetition, 8 from 5 types
495
multichoose
Stars-and-bars form: C(n + r − 1, r)
C(12, 8)
Without repetition C(n, r)
0 (r exceeds n)
Ordered with repetition nʳ
390,625
Non-negative integer solutions of x₁ + … + xₙ = r
495
same count
Positive integer solutions (each xᵢ ≥ 1)
35
C(r − 1, n − 1)
Multisets of size k from 5 types (with repetition) vs without
0500100015000: 1011: 5152: 152153: 353354: 704705: 12651266: 21062107: 33073308: 49584959: 715971510: 100110100111: 136511136512: 1820121820
C(n + r − 1, r) for small n and r
n \ r12345
111111
223456
336101521
4410203556
55153570126
Show step-by-step solution
  1. Treat the r chosen items as r stars and the divisions between the n types as n − 1 bars.
  2. Arrange 8 stars and 4 bars in a row: 12 positions, choose which 8 are stars.
  3. Count = C(5 + 8 − 1, 8) = C(12, 8) = 495.
FormulaC(n + r − 1, r)
Also calledMultichoose, combination with replacement
TechniqueStars and bars
OrderDoes not matter

What Is Combinations with Repetition?

When repeats are allowed and order is ignored, the number of combinations is C(n + r − 1, r). This is also the number of non-negative integer solutions of x₁ + x₂ + … + xₙ = r, which is why the stars-and-bars technique counts it.

The calculator also shows the count when each type must appear at least once, the count with a minimum of m of each type, the ordered count nʳ and the combinations without repetition C(n, r) for comparison. Use it for problems such as choosing scoops of ice cream or distributing identical items among people.

Below you will find the formulas, a variables table, a worked example and answers to common questions such as how this differs from ordinary combinations.

How to Use the Combinations with Repetition Calculator

  1. Enter n, the number of different types you can choose from.
  2. Enter r, the total number of items you pick.
  3. Optionally require a minimum count of every type.
  4. Read the number of combinations and the equivalent counts for integer equations.

Combinations with Repetition Formula

Combinations with repetition

( ⁣ ⁣(nr) ⁣ ⁣)=(n+r−1r)\left(\!\!\binom{n}{r}\!\!\right)=\binom{n+r-1}{r}

Non-negative integer solutions

x1+x2+⋯+xn=r ⇒ (n+r−1n−1)x_1+x_2+\cdots+x_n=r\ \Rightarrow\ \binom{n+r-1}{n-1}

Positive integer solutions

(r−1n−1)\binom{r-1}{n-1}

Minimum m of each type

(n+(r−mn)−1r−mn)\binom{n+(r-mn)-1}{r-mn}

Combinations with Repetition Variables Explained

SymbolMeaningNotes
nNumber of types to choose from
rNumber of items chosenCan exceed n
C(n + r − 1, r)Combinations with repetitionOrder ignored
nʳOrdered arrangements with repetitionOrder counted

Combinations with Repetition Worked Example

With the example values loaded in the calculator above, the steps are:

  1. Treat the r chosen items as r stars and the divisions between the n types as n − 1 bars.
  2. Arrange 8 stars and 4 bars in a row: 12 positions, choose which 8 are stars.
  3. Count = C(5 + 8 − 1, 8) = C(12, 8) = 495.

Result: Combinations with repetition, 8 from 5 types = 495.

How to Read the Count

Combinations with repetition count unordered selections where the same type can be chosen more than once. The stars-and-bars formula is C(n + r − 1, r). Choosing 8 items from 5 types gives C(12, 8) = 495.

The same number counts the non-negative integer solutions of x₁ + … + xₙ = r. If each type must appear at least once, first set one of each aside and count the rest: C(r − 1, n − 1).

Stars and bars explained

Suppose you want 3 scoops from vanilla, chocolate, strawberry and mint (n = 4). Write the scoops as stars and divide the four flavours with three bars. The pattern ★|★|★| means one vanilla, one chocolate, one strawberry and no mint, while ★★||★| means two vanilla, no chocolate, one strawberry and no mint. Every arrangement of 3 stars and 3 bars is one valid choice, and there are C(6, 3) = 20 of them.

Choosing between the four counting formulas

Order and repetition
Order matters?Repetition allowed?Count
YesNon!/(n − r)! (nPr)
YesYesnʳ
NoNon!/(r!(n − r)!) (nCr)
NoYesC(n + r − 1, r) (this tool)

Typical problems solved by this formula

  • Distributing identical objects among distinct people or boxes.
  • Counting non-negative integer solutions to x₁ + x₂ + … + xₙ = r.
  • Choosing a bag of fruit, donuts or coins when you can repeat types.
  • Counting monomials of degree r in n variables.
  • Dice outcomes when only the multiset of faces matters, such as the 56 distinct unordered outcomes of rolling three six-sided dice (C(8, 3)).

Where Combinations with Repetition Is Used

Choosing with repeats

Count ways to pick items from types such as ice-cream flavours.

Distributing identical objects

Count ways to share identical items among people.

Integer solutions

Count solutions to a sum equation.

Dice outcomes

Count unordered results of several dice.

Common Combinations with Repetition Mistakes to Avoid

  • Use this when order does not matter and repeats are allowed.
  • Without repetition, use C(n, r) instead.
  • For a minimum of each type, subtract the minimums from r first.
  • Do not confuse with nʳ, which counts ordered arrangements.

Combinations with Repetition Terms and Definitions

Multiset
A collection in which items can appear more than once and order is ignored.
Stars and bars
A counting trick that maps selections to arrangements of stars and dividing bars.

Combinations with Repetition FAQs

What is the formula for combinations with repetition?

C(n + r − 1, r), where n is the number of types and r is the number of items chosen.

What is the difference between combinations with and without repetition?

Without repetition each item can be picked once, giving C(n, r). With repetition you may pick the same type again, which gives more outcomes.

How do I count the ways to distribute identical objects?

Use stars and bars: distributing r identical objects among n people gives C(n + r − 1, r) ways.

How many unordered outcomes do three dice have?

C(6 + 3 − 1, 3) = C(8, 3) = 56, though they are not equally likely.

What if each type must appear at least once?

Give each type one item first and distribute the remaining r − n items freely. The count is C(r − 1, n − 1).

Does order matter here?

No. ABB and BAB are the same selection. If order matters the count is nʳ.

Related calculators

Last updated 2026-11-09. See our disclaimer.