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
- Enter n, the number of different types you can choose from.
- Enter r, the total number of items you pick.
- Optionally require a minimum count of every type.
- Read the number of combinations and the equivalent counts for integer equations.
Combinations with Repetition Formula
Combinations with repetition
Non-negative integer solutions
Positive integer solutions
Minimum m of each type
Combinations with Repetition Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| n | Number of types to choose from | |
| r | Number of items chosen | Can exceed n |
| C(n + r − 1, r) | Combinations with repetition | Order ignored |
| nʳ | Ordered arrangements with repetition | Order counted |
Combinations with Repetition Worked Example
Using the example values (press “Load example” above to try them):
- Treat the r chosen items as r stars and the divisions between the n types as n − 1 bars.
- Arrange 8 stars and 4 bars in a row: 12 positions, choose which 8 are stars.
- Count = C(5 + 8 − 1, 8) = C(12, 8) = 495.
Result: Combinations with repetition, 8 from 5 types = 495.
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 matters? | Repetition allowed? | Count |
|---|---|---|
| Yes | No | n!/(n − r)! (nPr) |
| Yes | Yes | nʳ |
| No | No | n!/(r!(n − r)!) (nCr) |
| No | Yes | C(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
Counting selections such as scoops from several flavours.
Distributing identical items
Counting ways to share identical objects among people.
Integer solutions
Counting solutions to x₁ + … + xₙ = r.
Combinatorics coursework
Checking stars-and-bars problems.
Common Combinations with Repetition Mistakes to Avoid
- Check whether each type is available in unlimited supply; if supply is limited, repetition has an upper cap.
- Do not confuse unordered multisets with ordered sequences (nʳ).
- For “at least one of each” subtract the forced items first, as the minimum field does.
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ʳ.