What this calculator does
This tool builds a table of combinations with repetition, also called multiset coefficients. Given n distinct item types, it computes how many unordered selections of size r you can make when each item may be chosen any number of times — for every integer r from a start value to an end value. The function is written \(H(n, r)\) and equals the binomial coefficient \(C(n + r - 1, r)\).
How to use it
Enter the number of distinct items n (at least 1), then a starting value and ending value of r. The calculator returns one row per r, each showing the exact count \(H(n, r)\). Because these numbers grow extremely fast, the engine uses exact big-integer arithmetic, so even large tables stay precise.
The formula explained
The classic "stars and bars" argument shows that choosing r items from n types with repetition is the same as placing r identical stars into n bins separated by n − 1 bars. The number of arrangements of these n + r − 1 symbols is \(C(n + r - 1, r)\). Two special cases matter: \(H(n, 0) = 1\) (the empty selection) and \(H(1, r) = 1\) (only one multiset of r copies of the single item).
$$\overline{C}(n, r) = \binom{\text{Items }(n) + r - 1}{r} = \frac{\left(\text{Items} + r - 1\right)!}{r!\,\left(\text{Items} - 1\right)!}$$
Worked example
Take n = 5 and r from 0 to 4. \(H(5,0) = C(4,0) = 1\), \(H(5,1) = C(5,1) = 5\), \(H(5,2) = C(6,2) = 15\), \(H(5,3) = C(7,3) = 35\), and \(H(5,4) = C(8,4) = 70\). So the table reads 1, 5, 15, 35, 70. As a second check,
$$H(30,4) = C(33,4) = \frac{33 \cdot 32 \cdot 31 \cdot 30}{24} = 40920.$$FAQ
How is this different from ordinary combinations? Ordinary combinations \(C(n, r)\) forbid repeats; here each item type can be picked multiple times, which is why the index becomes \(n + r - 1\).
Does order matter? No. {A, A, B} is the same selection as {B, A, A}. If order mattered you would use permutations with repetition (\(n^r\)) instead.
Why can the counts get so large? The multiset coefficient grows roughly like a polynomial of degree \(n - 1\) in r, so big n or big r produces astronomically large integers — handled here with exact arithmetic.