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.
What is a combinations with replacement calculator?
A combinations with replacement calculator counts unordered selections when you choose r items from n types and repeats are allowed. Order does not matter. The count is C(n+r−1, r), the stars-and-bars formula used in CBSE probability units.
How to use the Combinations with Replacement Calculator
- Enter n, the number of distinct item types.
- Enter r, how many items you pick in total.
- Use non-negative integers; r may exceed n.
- Read C(n+r−1, r) as the multiset count.
- Compare with ordinary C(n,r) when repeats are forbidden.
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]].
Formula for combinations with replacement
Count = C(n + r − 1, r) = (n + r − 1)! ÷ (r! × (n − 1)!)- n is the number of distinct categories or flavors
- r is the number of picks, repeats allowed
- Order does not matter; only the multiset matters
Combinations with replacement example: 3 scoops, 5 flavors
Set n = 5 flavor types and r = 3 scoops with repeats allowed. Stars-and-bars gives C(5+3−1, 3) = C(7, 3) = 35 flavor combinations.
Check: C(7,3) = 7×6×5 ÷ (3×2×1) = 35. Ordinary C(5,3) = 10 would wrongly forbid repeating a flavor.
If n = 2 coin types and r = 4 coins, C(2+4−1,4) = C(5,4) = 5 multisets. Enter the same n and r in the calculator to match 35 and 5 for these cases.
Another check: n = 3 types and r = 10 picks gives C(12,10) = C(12,2) = 66. Enter those values to confirm the multiset count rises quickly when r grows.
Pick 2 laddoos from 4 sweet types with repeats allowed: C(4 + 2 − 1, 2) = C(5, 2) = 10 multisets. Enter n = 4 and r = 2 to match 10.
A canteen offers 3 chutney types and you take 6 idlis with repeats: C(3 + 6 − 1, 6) = C(8, 6) = 28 flavor counts. Stars-and-bars matches because order on the plate does not matter.
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.
Related calculators
- Math Calculator
- Percentage Calculator
- Fraction Calculator
- Exponent Calculator
- Logarithm Calculator
- Nth Root Calculator
- Ratio Calculator
- Pythagorean Theorem
Maintained by J Jaya Prakash · Last updated: October 2026