When you pick r items from n types and order does not matter, but the same type can appear more than once, ordinary C(n,r) is too small.
About this calculator
When you pick r items from n types and order does not matter, but the same type can appear more than once, ordinary C(n,r) is too small. The correct count is C(n+r−1, r).
Example: choose 3 scoops from 5 flavors with repeats allowed. Stars-and-bars gives C(5+3−1, 3) = C(7,3) = 35 flavor combinations.
Enter n and r to get the multiset count instantly. For selections without repetition use [[permutation-combination]]. For ordered picks with repetition try [[permutations-with-replacement]]. For row entries see [[pascals-triangle]].
Common uses
- Count ice-cream flavor combos with repeated scoops
- Solve stars-and-bars homework problems
- Estimate multiset sizes in probability
- Compare with ordinary combinations C(n,r)
Frequently asked questions
What is C(5+3−1, 3)?
C(7,3) = 35. That is the number of ways to pick 3 items from 5 types when repeats are allowed and order does not matter.
How is this different from C(n,r)?
C(n,r) forbids repeats and requires r ≤ n. With replacement, r can exceed n and the same type can appear multiple times.
Why does the formula use n+r−1?
Imagine r identical stars and n−1 dividers. Arranging them uniquely encodes which type each pick belongs to. The count is C(n+r−1, r).
When do I use combinations with replacement?
Use it when categories are distinct but picks within a category are identical — scoops, coins, or balls drawn with replacement and sorted into groups.