What Is a Combination with Replacement?
A combination with replacement (also called a multiset combination) counts the number of ways to choose r items from n distinct types when repetition is allowed and the order of selection does not matter. Unlike ordinary combinations, the same item may be picked more than once. This calculator computes that count using the multiset formula \(C(n+r-1, r)\).
How to Use This Calculator
Enter the number of distinct item types n (for example, 5 flavors of ice cream) and the number of items you want to choose r (for example, scooping 3 cones). The tool returns the number of distinct multisets — selections that differ only by which types appear and how many times, ignoring order.
The Formula Explained
The result is given by $$\overline{C}(n,r) = \binom{n+r-1}{r} = \frac{(n+r-1)!}{r!\,(n-1)!}.$$ The intuition is the "stars and bars" model: place \(r\) identical stars into \(n\) bins separated by \(n-1\) bars; each arrangement corresponds to one selection. To avoid factorial overflow, this calculator evaluates the binomial coefficient multiplicatively.
Worked Example
Suppose an ice cream shop offers \(n = 5\) flavors and you want a bowl of \(r = 3\) scoops, repeats allowed. Then $$C(5+3-1, 3) = C(7, 3) = \frac{7!}{3!\cdot 4!} = 35.$$ There are 35 different bowls you can build.
FAQ
How is this different from a normal combination? A normal combination \(C(n, r)\) forbids repeats; here the same type can be chosen multiple times.
Can r be larger than n? Yes. Because repetition is allowed, \(r\) may exceed \(n\) — for example choosing 10 scoops from 3 flavors is valid.
What if r is 0? Choosing nothing yields exactly 1 way (the empty multiset), so the result is 1.